This is the mail archive of the
mailing list for the binutils project.
Re: Force production of ELF hash table
- From: John Cronin <jncronin at tysos dot org>
- To: binutils at sourceware dot org
- Date: Sun, 21 Apr 2013 20:22:57 +0100
- Subject: Re: Force production of ELF hash table
- References: <5173E970 dot 5040707 at tysos dot org> <CAKOQZ8w_aW4UxLy=4pieWgw6J4DHcSiBqCKsuVfzjtOx8ehaNQ at mail dot gmail dot com>
On 21/04/2013 16:16, Ian Lance Taylor wrote:
Thanks. I suspected this was so. I'll look into a way of adding it
post-hoc (creating it in a separate program then embedding it in a
separate section with objcopy).
On Sun, Apr 21, 2013 at 6:28 AM, John Cronin <email@example.com> wrote:
I am using ld to link an OS kernel. The kernel produced is a statically
linked executable file but supports dynamic modules. I would like to use
the hash table functionality of ELF files to quickly look up symbols within
the statically linked kernel file for dynamically loading the modules
however cannot work out how to ask ld to add the hash table to non-shared
outputs. Is it possible? I see from
the embedded linux guys have had to write their own tool (ksymhash) to
modify the vmlinux image after linking but I was wondering whether there was
a way to ask ld to do it for me. I am using the x86_64-elf target.
There is currently no support for that in either GNU ld or gold. It
would not be enough to simply write out the hash table; you could also
have to provide some way for the program to find it at runtime, since
it would not be able to use the usual dynamic tag mechanism.