https://bugs.llvm.org/show_bug.cgi?id=35744

            Bug ID: 35744
           Summary: [ELF] - -defsym incorrectly works with reserved
                    symbols.
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedb...@nondot.org
          Reporter: gri...@accesssoftek.com
                CC: llvm-bugs@lists.llvm.org

Using code from defsym.s:

.globl foo1
 foo1 = 0x123

.global _start
_start:
  movl $foo2, %edx

and invocation:
# RUN: ld.lld -o %t %t.o --defsym=foo2=etext

Produces symbols foo2 and etext with value of 0x201005, what is correct,
though when expression is used instead, i.e:
# RUN: ld.lld -o %t %t.o --defsym=foo2=etext+1
then foo2 symbol value becomes wrong:

  Symbol {
    Name: foo2 (13)
    Value: 0x201000
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: .text (0x1)
  }
  Symbol {
    Name: etext (18)
    Value: 0x201005
    Size: 0
    Binding: Global (0x1)
    Type: None (0x0)
    Other: 0
    Section: .text (0x1)
  }
]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to