[PATCH] binutils: partially revert 17c6c3b99156fe82c1e637e1a5fd9f163ac788c8

Jan Beulich jbeulich@suse.com
Fri Nov 18 14:03:43 GMT 2022


(re-sending with binutils@ re-added to Cc; please don't send private
mail for stuff which belongs on the list)

On 18.11.2022 14:57, 徐持恒 Xu Chiheng wrote:
> x86_64-elf-g++ -c -O3 -ffreestanding -fno-builtin -fno-pic -m32
> -mcmodel=32 ...  kern/core/x64/head/start32.cpp -o
> kern/core/x64/head/start32.cpp.o
> x86_64-elf-objcopy -I elf32-i386 -O elf64-x86-64

Well, I saw no need to use -I, but otherwise that's what I did. Yet you
quoting the commands you issued still doesn't answer ...

> kern/core/x64/head/start32.cpp.o kern/core/x64/head/start32.cpp.o
> x86_64-elf-g++      -nostdlib -v -fuse-ld=bfd -Wl,-v,--verbose -Wl,-r
> kern/core/x64/head/start32.cpp.o ... -o head.o
> 
> On Fri, Nov 18, 2022 at 9:31 PM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 18.11.2022 11:45, 徐持恒 Xu Chiheng wrote:
>>> using x86_64-elf-g++ -m32 -c on C++ files to generate head.o(32 bit
>>> code, elf32).
>>> using x86_64-elf-objcopy to convert it to elf64.
>>> then link head.o(32 bit code, elf64) with other object files(64 bit
>>> code, elf64).
>>>
>>> link script line is :
>>>   .head           : { head.o (.multiboot) head.o (.*) }
>>
>> Was that GNU objcopy you used? I've just tried here, and I don't see
>> it converting from REL to RELA.

... which objcopy you used. Iirc llvm/clang also provide one, for example.

Jan


More information about the Binutils mailing list