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

            Bug ID: 32031
           Summary: [ELF] - DefinedSynthetic symbols has incorrect values.
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Testcase below shows the issue. Symbols barsym and barsym1 should be equal.
Currently them are not. That happens because we calculate barsym1 value too
early, when OutSecOff is not yet set. So it end up with wrong VA.
One of ideas how to fix that was in https://reviews.llvm.org/D29391, but
another solution was landed, I wonder if there is another simple way.

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: echo "SECTIONS { barsym1 = barsym; .bar : { *(.bar*) } }" > %t.script
# RUN: ld.lld %t --script %t.script -o %t1
# RUN: llvm-readobj -symbols %t1 | FileCheck %s

# CHECK:     Symbol {
# CHECK:      Name: barsym
# CHECK-NEXT: Value: 0x[[VAL:.*]]
# CHECK:      Name: barsym1
# CHECK-NEXT: Value: 0x[[VAL]]

.section .bar.1, "a"
.quad 0

.section .bar.2, "a"
.quad 0
.global barsym
barsym:

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

Reply via email to