llvm-project
62e48991 - [M68k] Use PC-relative EH pointer encodings under PIC (#235347)

Commit
8 days ago
[M68k] Use PC-relative EH pointer encodings under PIC (#235347) The function `TargetLoweringObjectFileELF::initialize` has no `case` branch for `m68k`, meaning the default absolute encoding is used for the personality/lsda/type-info pointers: `DW_EH_PE_absptr`. IN a PIE or shared lib, those pointers then need `R_68K_32` dynamic relocations in `.eh_frame` and `.gcc_except_table` which are read-only, so a link with the flag `-z text` fails - that flag is default for PIE. Error: ``` ld: read-only segment has dynamic relocations ``` This PR adds `m68k` to the existing `x86/ppc` case, selecting `indirect/pcrel/sdata4` for the personality and `pcrel/sdata4` for the LSDA (under PIC, and `absptr` otherwise). With the change, the `.eh_frame` relocations for a PIC function with a personality and lsda are `R_68K_PC32`, not `R_68K_32` as before. The new test checks both relocation models. --- #### AI Disclosure: - Test was written by Claude Opus 5.5
Parents
Loading