[PATCH] D34195: [ELF] Mark symbols referenced from linker script as live

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 11:46:55 PDT 2017


Petr Hosek via Phabricator via llvm-commits
<llvm-commits at lists.llvm.org> writes:

>
> Index: test/ELF/linkerscript/data-commands-gc.s
> ===================================================================
> --- /dev/null
> +++ test/ELF/linkerscript/data-commands-gc.s
> @@ -0,0 +1,22 @@
> +# REQUIRES: x86
> +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
> +# RUN: echo "SECTIONS                \
> +# RUN:  {                            \
> +# RUN:    .text : {                  \
> +# RUN:      *(.text*)                \
> +# RUN:      QUAD(bar)                \
> +# RUN:    }                          \
> +# RUN:  }" > %t.script
> +# RUN: ld.lld --gc-sections -o %t %t.o --script %t.script | FileCheck -allow-empty %s
> +
> +# CHECK-NOT: unable to evaluate expression: input section .rodata.bar has no output section assigned

Instead of checking that a particular error is not printed, check that
the produced file has the expected content.

LGTM with that.

Cheers,
Rafael


More information about the llvm-commits mailing list