This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: global constructors


Dave Murphy wrote:
I'm attempting to build gcc for arm-elf & powerpc-eabi-elf targets but I'm
having trouble with global constructors. Searching around appears to have a
lot of conflicting information - calling __init __do_global_ctors or __main
from crt0 before the call to main. Can anyone point me in the right
direction with this?

There is a preferred way to do global constructors for ELF, but there is no one right way, and different targets do it different ways. Asking for general help here probably isn't very useful. Try asking specific questions.


I would expect global constructors to work for arm-elf and powerpc-eabi if you are using newlib/libgloss as your C library. If you aren't using newlib/libgloss, then modifiy your library to do what newlib/libgloss do. See in particular the crt0.S files in libgloss for arm and powerpc.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com



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