[llvm-bugs] [Bug 32031] New: [ELF] - DefinedSynthetic symbols has incorrect values.
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Feb 21 06:46:52 PST 2017
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: unassignedbugs at nondot.org
Reporter: grimar at accesssoftek.com
CC: llvm-bugs at lists.llvm.org
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170221/830717d6/attachment.html>
More information about the llvm-bugs
mailing list