This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: [PATCH][PR ld/10144] MIPS/BFD: Don't make debug section relocs dynamic


"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> On Wed, 10 Nov 2010, Richard Sandiford wrote:
>
>> > OK, will try to fix that this weekend.  I still think dc.a is the
>> > right thing for the test, but see below.
>> 
>> So, I looked at it this weekend, and I longer think dc.a is the right
>> thing for the test.  It seemed so well suited, but as you point out,
>> it's based on the ISA address size rather than the ABI or file
>> format address size, which probably makes it of limited use.  Oh well.
>
>  I agreed with you .dc.a is the right approach and have only been 
> concerned about the correctness of the implementation for MIPS targets or 
> elsewhere.
>
>  Given your consideration I have just now looked into it as well and it 
> looks to me our MIPS target should simply override TC_ADDRESS_BYTES with 
> its own function that will return 8 for the n64 ABI and the EABI and 4 
> with all the other ABIs (I reckon o64 assumes 32-bit addresses too, 
> correct?), or the currently selected ISA-implied address size if no ABI 
> has been selected, such as with the ECOFF targets -- we have that logic 
> implemented elsewhere already, so the return value of function should 
> reduce to an expression along the lines of (4 << HAVE_64BIT_ADDRESSES).  
> The existence of the macro itself suggests this is something that was 
> intended for some platforms to do with the original implementation even 
> though no target makes such an override at the moment.
>
>  Or do you have a documentation reference for .dc.a that claims it should 
> behave otherwise?

Well, the point is: this kind of situation is by no means exclusive
to MIPS.  Plenty of other targets allow 64-bit architecturees to use a
32-bit ABI and a 32-bit file format.  If .dc.a was supposed to select
the ABI address size, it could/should/would have used other hooks to
get that size.  E.g. the code in bfd.c:is32bit would probably have
been a better starting point.

As it stands, .dc.a means the architecture address size for all platforms.
We shouldn't change the meaning on MIPS alone and introduce an inconsistency.
And IMO we shouldn't change the meaning at all, given that the directive
has already been released into the wild.  We could of course add a new
directive, but I personally don't think it's worth it.  You'd have to
convince another maintainer if you wanted to do that. :-)

Please just go ahead with your original is_elf64 test.

Richard


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