// We want to set symbol values early if we can. This allows us to use symbols
// as variables in linker scripts. Doing so allows us to write expressions
// like this: `alignment = 16; . = ALIGN(., alignment)`
- uint64_t SymValue = Value.isAbsolute() ? Value.getValue() : 0;
+ uint64_t SymValue = Value.Sec ? 0 : Value.getValue();
replaceBody<DefinedRegular>(Sym, nullptr, Cmd->Name, /*IsLocal=*/false,
Visibility, STT_NOTYPE, SymValue, 0, Sec);
return Sym->body();
# CHECK: error: {{.*}}.script:1: unable to evaluate expression: input section .text has no output section assigned
+# Simple case that we can handle.
+# RUN: echo "SECTIONS { aaa = ABSOLUTE(foo); .text : { *(.text*) } }" > %t4.script
+# RUN: ld.lld -o %t --script %t4.script %t.o
+
.section .text
.globl foo
foo: