This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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

followup on question about gcc compiling and linking


  again, not strictly crosstool-related (and if there's another list
for which questions like this are more appropriate, that would be
great), i'm trying to clarify all of the files involved in compiling a
source file so that i can better understand what might be going wrong
if a cross-compiler fails due to unresolved references.

  from several sources, and liberal use of "readelf" and "objdump", it
seems that compiling a simple "hello, world" program natively involves
linking at least parts of the following files (listed with their code
snippets):

/usr/lib/crti.o (call_gmon_start, _init, _fini)
/usr/lib/gcrt1.o (_start, __gmon_start__)
.../4.0.2/crtbegin.o (__do_global_dtors_aux)
.../4.0.2/crtend.o (__do_global_ctors_aux)
/usr/lib/libc_nonshared.a (__libc_csu_init, __libc_csu_fini)

  at least, this is what *appears* to represent everything that gets
bundled in with my final (trivial) ELF executable.

  is there a decent write-up on all of this somewhere?  and what are
those other crt*.o files for?

  thanks for any pointers.  i'm thinking that understanding all this
better will make it easier to dissect a toolchain.  and create one.

rday

p.s.  what do those occasional "S" and "T" suffixes mean on some
object files?

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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