llvm-project
407f8a1f - [Hexagon][Driver] Tell llvm-mc about PIC under -fno-integrated-as (#213821)

Commit
24 days ago
[Hexagon][Driver] Tell llvm-mc about PIC under -fno-integrated-as (#213821) Hexagon picks the .eh_frame FDE pointer encoding from whether the code is position independent: DW_EH_PE_pcrel if so, DW_EH_PE_absptr otherwise (MCObjectFileInfo::initELFMCObjectFileInfo). Unlike most targets, Hexagon uses llvm-mc rather than GNU as for -fno-integrated-as, and the driver was not passing the PIC setting along. llvm-mc defaults to non-PIC, so the same source assembled the two ways produced different unwind tables: the integrated assembler emitted R_HEX_32_PCREL, while -fno-integrated-as emitted R_HEX_32 with an absptr CIE augmentation. hexagon-unknown-linux-musl defaults to PIC, so it was the default config that diverged. Pass -position-independent to llvm-mc when the relocation model is PIC. Non-PIC keeps DW_EH_PE_absptr, unchanged.
Author
Parents
Loading