[PATCH] D43632: [ELF] - Add testcase documenting flags assigned when empty synthetic section is removed.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 17:53:52 PST 2018


ruiu accepted this revision.
ruiu added a comment.
This revision is now accepted and ready to land.

LGTM with this fix.



================
Comment at: test/ELF/linkerscript/empty-synthetic-removed-flags.s:3-5
+# RUN: echo "SECTIONS {                          \
+# RUN:         .foo : { *(.foo) }                \
+# RUN:         .bar : { *(.got.plt) BYTE(0x11) }}" > %t.script
----------------
For multi-line linker script, can you avoid using \ for line continuation? I found that that is hard to debug when something goes wrong, because this "echo" ends up with a very long single line with a lot of whitespace characters, and "^" marker doesn't make sense in such output because lines are wrapped around.

You could instead write

  echo "SECTIONS { .foo : { *(.foo) }" > %t.script
  echo "           .bar : { *(.got.plt) BYTE(0x11) }}" >> %t.script

That said, since this example is short, the best way of doing it is to write it in one line.

  echo "SECTIONS { .foo : { *(.foo) } .bar : { *(.got.plt) BYTE(0x11) }}" > %t.script




================
Comment at: test/ELF/linkerscript/empty-synthetic-removed-flags.s:25-27
+# RUN: echo "SECTIONS {              \
+# RUN:         .foo : { *(.foo) }    \
+# RUN:         .bar : { BYTE(0x11) }}" > %t.script
----------------
Ditto


https://reviews.llvm.org/D43632





More information about the llvm-commits mailing list