[PATCH] D25627: [ELF] Allow linker script to use .got and .got.plt sections as inputs

Eugene Leviant via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 02:41:21 PDT 2016


evgeny777 added inline comments.


================
Comment at: test/ELF/linkerscript/output-to-input.s:16
+# RUN:  .got.plt : {} \
+# RUN: }" > %t1.script
+
----------------
grimar wrote:
> Do you really need to specify order of sections to demonstrate output with/without merging of .got/got.plt ?
> I mean shouldn't next work ?
> 
> 
> ```
> # RUN: echo "SECTIONS { \
> # RUN:  .got : {} \
> # RUN:  .got.plt : {} \
> # RUN: }" > %t1.script
> ```
> 
> ```
> # RUN: echo "SECTIONS { \
> # RUN:  .got : { *(.got) *(.got.plt)  } \
> # RUN: }" > %t2.script
> ```
You should have equal offsets between .plt and .got.plt section in both cases to get same contents of .got.plt.
Of course it's possible to create smaller examples with the same effect, but in this case result would depend on orphan
section placement algorithm


================
Comment at: test/ELF/linkerscript/output-to-input.s:42
+
+## Last 16 bytes of .got section should be equal to contents
+## of .got.plt section from previous test.
----------------
grimar wrote:
> Last 32 bytes you mean ? (3 + 1) entries * 8.
You're right - that's a mistake.


Repository:
  rL LLVM

https://reviews.llvm.org/D25627





More information about the llvm-commits mailing list