Is it possible to use a linker script to preserve unreferenced static C++ class instances defined in a static library?
Erik Christiansen
dvalin@internode.on.net
Fri May 17 11:52:00 GMT 2013
On 16.05.13 15:51, Bob Mowry wrote:
> Currently I'm using this linker script in an attempt to get the
> linker to keep all items in the .data segment:
>
> SECTIONS
> {
> .data :
> {
> KEEP(*(.data))
> }
> }
>
> But it seems to have no impact.
Is it certain that the input section names match ".data"?
Something like .data1 or .data.suchlike would need .data* (or .data?),
and .data.*, respectively. The '*' outside the inner braces is only
saying "any filename".
Hopefully that takes us a step closer to the cause.
Erik
--
I really didn't foresee the Internet. But then, neither did the computer
industry. Not that that tells us very much, of course - the computer
industry didn't even foresee that the century was going to end.
- Douglas Adams
More information about the Binutils
mailing list