From: David Daney <ddaney@avtrex.com>
To: Thiemo Seufer <ths@networkno.de>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] Change MIPS linker stubs to allow for more than 2^15 symbols.
Date: Thu, 08 Jun 2006 00:25:00 -0000 [thread overview]
Message-ID: <44876B02.8020608@avtrex.com> (raw)
In-Reply-To: <20060607235846.GA7706@networkno.de>
Thiemo Seufer wrote:
> 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.
Which rule would that be? Is there such a requirement for function
entry points?
>
>
>>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.
I don't know mips64 well enough to know how to load an unsigned 32 bit
constant. So It had to be 2^31.
>
> [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?
We are not using hi/lo relocations, so there is no requirement for this.
The calculation in the linker is easier this way.
>
> [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?
>
Probably, but I got lazy.
Please comment on my responses, and then I will generate a new patch.
David Daney.
next prev parent reply other threads:[~2006-06-08 0:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-07 23:58 David Daney
2006-06-08 0:11 ` Thiemo Seufer
2006-06-08 0:25 ` David Daney [this message]
2006-06-08 10:07 ` Thiemo Seufer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44876B02.8020608@avtrex.com \
--to=ddaney@avtrex.com \
--cc=binutils@sourceware.org \
--cc=ths@networkno.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).