[llvm-bugs] [Bug 40786] New: obj2yaml symbol output missing section index for SHN_ABS and SHN_COMMON symbols

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 20 06:02:28 PST 2019


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

            Bug ID: 40786
           Summary: obj2yaml symbol output missing section index for
                    SHN_ABS and SHN_COMMON symbols
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: jh7370.2008 at my.bristol.ac.uk
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

If you run obj2yaml on an object containing absolute and/or common symbols, the
yaml output contains no section index for them, resulting in them being
undefined symbols, if yaml2obj were run on the output. We should fix this!

Example failing test:

# RUN: yaml2obj %s > %t
# RUN: obj2yaml %t | FileCheck %s

# CHECK:      Symbols:
# CHECK-NEXT:   Global:
# CHECK-NEXT:     - Name:    absolute1
# CHECK-NEXT:       Index:   SHN_ABS    <--- Missing
# CHECK-NEXT:     - Name:    absolute2
# CHECK-NEXT:       Index:   SHN_ABS    <--- Missing
# CHECK-NEXT:     - Name:    common1
# CHECK-NEXT:       Index:   SHN_COMMON <--- Missing
# CHECK-NEXT:     - Name:    common2
# CHECK-NEXT:       Index:   SHN_COMMON <--- Missing
# CHECK-NEXT:     - Name:    valid_index
# CHECK-NEXT:       Section: .text

!ELF
FileHeader:
  Class:           ELFCLASS64
  Data:            ELFDATA2LSB
  Type:            ET_EXEC
  Machine:         EM_X86_64
Sections:
  - Name: .text
    Type: SHT_PROGBITS
Symbols:
  Global:
    - Name:     absolute1
      Index:    SHN_ABS
      Value:    0x1234
    - Name:     absolute2
      Index:    0xfff1
      Value:    0x4321
    - Name:     common1
      Index:    SHN_COMMON
    - Name:     common2
      Index:    0xfff2
    - Name:     valid_index
      Index:    0x1

-- 
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/20190220/2f979c56/attachment.html>


More information about the llvm-bugs mailing list