Manufacturing ELF
Posted: Fri Apr 07, 2017 3:13 am
How to relocate ELF file to 64-bit higher address (0xFFFFFF80********) ?
I use LD to link and set Ttext to the high address but it shouts "Relocation truncated to fit: R_X86_64_32 against ***(A series of symbols even .text)". How to fix it?
EDIT: I searched almost the whole Internet and found a lot of answers saying "add gcc option -fPIC", so I tried it. However, it didn't work.
Also, I found that some of ELF relocation table items' infos are R_X86_64_32 and others are R_X86_64_64. Why the compiler creates R_X86_64_32? Will it works if there's no *_32?
Thanks for any help.
I use LD to link and set Ttext to the high address but it shouts "Relocation truncated to fit: R_X86_64_32 against ***(A series of symbols even .text)". How to fix it?
EDIT: I searched almost the whole Internet and found a lot of answers saying "add gcc option -fPIC", so I tried it. However, it didn't work.
Also, I found that some of ELF relocation table items' infos are R_X86_64_32 and others are R_X86_64_64. Why the compiler creates R_X86_64_32? Will it works if there's no *_32?
Thanks for any help.