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]

Controlling dynsym/symtab output


Hi all,

I'm interested in creating an executable that can be loaded by dlopen
as a DSO. My understanding is that it is possible to do this if the
executable is compiled as a PIE, and indeed I can dlopen executables
compiled with gcc -fPIC -pie. However, when I do this all of my
symbols end up in the .symtab section even if they are marked with
default visibility and are not static, and it appears that dlopen will
only load symbols from the .dynsym section.

Is there a way to get ld to put my symbols into the .dynsym section?
I've read some of the linker script documentation but it's not clear
to me if this is the right path to go down or how I would use a linker
script to control which symbol table things end up in.

-- 
evan klitzke
w: https://eklitzke.org/
e: evan@eklitzke.org


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