c - Linking with another start-up file -


i trying link program own start-up file using startup directive in ld script:

... entry(_start) startup(my_crt1.o) ... 

gcc driver used link program (not bother library paths libgcc, etc.):

gcc -t my_script.ld ... 

unfortunately, works gcc compiled powerpc targets, while arm or i686 targets don't , still include crt0.o in collect2. example:

arm-eabi-g++ -v -t my_script.ld ... 

gives me:

collect2 ... /opt/lib/gcc/arm-eabi/4.8.0/../../../../arm-eabi/lib/crt0.o ... 

and thus:

crt0.s:101: multiple definition of `_start' 

it seems startup directive totally ignored (the powerpc target uses default crt0 unless startup directive specified) , there no way disable default crt0.

is there portable way link against start-up file?

my start-up file uses libgcc functions (to call ctors , dtors) crtbegin.o, crtend.o, etc. needed avoid -nostartfiles option disables crt*.o - need disable crt0.o only.

thank you

i trying link program own start-up file ...
gcc driver used link program ...

in case, must supply -nostartfiles flag gcc.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -