This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Entry point in a relocatable object file
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Djath Kokou <Kokou dot Djath at ixfin-mmarellise dot com>
- Cc: "'binutils at sources dot redhat dot com'" <binutils at sources dot redhat dot com>
- Date: 09 Dec 2003 12:36:15 -0500
- Subject: Re: Entry point in a relocatable object file
- References: <33F0779A2CA2D711BECF0002A545B67A403D91@ex5chantd01.chatellerault.marelli.fr>
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