This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] (version 2) Change MIPS linker stubs to allow for more than 2^15 symbols.
Thiemo Seufer <ths@networkno.de> writes:
> Eric Christopher wrote:
>> I usually prefer this style:
>>
>> >-#define STUB_LUI(VAL) (0x3c180000 + (VAL)) /* lui t8,VAL */
>
> plus
>
>>- bfd_put_32 (output_bfd, STUB_LUI ((h->dynindx >> 16) & 0x7fff),
>>- stub + idx);
>>- idx += 4;
>
> or rather:
>
>>-/* Instructions which appear in a stub. */
>>-#define STUB_LW(abfd) \
>>- ((ABI_64_P (abfd) \
>>- ? 0xdf998010 /* ld t9,0x8010(gp) */ \
>>- : 0x8f998010)) /* lw t9,0x8010(gp) */
>
> plus
>
>>- idx = 0;
>>- bfd_put_32 (output_bfd, STUB_LW (output_bfd), stub + idx);
>
> elsewhere ...
>
>> To this...
>>
>> >+ /* Fill the stub. */
>> >+ bfd_put_32 (output_bfd, (ABI_64_P (output_bfd)
>> >+ ? 0xdf998010 /* ld t9, 0x8010(gp) */
>> >+ : 0x8f998010), /* lw t9, 0x8010(gp) */
>> >+ stub);
>
> All those macros are only used once, so I prefer to have the
> information in a single place in the file.
FWIW, I agree with Eric here. Having macros for hard-coded constants
is good, even if they're only used once. IOW I prefer the way it is now.
I don't feel strongly enough to argue about it further though. ;)
Dan, I've applied the patch I posted to HEAD and 2.17 branch.
Richard