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]

Re: linking possibilities


> Date: Mon, 11 Jun 2001 09:54:03 +0200
> From: Rafael =?iso-8859-1?Q?Rodr=EDguez?= Velilla <rrv@tid.es>
> To: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>

> > > Can I compile somehow an application using the information of the
> > > locations of the routines of another one (not an obect file but an
> > > executable)?
> >
> > Yes, I believe you can, see the ld documentation.  This is a binutils
> > (ld) question by the way, doesn't have much to do with gcc.

> Then let's try with a more gcc related issue...

> What does gcc when I specify the -fPIC switch?

I'll assume the question is:

What does gcc do when I specify the -fPIC switch?

The answer is, it will produce position independent code.  Exactly how
it does this, or even if it will do this, is platform specific.

> Where are these kind of things documented (which sections are
> created, where is the different data located ....)?

Documenting internal choices made by the compiler is somewhat bad, as
it tends to constrain future changes to the compiler.  Our tendency is
to not document such things.  If you want a document, you will find
one from the vendor of the OS that originally designed the position
independent code or possibly from the abi body that designed the abi.

> All the work that I'm doing is basen on experiments, but I'm not
> sure if it will work that way always.

I don't know what you need to know.  I don't know how you want to use
the information you have collected.  The as if rule of compilation
allows us to do just about anything we want, and if you expect us to
to just about anything in particular you will be burned.  The things
that we will do are specified in the various language standards and
the various abi standards.  If you are relying upon something that
isn't in such a document, then you're probably creating non-portable
code.


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