Entry point in a relocatable object file
Ian Lance Taylor
ian@wasabisystems.com
Tue Dec 9 17:36:00 GMT 2003
Djath Kokou <Kokou.Djath@ixfin-mmarellise.com> writes:
> I want the code of a specified function to be at the begin of the text
> section after the link is done.
If you are linking for a hosted system, with crt0.o files and so
forth, then I think you would have to use a linker script to make this
happen. See the documentation. Otherwise, just make sure that
function is at the start of the .o file--perhaps by making that
function be the only function in the source file--and put that .o file
first on the link command line.
> Is it possible to specify an entry point with the linker in a relocatable
> output file ?
I already answered that question on the gcc list, and the answer is
yes.
Note that this is not the same as your first question. The entry
point is just an address, usually but not always in the text section.
It's not the same as the first function in the text section.
Ian
More information about the Binutils
mailing list