How to change the entry point of gcc compiler ?

I mean the code will look like the bellow one.

int entry()  //this is the new entry point instead of main.
return 0;

thank you very much..

Edited by asitmahato: n/a

5 Years
Discussion Span
Last Post by L7Sqr

I'm not sure if the gcc compiler has that option. The ld(GNU linker) can change the entry point label but its default is _start and it won't apply to your code.


-e entry
Use entry as the explicit symbol for beginning execution of your
program, rather than the default entry point. If there is no
symbol named entry, the linker will try to parse entry as a
number, and use that as the entry address (the number will be
interpreted in base 10; you may use a leading 0x for base 16, or
a leading 0 for base 8).


To expand on what gerard4143 mentioned, gcc has the option -Xlinker [i]option[/i] that allows you to pass options through to the linker.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.