<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [MC] - llvm-mc does not emit SHF_INFO_LINK flag for relocation sections"
   href="https://bugs.llvm.org/show_bug.cgi?id=33275">33275</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[MC] - llvm-mc does not emit SHF_INFO_LINK flag for relocation sections
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>grimar@accesssoftek.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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 (<a href="http://www.sco.com/developers/gabi/latest/ch4.sheader.html">http://www.sco.com/developers/gabi/latest/ch4.sheader.html</a>)
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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>