This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Controlling dynsym/symtab output
- From: Evan Klitzke <evan at eklitzke dot org>
- To: binutils at sourceware dot org
- Date: Mon, 9 May 2016 14:05:41 -0700
- Subject: Controlling dynsym/symtab output
- Authentication-results: sourceware.org; auth=none
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