<div dir="ltr"><div>Does this test pass on X86_64 ? Groups are read in the Reader and is documented below :-<br><br></div>See <a href="http://lld.llvm.org/design.html#linking-steps">http://lld.llvm.org/design.html#linking-steps</a> on Section Groups to get more information.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 6, 2015 at 9:43 AM, Adhemerval Zanella <span dir="ltr"><<a href="mailto:adhemerval.zanella@linaro.org" target="_blank">adhemerval.zanella@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Checking the llvm test-suite SingleSource/Regression/C++/EH/class_hierarchy<br>
testcase on aarch64 I noted something strange:<br>
<br>
Dump of assembler code for function _Z4funcj:<br>
0x0000000000400650 <+0>: stp x22, x21, [sp,#-48]!<br>
0x0000000000400654 <+4>: stp x20, x19, [sp,#16]<br>
0x0000000000400658 <+8>: stp x29, x30, [sp,#32]<br>
0x000000000040065c <+12>: add x29, sp, #0x20<br>
=> 0x0000000000400660 <+16>: .inst 0x2bfffff7 ; undefined<br>
<br>
Where it should be:<br>
<br>
0000000000000000 <_Z4funcj>:<br>
0: a9bd57f6 stp x22, x21, [sp,#-48]!<br>
4: a9014ff4 stp x20, x19, [sp,#16]<br>
8: a9027bfd stp x29, x30, [sp,#32]<br>
c: 910083fd add x29, sp, #0x20<br>
10: 2a0003f3 mov w19, w0<br>
<br>
And there is no relocation (static or dynamic) point to the faulty instruction.<br>
It exist, however, a group section relocation with same offset, but for a<br>
different text segments (the exception handler stub create by clang):<br>
<br>
Relocation section '.rela.text' at offset 0xed8 contains 2 entries:<br>
Offset Info Type Sym. Value Sym. Name + Addend<br>
000000000010 00480000011b R_AARCH64_CALL26 0000000000000000 _ZNSt9exceptionD2Ev + 0<br>
000000000020 004d0000011a R_AARCH64_JUMP26 0000000000000000 _ZdlPv + 0<br>
<br>
Relocation section '.rela.text' at offset 0xf08 contains 2 entries:<br>
Offset Info Type Sym. Value Sym. Name + Addend<br>
000000000010 00480000011b R_AARCH64_CALL26 0000000000000000 _ZNSt9exceptionD2Ev + 0<br>
000000000020 004d0000011a R_AARCH64_JUMP26 0000000000000000 _ZdlPv + 0<br>
<br>
Relocation section '.rela.text' at offset 0xf38 contains 2 entries:<br>
Offset Info Type Sym. Value Sym. Name + Addend<br>
000000000010 00480000011b R_AARCH64_CALL26 0000000000000000 _ZNSt9exceptionD2Ev + 0<br>
000000000020 004d0000011a R_AARCH64_JUMP26 0000000000000000 _ZdlPv + 0<br>
<br>
However seems that LLD is indeed condescending them, but create duplicated references<br>
for the wrong segments:<br>
<br>
Writing atom: _Z4funcj | 1520<br>
Handle relocJump26 - S: 400460 A: 0 P: 400660 result: 3ffff98<br>
Handle relocJump26 - S: 400470 A: 0 P: 400670 result: 3ffff98<br>
<br>
The first relocJump26 shouldn't be applied to .text segment 0x400660, but solely on the<br>
_ZN4BaseD0Ev section. I am trying to debug how lld exactly is generating this wrong<br>
Reference, but I still can right figure out. Any idea of what is happening here?<br>
</blockquote></div><br></div>