[PATCH] [lld][LinkerScript] Add matching of output sections to segments

Sean Silva chisophugis at gmail.com
Thu Jun 11 14:11:26 PDT 2015


================
Comment at: test/elf/linkerscript/phdrs-invalid.test:10-35
@@ +9,28 @@
+
+(command line clang -c simple.S -o simple.o)
+
+      .text
+      main:
+        mov $1, %eax
+        movq $1, %rdi
+        movq $msg, %rsi
+        movq $14, %rdx
+        syscall
+        ret
+
+        .globl _start
+      _start:
+        call  main
+        mov $60, %eax
+        syscall
+        ret
+
+      .data
+      msg: .asciz "Hello, World!\n"
+*/
+
+/*
+Prepare the object file to test on.
+
+RUN: yaml2obj -format=elf %p/Inputs/simple.o.yaml -o=%t.o
+*/
----------------
silvas wrote:
> denis-protivensky wrote:
> > silvas wrote:
> > > You can directly use llvm-mc instead of yaml2obj.
> > Good point, but I'd prefer to use yaml2obj for consistency with other tests in lld, and because we already have the corresponding yaml file, so there's no need to add another one with assembly code.
> There's been discussion about this recently on the mailing lists. Whichever tool is most convenient should be used (in this case, llvm-mc is clearly the most convenient). Generally speaking, yaml2obj has been overused in LLD.
Actually now that I think about it (and discuss with Bigcheese), what this is testing is completely independent of the actual section content, so it doesn't make sense to have an assembly input (or an input generated from assembly). I think that yaml2obj is the right tool here, and that the test case can be significantly reduced from one generated from the one you would get from the assembly.

http://reviews.llvm.org/D10359

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list