This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Stop mixing order of -defsym/-script commands.
ClosedPublic

Authored by grimar on Jan 15 2018, 2:06 AM.

Details

Summary

Previously we always handled -defsym after other commands in command line.
That made impossible to overload values set by -defsym from linker script:

 test.script:            
  foo = 0x22;
-defsym=foo=0x11 -script t.script

would always set foo to 0x11.

That is inconstent with common logic which allows to override command line
options. it is inconsistent with bfd behavior and seems breaks assumption that
-defsym is the same as linker script assignment, as -defsyms always handled out of
command line order.

Patch fixes the handling order.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Jan 15 2018, 2:06 AM
grimar updated this revision to Diff 129820.Jan 15 2018, 2:07 AM
  • Fixed comment.
ruiu accepted this revision.Jan 16 2018, 12:52 PM

LGTM

This revision is now accepted and ready to land.Jan 16 2018, 12:52 PM
This revision was automatically updated to reflect the committed changes.