MaskRay wrote:

> The alternative fix, which I think I'm now leaning towards, would be to 
> change how the branch-to-branch optimization handles relocations to 
> STT_SECTION symbols. A relocation pointing to the STT_SECTION for .text with 
> addend 1 would be treated as a branch to .text+5 and it would be invalid to 
> assemble a relative vtable relocation that points to STT_SECTION. It would 
> also be consistent with how we process relocations for string tail merging 
> and ICF among other places, e.g. 
> [here](https://github.com/llvm/llvm-project/blob/8602a655a8150753542b0237fcca16d9ee1cd981/lld/ELF/ICF.cpp#L304).
>  The downside is that it adds another special case for STT_SECTION but I 
> guess that's fine.

Thanks for the explanation. I haven't read through the lld branch-to-branch 
optimization patch. However, I agree that adding a special case for STT_SECTION 
to the linker might be the right solution. Changing the assembler regarding 
PLT32 looks fishy.

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