ld problem
Posted: Mon Jul 30, 2007 11:37 am
hi
suppose i have a a couple object files and want to link them together with ld. also suppose that this binary program is not going to be loaded at address 0, how do i tell the linker to add the appropriate offset to each memory reference in the code?
the ld man page has got the following to say:
and get
Am I choosing the wrong option?
suppose i have a a couple object files and want to link them together with ld. also suppose that this binary program is not going to be loaded at address 0, how do i tell the linker to add the appropriate offset to each memory reference in the code?
the ld man page has got the following to say:
but i do:--image-base value
Use value as the base address of your program or dll. This is the
lowest memory location that will be used when your program or dll
is loaded. To reduce the need to relocate and improve performance
of your dlls, each should have a unique base address and not over-
lap any other dlls. The default is 0x400000 for executables, and
0x10000000 for dlls. [This option is specific to the i386 PE tar-
geted port of the linker]
Code: Select all
sancho@Kiste:~/assembly/boot$ ld boot.o -o boot.bin -e main --oformat binary -N --image-base 0x123
Code: Select all
ld: unrecognized option '--image-base'
ld: use the --help option for usage information