[llvm-bugs] [Bug 46834] New: Self assignment of code symbols fails in linker scripts

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 24 08:46:44 PDT 2020


            Bug ID: 46834
           Summary: Self assignment of code symbols fails in linker
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: abidh.haq at gmail.com
                CC: llvm-bugs at lists.llvm.org, smithp352 at googlemail.com

Created attachment 23769
  --> https://bugs.llvm.org/attachment.cgi?id=23769&action=edit
Tar file that includes a testcase (assembly file and linker script).

We have linker scripts which have expressions like below.

_init = DEFINED(user_init) ? user_init : _init;

which is like a self assignment. Such linker scripts work ok with GNU ld with
_init retaining its value. In lld, it gets zeroed out. I am attaching a simple
assembly file and a linker script which show this problem.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200724/a3c1db77/attachment.html>

More information about the llvm-bugs mailing list