public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: James Greenhalgh <james.greenhalgh@arm.com>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, nd <nd@arm.com>,
	Richard Earnshaw	<Richard.Earnshaw@arm.com>,
	<marcus.shawcroft@arm.com>
Subject: Re: [PATCH v3][AArch64] Fix symbol offset limit
Date: Wed, 14 Jun 2017 14:07:00 -0000	[thread overview]
Message-ID: <20170614140702.GB8010@arm.com> (raw)
In-Reply-To: <VI1PR0802MB262180A56B715BD564EA12DA83C20@VI1PR0802MB2621.eurprd08.prod.outlook.com>

On Tue, Jun 13, 2017 at 03:00:28PM +0100, Wilco Dijkstra wrote:
> 
> ping

I've been avoiding reviewing this patch as Richard was the last to comment
on it, and I wasn't sure that his comments had been resolved to his
satisfaction. The conversation was back in August 2016 on v1 of the patch:

> Richard Earnshaw (lists) <Richard.Earnshaw@arm.com> wrote:
> >
> > So isn't the real bug that we've permitted the user to create an object
> > that is too large for the data model?
> 
> No that's a different issue I'm not trying to address here. The key is that as long
> as the start of the symbol is in range, we should be able to link. Due to optimization
> the offset may be huge even when the object is tiny, so the offset must be limited.
> 
> > Consider, for example:
> 
> char fixed_regs[0x200000000ULL];
> char fixed_regs2[100];
> 
> int
> main()
> {
>   return fixed_regs[0] + fixed_regs2[0];
> }
> 
> > Neither offset is too large, but we still generate relocation errors
> > when trying to reference fixed_regs2.
> 
> But so would creating a million objects of size 1. The linker could warn about
> large objects as well as giving better error messages for relocations that are
> out of range. But that's mostly QoI, what we have here is a case where legal
> code fails to link due to optimization. The original example is from GCC itself,
> the fixed_regs array is small but due to optimization we can end up with
> &fixed_regs + 0xffffffff.

Richard, do you have anything further to say on this patch? Or can we start
progressing the review again.

Thanks,
James

  reply	other threads:[~2017-06-14 14:07 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23 14:11 [PATCH][AArch64] " Wilco Dijkstra
2016-08-26 10:43 ` Richard Earnshaw (lists)
2016-08-26 19:07   ` Wilco Dijkstra
2016-09-12 15:30     ` [PATCH v2][AArch64] " Wilco Dijkstra
2016-09-21 14:48       ` Wilco Dijkstra
2016-10-17 12:42       ` Wilco Dijkstra
2016-10-25  9:47         ` Wilco Dijkstra
2016-11-02 16:48           ` Wilco Dijkstra
2016-11-14 13:07             ` Wilco Dijkstra
2016-12-06 15:07       ` Wilco Dijkstra
2017-01-17 15:14         ` [PATCH v3][AArch64] " Wilco Dijkstra
2017-02-02 14:44           ` Wilco Dijkstra
2017-02-23 16:58             ` Wilco Dijkstra
2017-04-20 16:03           ` Wilco Dijkstra
2017-06-13 14:00             ` Wilco Dijkstra
2017-06-14 14:07               ` James Greenhalgh [this message]
2017-06-14 16:03                 ` Wilco Dijkstra
2017-06-15 15:13                 ` Richard Earnshaw (lists)
2017-06-15 16:55                   ` Wilco Dijkstra
2017-06-15 17:39                     ` Richard Earnshaw (lists)
2017-06-15 17:51                       ` Wilco Dijkstra
2017-06-15 18:11                         ` Richard Earnshaw (lists)
2017-06-15 18:18                           ` Wilco Dijkstra
2017-06-15 18:34                             ` Richard Earnshaw (lists)
2017-06-15 18:55                               ` Wilco Dijkstra
2017-06-15 19:52                                 ` Joseph Myers
2017-06-16 15:14                                   ` Nathan Sidwell
2017-06-27 15:36               ` Wilco Dijkstra
2017-07-14 14:28                 ` Wilco Dijkstra
2017-07-21 11:23                   ` Wilco Dijkstra
2017-08-01 10:19                     ` Wilco Dijkstra
2017-08-15 17:36                       ` Wilco Dijkstra

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=20170614140702.GB8010@arm.com \
    --to=james.greenhalgh@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=marcus.shawcroft@arm.com \
    --cc=nd@arm.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).