PR 12001, --defsym

H.J. Lu hjl.tools@gmail.com
Thu Jan 13 13:37:00 GMT 2011


On Thu, Jan 13, 2011 at 5:28 AM, Alan Modra <amodra@gmail.com> wrote:
> On Thu, Jan 13, 2011 at 11:35:39PM +1030, Alan Modra wrote:
>> Given this bug report and Daniel's objections over using a linker
>> script assignment to control ld behaviour, I've implemented a new
>> LD_FEATURE linker script keyword.
>
> I've kept the new code in open_input_bfds handling early creation of
> --defsym symbols, but only handle --defsym assignments there so we
> won't get an error if a script defines a symbol that is also defined
> in an object file.  LD_FEATURE is designed to be extensible;  At the
> moment we just have LD_FEATURE ("SANE_EXPR").
>
>        PR ld/12356
>        * ld.texinfo (Miscellaneous Commands): Describe LD_FEATURE.
>        (Expression Section): Update.
>        * ld.h (ld_config_type): Add sane_expr.
>        * ldgram.y (ifile_p1): Add LD_FEATURE.
>        * ldlex.l (LD_FEATYRE): New.
>        * ldemul.c (after_parse_default): Delete code handling ld_compatibility.
>        * ldexp.h (struct ldexp_control): Delete uses_defined.
>        * ldexp.c: Remove all uses of uses_defined.
>        (fold_name): Test config.sane_expr rather than ld_compatibility.
>        (exp_fold_tree_1): Likewise.  Adjust handling of assignments
>        during first phase.
>        * ldlang.h (ld_compatibility): Delete.
>        (lang_ld_feature): Declare.
>        * ldlang.c (ld_compatibility): Delete.
>        (open_input_bfds): Only handle assignments for --defsym.
>        (lang_ld_feature): New function.
>

You should add some testcases for this new feature.


-- 
H.J.



More information about the Binutils mailing list