<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - Difference in relocations with -no-integrated-as"
   href="https://llvm.org/bugs/show_bug.cgi?id=22996">22996</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Difference in relocations with -no-integrated-as
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>MC
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>russell_gallop@sn.scee.net
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For the following example: using direct object emission the address at 0xb does
not have a relocation, using -no-integrated-as it does have a relocation. There
is a relocation for 0x6 in both cases. Using r232386.

$ cat test.cpp
struct A {
  A();
};
void fn1() {
  A();
  fn1();
}
$ clang -c -O2 test.cpp -o direct.o
$ objdump -d direct.o

direct.o:     file format elf64-x86-64

Disassembly of section .text:

0000000000000000 <_Z3fn1v>:
   0:   50                      push   %rax
   1:   48 8d 3c 24             lea    (%rsp),%rdi
   5:   e8 00 00 00 00          callq  a <_Z3fn1v+0xa>
   a:   e8 f1 ff ff ff          callq  0 <_Z3fn1v>
   f:   58                      pop    %rax
  10:   c3                      retq
$ objdump -r direct.o

direct.o:     file format elf64-x86-64

RELOCATION RECORDS FOR [.text]:
OFFSET           TYPE              VALUE
0000000000000006 R_X86_64_PC32     _ZN1AC1Ev-0x0000000000000004


RELOCATION RECORDS FOR [.eh_frame]:
OFFSET           TYPE              VALUE
0000000000000020 R_X86_64_PC32     .text


$ clang -c -O2 test.cpp -no-integrated-as -o no_int_as.o
$ objdump -d no_int_as.o

no_int_as.o:     file format elf64-x86-64


Disassembly of section .text:

0000000000000000 <_Z3fn1v>:
   0:   50                      push   %rax
   1:   48 8d 3c 24             lea    (%rsp),%rdi
   5:   e8 00 00 00 00          callq  a <_Z3fn1v+0xa>
   a:   e8 00 00 00 00          callq  f <_Z3fn1v+0xf>
   f:   58                      pop    %rax
  10:   c3                      retq
$ objdump -r no_int_as.o

no_int_as.o:     file format elf64-x86-64

RELOCATION RECORDS FOR [.text]:
OFFSET           TYPE              VALUE
0000000000000006 R_X86_64_PC32     _ZN1AC1Ev-0x0000000000000004
000000000000000b R_X86_64_PC32     _Z3fn1v-0x0000000000000004


RELOCATION RECORDS FOR [.eh_frame]:
OFFSET           TYPE              VALUE
0000000000000020 R_X86_64_PC32     .text</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>