[PATCH] (version 2) Change MIPS linker stubs to allow for more than 2^15 symbols.

Thiemo Seufer ths@networkno.de
Sun Jun 11 08:21:00 GMT 2006


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.


Thiemo



More information about the Binutils mailing list