[patch] Let plugins know the final size of common symbols

Rafael Espíndola rafael.espindola@gmail.com
Mon Sep 8 21:18:00 GMT 2014


When resolving common symbols, gold will always keep the first one it
finds. It will then patch the size if a larger one shows up. This is
fine, but this information is currently never passed to the plugin
which may end up producing a final .o file with a symbol that is too
small.

The attached patch changes Pluginobj::get_symbol_resolution_info to
set the size of  ld_plugin_symbol in addition to the resolution. With
this information the plugin can then update its view on the common
symbol and produce an ELF file where the symbol has the correct size.

Cheers,
Rafael


2014-07-08  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>

        * plugin.h (Sized_pluginobj::do_get_symbol_resolution_info): Moved from
        Pluginobj.
        * plugin.cc (Sized_pluginobj::do_get_symbol_resolution_info): Update the
        symbol size.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: symbol-size.patch
Type: text/x-patch
Size: 2188 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20140908/51faca1c/attachment.bin>


More information about the Binutils mailing list