This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Where to put per-target global BFD data ?
- To: binutils@sourceware.cygnus.com
- Subject: Where to put per-target global BFD data ?
- From: Nick Clifton <nickc@cygnus.com>
- Date: Fri, 18 Jun 1999 10:41:18 +0100
Hi Guys,
I have come across a problem with storing target specific global
data in BFD. Currently targets like the ARM ports create an
extended version of the link hash table, override the default
link_hash_table_create function with their own version, and then
store their data in the new fields now available.
This fails however, when the output format is not the same as the
input format. For example linking together a coff-arm object file
with the command line:
ld -oformat srec foo.o
will fail with a segmentation fault because the hash in the
link_info structure gets created based on the output format (srec)
not the input format (coff-arm). The srec format does not create an
extended structure on the end of the hash table, and so the coff-arm
routines that get called later, and which assume that the coff-arm
version of link_hash_table_create has been called, try to use data
which is not there.
I am not sure how this can be fixed. I think using the hash table
may not be the best way to store global information, because of this
problem, and that another solution needs to be found.
Any suggestions ?
Cheers
Nick