Module Name: src
Committed By: martin
Date: Wed Jul 10 09:41:16 UTC 2013
Modified Files:
src/lib/csu: README
Log Message:
Try to also document the variant using common C code - Matt, please review!
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/csu/README
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/csu/README
diff -u src/lib/csu/README:1.3 src/lib/csu/README:1.4
--- src/lib/csu/README:1.3 Wed Jul 10 09:32:49 2013
+++ src/lib/csu/README Wed Jul 10 09:41:16 2013
@@ -11,9 +11,11 @@ compiler logic.
A new platform should provide the following content in
arch/${MACHINE_ARCH} or arch/${MACHINE_CPU}:
-- Makefile.inc: provides ELFSIZE corresponding to 32/64bit file format
+- Makefile.inc: provides ELFSIZE corresponding to 32/64bit file format.
+ If using the common C code instead of crtbegin.S also provide a -I option
+ to find crtbegin.h in your arch subdir.
- crt0.S: provides setup code and the call to __start.
-- crtbegin.S: see below
+- crtbegin.S or crtbegin.h: see below
- crtend.S: see below, most likely just a copy of an existing architecture
- crti.S: prefix part of .init/.fini sections, i.e. to ensure stack alignment
- crtn.S: suffix part of the .init/.fini sections, i.e. return to caller.
@@ -82,3 +84,10 @@ Deinitialisation (called from .fini):
Call the pointers as void (*)(void) functions.
5. If __deregister_frame_info is NULL, return.
6. Call __deregister_frame_info with the start of .eh_frame as the argument.
+
+
+Since most of this can easily be done in C code, instead of providing a
+crtbegin.S you can also chose to use the generic C implementation. Provide
+a crtbegin.h file instead of crtbegin.S. In there put inline assembler
+stubs (mostly copied from some other arch) and implement calls to the
+helper functions __do_global_ctors_aux/__do_global_dtors_aux.