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]

ld option --dynamic-list does not work?


Hello,

recently, I tried to link an executable with options

 "--export-symbols --dynamic-list=syms.txt"

to control/reduce the entries in the .dynsym table. [Some symbols
are needed there for dlopen() in my case.]

However, I only get a "syntax error in dynamic list" error message
from ld.

I tried to stick to the usage of ld as described in:
http://sourceware.org/binutils/docs-2.20/ld/Options.html#Options
http://sourceware.org/binutils/docs-2.20/ld/VERSION.html#VERSION

Nonetheless I might have done something wrong in the "dynamic list file",
maybe someone can help me here?

Let's take a simplified example:

1. My source code is:

==== test1.c

int main() { return 0; }
void f() {}   /* shall be visible for dlopen() */
void g() {}   /* shall not show up in .dynsym */

==== end test1.c

2. My "dynamic list file" is:

==== syms.txt

# Export only f.
{
    global : f;
    local  : *;
};

==== end of syms.txt

3. Then I compile link this with:

$ gcc -Wl,--export-dynamic,--dynamic-list=syms.txt  test1.c -o test1
ld:syms.txt:3: syntax error in dynamic list
collect2: ld returned 1 exit status

All this happens under Linux (Ubuntu 9.10), with ld 2.20 and gcc4.4.

Best regards,
Vivenzio
-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser


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