This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Entry point in a relocatable object file


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]