[llvm-bugs] [Bug 33275] New: [MC] - llvm-mc does not emit SHF_INFO_LINK flag for relocation sections

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 2 02:04:12 PDT 2017


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

            Bug ID: 33275
           Summary: [MC] - llvm-mc does not emit SHF_INFO_LINK flag for
                    relocation sections
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: grimar at accesssoftek.com
                CC: llvm-bugs at lists.llvm.org

If we have next code:

.section .foo,"ax", at progbits
aaa:
  movl $aaa, %edx

And invoke:
llvm-mc -filetype=obj -triple=x86_64-pc-linux test.s -o test_mc.o 
as test.s -o test_as.o

$as -V
GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils
for Ubuntu) 2.26.1

Then output from gas and llvm-mc be different:
llvm-mc:
  [ 4] .rela.foo         RELA             0000000000000000  00000090
       0000000000000018  0000000000000018           5     3     8
gas:
  [ 5] .rela.foo         RELA             0000000000000000  000000e0
       0000000000000018  0000000000000018   I       7     4     8

gas sets SHF_INFO_LINK flag for relocation section. That is consistent with
spec (http://www.sco.com/developers/gabi/latest/ch4.sheader.html)
Which contains:

sh_info
...
If the sh_flags field for this section header includes the attribute
SHF_INFO_LINK, then this member represents a section header table index.

SHF_INFO_LINK
The sh_info field of this section header holds a section header table index.

llvm-mc should also set this flag.

-- 
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/20170602/8461049a/attachment.html>


More information about the llvm-bugs mailing list