This is the mail archive of the binutils@sources.redhat.com 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]

[patch] ld [pei]: Filter off unnecessary symbols from auto-export


Hello binutils,

  Attached patch adds more sophisticated rules for (turnable off)
filtering of symbols in --export-all-symbols case. Without it, it's
easy to get DLL not linkable at all (due to exporting of strictly
per-module symbols). I first did it by filtering symbol-by-symbol, but
this approach fails miserably with C++. So, I did what is written in
ChangeLog entry:

2000-11-09  Paul Sokolovsky  <Paul.Sokolovsky@technologist.com>

        * pe-dll.c (auto_export): pass (optional) bfd containing
        symbol to allow for contextual filtering. Filter all
        symbols coming from libgcc.a. Also, filter all symbols
        starting with two underscores. Finally, do not re-export
        symbols imported from DLLs.

Example of exports from C++ dll:

EXPORTS
    _$_8DllClass @1
    _8DllClass$instances @2 DATA
    _CRT_MT @3 DATA
    __12DllClassBase @4
    __8DllClassi @5
    _vt$12DllClassBase @6 DATA
    _vt$8DllClass @7 DATA
    atexit @8
    global_dllclass1 @9 DATA
    global_dllclass2 @10 DATA
    global_int_variable @11 DATA
    non_virtual_method__C8DllClass @12
    virtual_method__C12DllClassBase @13
    virtual_method__C8DllClass @14

- exported exactly what's needed plus couple of symbols from crt.o I
don't bother to provide output without patch applied - it contains
hundreds of junk symbols.


--
Paul Sokolovsky, IT Specialist
http://www.brainbench.com/transcript.jsp?pid=11135

binutils.diff.4


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