<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 - [yaml2obj]Relocations should reference symbols from their linked symbol table"
   href="https://bugs.llvm.org/show_bug.cgi?id=40337">40337</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[yaml2obj]Relocations should reference symbols from their linked symbol table
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jh7370.2008@my.bristol.ac.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If you attempt to write a dynamic relocation section, i.e. one that references
.dynsym, or indeed any relocation section where the sh_link does not point at
.symtab, the symbols referenced by the yaml are treated as symbols in the
static symbol table, not necessarily the linked symbol table.

Example:

!ELF
FileHeader:
  Class:           ELFCLASS64
  Data:            ELFDATA2LSB
  Type:            ET_DYN
  Machine:         EM_X86_64
Sections:
  - Name:         .text
    Type:         SHT_PROGBITS
  - Name:         .rela.dyn
    Type:         SHT_RELA
    Flags:        [ SHF_ALLOC ]
    Link:         .dynsym
    Info:         .text
    Address:      0x200
    AddressAlign: 0x100
    EntSize:      0x18
    Relocations:
      - Offset: 0x10
        Symbol: _Z3fooi # Ends up with symbol index 0 (i.e. not referencing
anything)
        Type:   R_X86_64_PC32
        Addend: 0x4
      - Offset: 0x10
        Symbol: blah    # Ends up with symbol index 1 (i.e. _Z3fooi)
        Type:   R_X86_64_PC32
        Addend: 0x4
Symbols:
  Global:
    - Name: blah
DynamicSymbols:
  Global:
    - Name: _Z3fooi</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>