This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

objcopy does not affect STB_GNU_UNIQUE symbols


We are making extensive use of partial linking to ring-fence portions of a 
large application and its plugins in a controlled manner.

We've hit globally unique (STB_GNU_UNIQUE) that result from libstdc++ 
libraries (tested gcc 5.3.0)

But these are untouched by any of the objcopy flags; eg.

  objcopy -L '*'
  objcopy -L _ZNSt10moneypunctIwLb0EE2idE
  objcopy --localize-hidden

which the manual states localises all symbols, but in practice does not 
affect the UNIQUE ones (tested binutils 2.25)

  $ readelf -W -a partial.o | grep _ZNSt10moneypunctIwLb0EE2idE
  [...]
   27943: 0000000000000000     8 OBJECT  UNIQUE HIDDEN  19194 _ZNSt10moneypunctIwLb0EE2idE

I expect the developers of libstdc++ have their reasons for these to be 
process-wide, but our requirement is to control the scope just as we are 
already able to do with GLOBAL symbols.

How can we manipulate these symbol definitions? Or localise them at 
partial-link time?

I've found references that it's possible to build the compiler to not emit 
these symbols [1] however that is rather unweildy solution.

[1] http://stackoverflow.com/questions/11931420/gcc-g-building-without-gnu-unique-object-symbols-for-older-linux-kernels

Many thanks

-- 
Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]