kvm-hello-world
kvm-hello-world copied to clipboard
/usr/bin/ld: cannot use executable file 'payload.o' as input to a link
Hi, when the makefile is executed to
kvm-hello-world: kvm-hello-world.o payload.o
$(CC) $^ -o $@
a error comes /usr/bin/ld: cannot use executable file 'payload.o' as input to a link
ld version is GNU ld (GNU Binutils) 2.36.1
Are there any good ideas to fix this? thanks.
hi, this problem has been fixed.
The main issue of the bad input is that payload.o
has been linked into an executable file, which rejected by gcc-ld(version 2.36.1)
Add -r(output to be a relocatable file) in the payload.o
generation solved the problem.
I will push a request later.
hi, just got common issue, i cannat no more inport sdio.h or any other library but how to implement that -r, tryied to add on gcc but doesent work, any help?
hi, just got common issue, i cannat no more inport sdio.h or any other library but how to implement that -r, tryied to add on gcc but doesent work, any help?
like this :
payload.o: payload.ld guest16.o guest32.img.o guest64.img.o
$(LD) -r -T $< -o $@