This is the mail archive of the 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]

[gold commit] (PR gold/16992) Fix --dynamic-list so that symbols not in the list are still exported

In PR 13577, the complaint was that -Bsymbolic was overriding the binding
behavior for symbols listed in the --dynamic-list by setting the DT_SYMBOLIC
tag in the dynamic table. In reading the Gnu ld manual, I decided that
--dynamic-list should be mutually exclusive of -Bsymbolic, and modified
gold so that --dynamic-list would treat symbols listed as preemptible,
and all other symbols as internally bound. I was wrong.

PR 16992 shows that with --dynamic-list (and not -Bsymbolic), a symbol
not listed in the dynamic list is being internally bound within the
shared library, but because it's still in the dynamic symbol table, we
expose it to a COPY relocation, and things go really bad from there.

(I can reproduce the same failure, simply by turning on -Bsymbolic-functions
with the Gnu linker. Even though the symbol is bound internally, it's
still exported to the dynamic symbol table, and is exposed to a COPY

I've backed out part of the fix for PR 13577, and -Bsymbolic (or
-Bsymbolic-functions) can now be used with --dynamic-list, but if the
two are used together, we do not set DT_SYMBOLIC or DF_SYMBOLIC
(this matches Gnu ld behavior). We now treat symbols listed in the
dynamic list as premptible, but we do not automatically treat symbols
not listed there as non-premptible.


2015-02-16  Cary Coutant  <>

        PR gold/13577
        PR gold/16992
        * (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
        DF_SYMBOLIC if --dynamic-list option is used.
        * (General_options::finalize): --dynamic-list is not
        mutually exclusive with -Bsymbolic.
        * symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
        listed in --dynamic-list.
        * testsuite/ ( Add
        * testsuite/ Regenerate.

Attachment: gold-pr16992.patch
Description: Binary data

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