<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 - llvm-objdump doesn't list symbols in ppc64 objects, but does so in ppc64le ones"
   href="https://bugs.llvm.org/show_bug.cgi?id=50010">50010</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>llvm-objdump doesn't list symbols in ppc64 objects, but does so in ppc64le ones
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>llvm-objdump
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nabijaczleweli@nabijaczleweli.xyz
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Consider the following C code:
    int symbol_a(void) {
        return 'a';
    }

    int symbol_b(void) {
        return 'b';
    }

When built for ppc64el, everything appears in order:
    $ cc -target ppc64le-unknown-linux-gnu a.c -c -oa.o
    $ llvm-objdump -d a.o

    a.o:    file format elf64-powerpcle


    Disassembly of section .text:

    0000000000000000 <symbol_a>:
           0: 61 00 60 38   li 3, 97
           4: 20 00 80 4e   blr
                    ...
          14: 00 00 00 60   nop
          18: 00 00 00 60   nop
          1c: 00 00 00 60   nop

    0000000000000020 <symbol_b>:
          20: 62 00 60 38   li 3, 98
          24: 20 00 80 4e   blr
                    ...

But when building for ppc64, the symbol listing is gone:
    $ cc -target ppc64-unknown-linux-gnu a.c -c -oa.o
    $ llvm-objdump -d a.o

    a.o:    file format elf64-powerpc


    Disassembly of section .text:

    0000000000000000 <.text>:
           0: 38 60 00 61   li 3, 97
           4: 4e 80 00 20   blr
                    ...
          14: 38 60 00 62   li 3, 98
          18: 4e 80 00 20   blr
                    ...

Both object files have a symtab:
    $ llvm-objdump -h a.o

    a.o:    file format elf64-powerpcle

    Sections:
    Idx Name            Size     VMA              Type
      0                 00000000 0000000000000000
      1 .strtab         00000063 0000000000000000
      2 .text           00000034 0000000000000000 TEXT
      3 .<a href="show_bug.cgi?id=50010#c00000056">comment        00000056</a> 0000000000000000
      4 .note.GNU-stack 00000000 0000000000000000
      5 .eh_frame       00000040 0000000000000000 DATA
      6 .rela.eh_frame  00000030 0000000000000000
      7 .llvm_addrsig   00000000 0000000000000000
      8 .symtab         00000078 0000000000000000

    $ llvm-objdump -h a.o

    a.o:    file format elf64-powerpc

    Sections:
    Idx Name            Size     VMA              Type
      0                 00000000 0000000000000000
      1 .strtab         00000073 0000000000000000
      2 .text           00000028 0000000000000000 TEXT
      3 .opd            00000030 0000000000000000 DATA
      4 .rela.opd       00000060 0000000000000000
      5 .<a href="show_bug.cgi?id=50010#c00000056">comment        00000056</a> 0000000000000000
      6 .note.GNU-stack 00000000 0000000000000000
      7 .eh_frame       00000040 0000000000000000 DATA
      8 .rela.eh_frame  00000030 0000000000000000
      9 .llvm_addrsig   00000000 0000000000000000
     10 .symtab         00000090 0000000000000000


And on rudimentary inspexion, both objects' symtabs appear to contain the
names.

My toolchain is as follows
    Debian clang version
13.0.0-++20210415102640+07edd7899392-1~exp1~20210415203405.1444
    Target: x86_64-pc-linux-gnu
    Thread model: posix
    InstalledDir: /bin
obtained from the current buster nightly packages.</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>