Browse Source
When emitting a call to __tls_get_offset, the instruction needs to carry two relocations, a R_390_PLT32DBL targeting __tls_get_offset and a R_390_TLS_GDCALL targeting the TLS symbol. Specifically, the system linker expects to see these two relocation in that order. However, the cranelift backend currently emits the relocations in reverse order - this unfortunately causes the linker to corrupt the instruction sequence when performing a TLS relaxation. To fix this in the backend, I need support in machinst common code to emit a relocation at some offset to the instruction about to be emitted (e.g. the relocation should target two bytes into the 6-byte instruction that will be emitted next). I've added a new routine add_reloc_at_offset to that effect. This also allowed to simplify some existing code in the backend. Also, change the disassembler to print multiple relocations on a single instruction, if present.pull/7985/head
Ulrich Weigand
9 months ago
committed by
GitHub
4 changed files with 26 additions and 43 deletions
Loading…
Reference in new issue