mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
e964d1192a
LLVM and binutils. With this patch, there are no functional differences between the .o produced directly from LLVM versus the .s to .o via GNU as, for relocation tags at least, for both PIC and non-PIC modes. Because some non-PIC reloc tags are used (legally) on PIC, so IsPCRel flag is necessary but not sufficient to determine whether the overall codegen mode is PIC or not. Why is this necessary? There is an incompatibility of how relocs are emitted in the .rodata section. Binutils PIC likes to emit certain relocs as section relative offsets. Non-PIC does not do this. So I added a hidden switch on the ELFObjectwriter "-arm-elf-force-pic" which forces the objectwriter to pretend that all relocs are for PIC mode. Todo: Activate ForceARMElfPIC to true if -relocation-model=pic is selected on llc. Todo: There are probably more issues for PIC mode on ARM/MC/ELF... Todo: Existing tests in MC/ARM/elf-reloc*.ll need to be converted over to .s tests as well as expanded to cover the gamut. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131205 91177308-0d34-0410-b5e6-96231b3b80d8