[committed]: --wrap breaks CRX relaxation in a specific case
Tomer Levi
Tomer.Levi@nsc.com
Tue Dec 14 15:43:00 GMT 2004
Hi,
The following patch fixes a bug in CRX relaxation, regarding the --wrap
linker's option.
The '--wrap SYMBOL' option is causing a pain when the object file,
containing the definition of __wrap_SYMBOL, includes a direct call to
SYMBOL as well :
void *
__wrap_malloc (size_t n)
{
printf ("malloc called with %zu\n", n);
return __real_malloc (n);
}
int
main (void)
{
return malloc (100) == 0;
}
Since both __wrap_SYMBOL and SYMBOL reference the same symbol (which is
__wrap_SYMBOL), but still exist as two different symbols in 'sym_hashes',
we don't want to adjust the global symbol __wrap_SYMBOL twice when
relaxing.
This change also involves a change in 'elf32_crx_relax_delete_bytes'
prototype.
Here is the ChangeLog :
2004-12-14 Tomer Levi <Tomer.Levi@nsc.com>
* elf32-crx.c (elf32_crx_relax_delete_bytes): Add 'struct
bfd_link_info *' to prototype, to make hash info available.
Prevent wrapped symbols from being adjusted twice.
Committed and checked using compiler internal testsuite.
Regards,
Tomer Levi
Software Engineer phone:
+49-8141-35-1378
CompactRISC Development Tools fax: +49-8141-35-11-1378
National Semiconductor GmbH mailto:Tomer.Levi@nsc.com
Livry-Gargan Str. 10 internet:
http://www.national.com
82256 Fuerstenfeldbruck, Germany
-------------- next part --------------
A non-text attachment was scrubbed...
Name: elf32-crx.c.patch
Type: application/octet-stream
Size: 4328 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20041214/4641bdeb/attachment.obj>
More information about the Binutils
mailing list