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]

Re: Controlling dynsym/symtab output


Hi,

On Mon, 9 May 2016, Evan Klitzke wrote:

> 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.

ld doesn't export any symbols for executables by default (except those 
required for correctness, like e.g. destination of copy relocs).  Use -E 
aka --export-dynamic to change this (if you do that you should be able to 
use the various ld options to manipulate the dynamic symbol list)P.


Ciao,
Michael.


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