<div dir="ltr"><div>This appears to be the relevant part of the fuschia linker script:</div><div><br></div><a href="https://github.com/fuchsia-mirror/magenta/blob/fad6801bd5c27e9887e912a3c6883dba463ec3d4/third_party/ulib/musl/ldso/base.ld#L6">https://github.com/fuchsia-mirror/magenta/blob/fad6801bd5c27e9887e912a3c6883dba463ec3d4/third_party/ulib/musl/ldso/base.ld#L6</a><br><div><br></div><div>From the comment it seems like you are intending to create an image-relative symbol, no?</div><div><br></div><div>Peter</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 9, 2016 at 2:43 PM, Petr Hosek <span dir="ltr"><<a href="mailto:phosek@google.com" target="_blank">phosek@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span class=""><div dir="ltr">On Thu, Dec 8, 2016 at 6:32 AM Rafael Avila de Espindola <<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It is entirely possible we just have another case where lld gets<br class="m_8525751479540810442gmail_msg">
confused about a symbol being absolute or not. Can you provide the full<br class="m_8525751479540810442gmail_msg">
original code in musl that fails with lld?<br class="m_8525751479540810442gmail_msg"></blockquote><div><br></div></span><div>I missed your response on the list. The original code that fails with lld is pretty much equivalent to the new test case I've added:</div><div><br></div><div><span class=""><div># RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t</div></span><div># RUN: echo "PROVIDE_HIDDEN(_BASE = 0);" > %t.script</div><span class=""><div># RUN: ld.lld -shared --gc-sections --script %t.script -o %t1 %t</div></span><span class=""><div># RUN: llvm-readobj --elf-output-style=GNU --file-headers --symbols %t1 | FileCheck %s</div></span><span class=""><div># CHECK: 0000000000000000     0 NOTYPE  LOCAL  HIDDEN   ABS base</div><div><br></div></span><div>.text</div><div>.globl _start</div><div>_start:</div><div>        lea _BASE(%rip),%rax</div></div><div><br></div><div>Currently, lld fails with the following error:</div><div><br></div><div>bin/ld.lld: error: gc-start.o:(.text.internal+<wbr>0x3): relocation R_X86_64_PC32 cannot refer to absolute symbol '_BASE' defined in (internal)<br></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div>