How gcc fills up crti.S
How gcc fills up crti.S
In meaty skeleton, in file crti.S there is a remark noting "/* gcc will nicely put the contents of crtbegin.o's .init section here. */". I am confused. Where is this crtbegin.o? And how gcc knows to fill crti.S with it?
-
- Member
- Posts: 5578
- Joined: Mon Mar 25, 2013 7:01 pm
Re: How gcc fills up crti.S
It's provided by GCC.siavoshkc wrote:Where is this crtbegin.o?
You tell it to do that in the makefile. The linker automatically combines sections with the same name in the order they're linked. There are sections named ".init" and ".fini" in crtbegin.o, just like the ones in crti.S, and crti.o is linked before crtbegin.o.siavoshkc wrote:And how gcc knows to fill crti.S with it?
Re: How gcc fills up crti.S
There was no explanation about this in the meaty skeleton page. Maybe a good idea to add a section about this.
Is there any page explaining those file sources?
Is there any page explaining those file sources?
-
- Member
- Posts: 5578
- Joined: Mon Mar 25, 2013 7:01 pm