[PATCH] D36145: [ELF] - Do not segfault when doing logical and/or operations on symbols that have no output sections.

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 1 10:01:23 PDT 2017


George Rimar via Phabricator <reviews at reviews.llvm.org> writes:

> Index: test/ELF/linkerscript/early-assign-symbol.s
> ===================================================================
> --- test/ELF/linkerscript/early-assign-symbol.s
> +++ test/ELF/linkerscript/early-assign-symbol.s
> @@ -7,6 +7,12 @@
>  # RUN: echo "SECTIONS { aaa = ABSOLUTE(foo - 1) + 1; .text  : { *(.text*) } }" > %t2.script
>  # RUN: not ld.lld -o %t --script %t2.script %t.o 2>&1 | FileCheck %s
>  
> +# RUN: echo "SECTIONS { aaa = foo | und; .text  : { *(.text*) } }" > %t3.script
> +# RUN: not ld.lld -o %t --script %t3.script %t.o 2>&1 | FileCheck %s
> +
> +# RUN: echo "SECTIONS { aaa = foo & und; .text  : { *(.text*) } }" > %t4.script
> +# RUN: not ld.lld -o %t --script %t4.script %t.o 2>&1 | FileCheck %s

Do you have to used an undefined symbol? I would assume that it would
crash before with just "foo | 42", no?

LGTM with that.

Cheers,
Rafael


More information about the llvm-commits mailing list