pcc wrote:

With relative vtables we have
```
.4byte foo@plt - .
```
This becomes a PLT32 pointing to foo with addend 0. This should not be treated 
as a branch to foo+4 if a PLT/thunk is needed.

We can also have
```
.section .text.a,"ax",@progbits
jmp .Lfoo

.text
nop
nop
nop
nop
.Lfoo:
ret
```
With the current implementation that creates a PLT32 with addend 0 for 
branching to .text+4 this is not distinguishable from the relative vtable case 
except via SHF_EXECINSTR or STT_SECTION on the target symbol. Since we 
generally want relocation processing to be independent of this kind of context, 
I think the right way to reconcile these two cases is that a PLT32 can only be 
treated as a reference to the symbol itself. GNU as already does this and this 
change makes MC do the same.

https://github.com/llvm/llvm-project/pull/138795
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to