This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: a question about Linux target dependence on GNU compiler.
æå å <asao.shinobu@jp.panasonic.com> writes:
>> And yes, there are a bunch of other things that GCC has to do in
>> order to generate correct code for any given target. If you would
>> be more specific about what you're trying to do, we can be more
>> specific about what you need to implement.
>
> As has been mentioned, I am only interested about what processing for
> Linux OS target is done in GCC. So, I can't be more specific about
> I'm trying to do...
>
> In other words, I want only to know about the difference point of
> implementation between GCC for Linux OS target and GCC for Non OS
> target.
This is not a question with a simple answer, I'm afraid. It is
different for each CPU architecture, and a lot of it is a matter of
typical usage rather than a matter of code inside GCC. (For instance,
the main thing GCC does to support shared libraries is generate
position-independent code. Well, it can do that for non-OS targets
just as well as for Linux or any other complete operating system; but
people generally don't ask it to, or if they do, it's not because they
are making shared libraries.)
You could begin to learn the answer by reading gcc/config/linux.h and
gcc/config/*/linux.h. You could also build yourself a something-elf
and a something-linux cross compiler, compile the same code with them,
and read the assembly output. You could also read the GCC internals
manual, notably the sections that talk about how to write target
configuration headers.
zw