public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: vincent Dupaquis <v.dupaquis@trusted-objects.com>
Cc: <gcc-help@gcc.gnu.org>
Subject: Re: Question related to -fPIC behaviour across architectures
Date: Tue, 03 May 2022 16:29:58 +0200	[thread overview]
Message-ID: <87tua6g049.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <7038357f-02af-0bcd-f156-73851c3227b3@trusted-objects.com> (vincent Dupaquis's message of "Tue, 3 May 2022 10:26:25 +0200")

* vincent Dupaquis:

> - Did I miss anything ?

The linker can perform relaxations (e.g., elimination of GOT
indirection) based on whole-program analysis, something the compiler
cannot do.  Such optimizations are very much target-dependent, and they
often need some previous ABI work to define new relaxable relocations
for relocatable object files.

> - Is there somewhere a common definition of what mean PIC for the
>   different architectures ?

Not really, not even for ELF.  There are some common assumptions in the
background for ELF implementations (e.g., one canonical function
address), but how you get there varies somewhat.

Thanks,
Florian


  parent reply	other threads:[~2022-05-03 15:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-14 22:43 Compile GCC using only tools isolated from host environment Benjamin Lovy
2022-03-15  7:19 ` Xi Ruoyao
2022-03-16 16:06   ` Benjamin Lovy
2022-03-15  8:46 ` Jonathan Wakely
2022-05-03  8:26 ` Question related to -fPIC behaviour across architectures vincent Dupaquis
2022-05-03 10:24   ` Xi Ruoyao
2022-05-03 13:29     ` vincent Dupaquis
2022-05-03 14:29   ` Florian Weimer [this message]
2022-05-03 15:45     ` vincent Dupaquis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tua6g049.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=v.dupaquis@trusted-objects.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).