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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

If we have next code:

.section .foo,"ax",@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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to