This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Change MIPS linker stubs to allow for more than 2^15 symbols.
- From: Thiemo Seufer <ths at networkno dot de>
- To: David Daney <ddaney at avtrex dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 8 Jun 2006 00:58:46 +0100
- Subject: Re: [PATCH] Change MIPS linker stubs to allow for more than 2^15 symbols.
- References: <44875F75.7020307@avtrex.com>
David Daney wrote:
> As noted in this thread:
>
> http://sourceware.org/ml/binutils/2006-06/msg00086.html
>
> The mips linker would not reliably allow for more than 2^15 dynamic
> symbols. This prevents GCC's libgcj java runtime library from being
> correctly linked.
>
> The consensus was to increase the size of the linker stubs by one
> instruction so that objects with many dynamic symbols could be supported.
>
> I increased the size of the stub from 16 to 20 bytes.
It may be useful to use 24 bytes, this adheres to the ABI alignment
rule of 2^3.
> The new stubs
> support up to 2^31 dynamic symbols. That should be enough for at least
> the short term. With the patch applied I can now successfully build and
> run libgcj from a recent GCC-4.2 snapshot on mipsel-linux.
Hm, 2^32 symbols would nicely fit the maximum for NewABI.
[snip]
> *** 631,642 ****
> ((ABI_64_P (abfd) \
> ? 0x03e0782d /* daddu t7,ra */ \
> : 0x03e07821)) /* addu t7,ra */
> #define STUB_JALR 0x0320f809 /* jalr t9,ra */
> ! #define STUB_LI16(abfd) \
> ! ((ABI_64_P (abfd) \
> ! ? 0x64180000 /* daddiu t8,zero,0 */ \
> ! : 0x24180000)) /* addiu t8,zero,0 */
> ! #define MIPS_FUNCTION_STUB_SIZE (16)
>
> /* The name of the dynamic interpreter. This is put in the .interp
> section. */
> --- 631,640 ----
> ((ABI_64_P (abfd) \
> ? 0x03e0782d /* daddu t7,ra */ \
> : 0x03e07821)) /* addu t7,ra */
> + #define STUB_LUI 0x3c180000 /* lui t8,0 */
> #define STUB_JALR 0x0320f809 /* jalr t9,ra */
> ! #define STUB_LI16 0x34180000 /* ori t8,zero,0 */
> ! #define MIPS_FUNCTION_STUB_SIZE (20)
Why not the conventional expansion of lui/(d)addiu?
[snip]
> *** 8013,8027 ****
> MIPS_ELF_STUB_SECTION_NAME (dynobj));
> BFD_ASSERT (s != NULL);
>
> - /* FIXME: Can h->dynindx be more than 64K? */
> - if (h->dynindx & 0xffff0000)
> - return FALSE;
> -
When it is 2^31, shoudn't we continue to test for overflow?
Thiemo