This is an archive of the discontinued LLVM Phabricator instance.

[ELF] Process linker scripts deeper when declaring symbols.
ClosedPublic

Authored by ikudrin on Feb 7 2018, 2:24 AM.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

ikudrin created this revision.Feb 7 2018, 2:24 AM
grimar added a comment.Feb 7 2018, 3:19 AM

Looks fine for me. Suggestions below.

ELF/LinkerScript.cpp
191

It's large. I would make it static helper instead then.
(probably would change argument type to SymbolAssignment* too)

test/ELF/linkerscript/version-script.s
8

It should be multiline, because exceeds 80 columns per line limit.

ikudrin updated this revision to Diff 133370.Feb 7 2018, 9:47 PM

Address review comments.

ikudrin marked 2 inline comments as done.Feb 7 2018, 9:47 PM
grimar added a comment.Feb 8 2018, 1:33 AM

LGTM with a nit.
(please wait for other reviewers approval)

test/ELF/linkerscript/version-script.s
16

Sorry for not being clear, I was mean it can not be single line because of 80 limit,
but we generally are trying to keep scripts short in testcases, it can be something,
just like:

echo "SECTIONS { .text : { bar = foo; *(.text) }} \
      VERSION { V { global: foo; bar; local: *; }; }" > %t.script
grimar accepted this revision.Feb 8 2018, 1:33 AM
This revision is now accepted and ready to land.Feb 8 2018, 1:33 AM
ikudrin updated this revision to Diff 133559.Feb 8 2018, 9:14 PM

Shorten the script in the test.

@ruiu, @rafael is it OK to apply?

Ping. @espindola, @ruiu, is it OK to land?

Ping. Is there anything I can improve here?

@ruiu, @rafael, in spite of this revision is accepted by @grimar, he asked me to wait for your approval.

ruiu accepted this revision.Feb 27 2018, 8:37 PM

LGTM

test/ELF/linkerscript/version-script.s
9

Can you write this way so %t.script consists of two lines instead of one?

  1. RUN: echo "SECTIONS { .text : { bar = foo; *(.text) } }" > %t.script
  2. RUN: echo "VERSION { V { global: foo; bar; local: *; }; }" >> %t.script

If something goes wrong, lld prints out an error message with "^" marker to point out the error location, but that is almost useless if a line is too long.

This revision was automatically updated to reflect the committed changes.