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] Fix --defsym to copy symbol attributes.

Alan Modra committed a patch to Gnu ld to fix a problem encountered on
PPC where the --defsym option wasn't copying the st_other bits to the
newly-defined symbol.

Gold has the same problem, and additionally wasn't copying the symbol
type. This patch fixes both problems, by copying the symbol type,
visibility, and the remaining st_other bits to the new symbol for
--defsym=sym1=sym2 assignments.


2014-07-08  Cary Coutant  <>

        * (struct Expression::Expression_eval_info): Add
        new fields type_pointer, vis_pointer, and nonvis_pointer.
        (Expression::eval_maybe_dot): Add type_pointer, vis_pointer, and
        nonvis_pointer parameters. Adjust all calls.
        (Symbol_expression::value): Update type, visibility, and nonvis bits
        in caller.
        * (Symbol_assignment::sized_finalize): Update type,
        visibility, and remaining st_other bits for new symbol.
        * script.h: (Expression::eval_maybe_dot): Add type_pointer,
        vis_pointer, and nonvis_pointer parameters.
        * symtab.h (Symbol::set_type): New method.

        * testsuite/ (defsym_test): New test.
        * testsuite/ Regenerate.
        * testsuite/defsym_test.c: New file.
        * testsuite/ New file.

Attachment: defsym-patch
Description: Binary data

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