[PATCH] D29391: [ELF] - Postpone the evaluation of DefinedSynthetic value

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 13:05:51 PST 2017


I am taking a look the code, but some quick comments on the test:

> Index: test/ELF/linkerscript/non-absolute2.s
> ===================================================================
> --- test/ELF/linkerscript/non-absolute2.s
> +++ test/ELF/linkerscript/non-absolute2.s
> @@ -0,0 +1,28 @@
> +# REQUIRES: x86
> +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
> +# RUN: echo "SECTIONS { A = . - 0x9; . += 0x1000; }" > %t.script

You can use A = . + 1. As written it gives the impression that having a
negative value is important.

> +# RUN: ld.lld -shared %t1.o --script %t.script -o %t
> +# RUN: llvm-objdump -section-headers %t | FileCheck %s --check-prefix=DUMP
> +# RUN: llvm-readobj -t %t | FileCheck %s --check-prefix=SYMBOL

You can porbably use just llvm-objdup -section-headers -t, no?


> +# DUMP:       Sections:
> +# DUMP-NEXT:   Idx Name          Size      Address
> +# DUMP-NEXT:    0               00000000 0000000000000000
> +# DUMP-NEXT:    1 .text         00000006 0000000000001000
> +
> +# SYMBOL:     Symbol {
> +# SYMBOL:        Name: A
> +# SYMBOL-NEXT:   Value: 0xFFFFFFFFFFFFFFF7
> +# SYMBOL-NEXT:   Size: 0
> +# SYMBOL-NEXT:   Binding: Local
> +# SYMBOL-NEXT:   Type: None
> +# SYMBOL-NEXT:   Other [
> +# SYMBOL-NEXT:     STV_HIDDEN
> +# SYMBOL-NEXT:   ]
> +# SYMBOL-NEXT:   Section: .text
> +# SYMBOL-NEXT: }
> +
> +.text
> + movl A(%rip), %eax
> +
> +.hidden A

The symbol doesn't need to be used or hidden. Just make this file
empty. Please be sure to always simplify the test, that way it is clear
what is being fixed.

Cheers,
Rafael


More information about the llvm-commits mailing list