public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug pch/71934] pch cannot be disabled so gcc cannot be position independent
Date: Fri, 03 Dec 2021 14:14:44 +0000	[thread overview]
Message-ID: <bug-71934-4-Bj9VCEpGor@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-71934-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71934

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And if doing it at restore time would be too hard, there is always an option to
precompute a "relocation" table during PCH saving and store it at the very end
of the PCH file, so that normally when successfully loading PCH at the expected
address we don't need to touch that area, but if we map it elsewhere, we can
read it and relocate.  Such relocation table could either contain all the
addresses in the global GTY roots that need += bias (relative to say
gt_ggc_rtab or something similar) and all the addresses in the mapped blob that
need += bias (relative to the start of the mapped blob), ideally sorted during
PCH saving by increasing address.  If that would be too large, another option
would be try to make it more compact, e.g. after that sorting of addresses
represent it as unsigned short delta from the last address, unless that ushort
is 0, which then would be followed by full sizeof(void*) address relative to
gt_ggc_rtab or the map base;
perhaps even ushort 0 followed by address relative to gt_ggc_rtab and ushort 1
followed by address relative to map base.

  parent reply	other threads:[~2021-12-03 14:14 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-71934-4@http.gcc.gnu.org/bugzilla/>
2021-08-29  4:00 ` egallager at gcc dot gnu.org
2021-09-02 13:39 ` iains at gcc dot gnu.org
2021-09-02 17:39 ` jakub at gcc dot gnu.org
2021-12-03 10:06 ` cvs-commit at gcc dot gnu.org
2021-12-03 13:28 ` hjl.tools at gmail dot com
2021-12-03 13:30 ` jakub at gcc dot gnu.org
2021-12-03 13:42 ` iains at gcc dot gnu.org
2021-12-03 13:46 ` hjl.tools at gmail dot com
2021-12-03 14:02 ` iains at gcc dot gnu.org
2021-12-03 14:03 ` jakub at gcc dot gnu.org
2021-12-03 14:10 ` iains at gcc dot gnu.org
2021-12-03 14:14 ` jakub at gcc dot gnu.org [this message]
2021-12-04 15:53 ` jakub at gcc dot gnu.org
2021-12-05 12:51 ` iains at gcc dot gnu.org
2021-12-05 14:44 ` iains at gcc dot gnu.org
2021-12-05 14:52 ` jakub at gcc dot gnu.org
2021-12-05 15:22 ` iains at gcc dot gnu.org
2021-12-05 15:30 ` jakub at gcc dot gnu.org
2021-12-05 20:40 ` jakub at gcc dot gnu.org
2021-12-06  8:43 ` jakub at gcc dot gnu.org
2021-12-06  9:23 ` jakub at gcc dot gnu.org
2021-12-06  9:35 ` jakub at gcc dot gnu.org
2021-12-06  9:43 ` iains at gcc dot gnu.org
2021-12-06 10:21 ` cvs-commit at gcc dot gnu.org
2021-12-09 14:44 ` cvs-commit at gcc dot gnu.org
2021-12-09 14:56 ` cvs-commit at gcc dot gnu.org
2021-12-09 15:25 ` cvs-commit at gcc dot gnu.org
2021-12-09 15:43 ` iains at gcc dot gnu.org
2021-12-09 16:57 ` cvs-commit at gcc dot gnu.org

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=bug-71934-4-Bj9VCEpGor@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).