This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Temporary patch to fix sparc64 relocation errors (was: Re: Usingbinutils-2.13 on sparc64-sun-solaris2.8 to build gcc-3.1.1 results inrelocation errors)

Brad Spencer wrote:

>After having no success with gcc-3.1 and binutils-2.12.1 on
>sparc64-sun-solaris2.8 (I used binutils-2.11.2 for this target), I've
>tried again with binutils-2.13 and gcc-3.1.1.  I've encountered the
>exact same problem when trying to link C++ programs.  If I swap out
>binutils-2.13 with binutils-2.11.2 (under a gcc-3.1.1 built for
>binutils-2.13) then linking works.
>My latest efforts have included trying to disable HAVE_AS_SPARC_UA_PCREL
>and HAVE_AS_SPARC_UA_PCREL_HIDDEN in gcc, but to no avail.
>Considering I can merely swap out the binutils (and even link
>libraries made with 2.13 and a 2.13-aware compiler), I suspect this is
>a binutils bug.  I post in the hopes that someone can lend me some
>My next step is to start looking at the diffs between 2.11.2 and
>2.12.1 as far as bfd's relocation overflow detection goes.  Am I on
>the right track?  BTW, my latest work has been with a cross compiler,
>but it's no different than when using a native toolchain.
>Previous post follows:
>I've looked through the archives and the comments in gcc-3.1, and it
>looks like this might be some sort of new feature that doesn't quite
>work correctly.  If I configure gcc-3.1 on top of binutils-2.12.1,
>then when I link 64-bit objects, I get things to the effect of
I'm guessing here but it may be that binutils-2.11 was accepting 32-bit 
relocations in situations that needed 64 and either silently converting 
to a 64-bit relocation or worse.

As a temporary solution I've changed the relocation that gcc generates 
on 64-bit sparc targets to always be 64-bit and it seems to work. This 
probably should only be a temporary thing and if possible the generation 
of exception pointers should become somewhat smarter on 64-bit sparc 
targets. I've attached the diffs for this temporary patch to gcc-3.2 to 
get it working with binutils-2.13. I'll go ahead and cross post it to 
the gcc patch list so hopefully someone will at least start looking at 
it closer.

Attachment: sparc.h.diff
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]