[lld] r302668 - [ELF] - Don't segfault when assigning non-calculatable absolute symbol value.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 05:07:07 PDT 2017


>> ==============================================================================
>> --- lld/trunk/test/ELF/linkerscript/early-assign-symbol.s (added)
>> +++ lld/trunk/test/ELF/linkerscript/early-assign-symbol.s Wed May 10 09:23:33 2017
>> @@ -0,0 +1,14 @@
>> +# REQUIRES: x86
>> +# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
>> +
>> +# RUN: echo "SECTIONS { aaa = 1 + ABSOLUTE(foo - 1); }" > %t1.script
>> +# RUN: not ld.lld -o %t --script %t1.script %t.o 2>&1 | FileCheck %s
>> +
>> +# RUN: echo "SECTIONS { aaa = ABSOLUTE(foo - 1) + 1; }" > %t2.script
>> +# RUN: not ld.lld -o %t --script %t2.script %t.o 2>&1 | FileCheck %s
>> +
>> +# CHECK: error: unable to evaluate expression: input section .text has no output section assigned
>> +
>> +.section .text
>> +.globl foo
>> +foo:
>
>This depends on where we place the orphan .text, no? I would suggest
>making that explicit in the test.
>
>Cheers,
>Rafael

Yeah, r302792. Thanks !

George.


More information about the llvm-commits mailing list