This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH v3][AArch64] Fix symbol offset limit
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, nd <nd at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, <marcus dot shawcroft at arm dot com>
- Date: Wed, 14 Jun 2017 15:07:03 +0100
- Subject: Re: [PATCH v3][AArch64] Fix symbol offset limit
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=pass (sender IP is 184.108.40.206) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=bestguesspass action=none header.from=arm.com;
- Nodisclaimer: True
- References: <AM5PR0802MB26102B496BBC43761EDFC7B983EB0@AM5PR0802MB2610.eurprd08.prod.outlook.com> <firstname.lastname@example.org> <AM5PR0802MB2610C7C9B721D04F8DC1A3B683EC0@AM5PR0802MB2610.eurprd08.prod.outlook.com> <AM5PR0802MB26107A178F34C4110B35FD6083FF0@AM5PR0802MB2610.eurprd08.prod.outlook.com> <VI1PR0802MB262163954412870CCA1538EF83820@VI1PR0802MB2621.eurprd08.prod.outlook.com> <AM5PR0802MB2610EA1E438B71D26C6CBA06837C0@AM5PR0802MB2610.eurprd08.prod.outlook.com> <AM5PR0802MB261002EBFBF54A2368DD74C5831B0@AM5PR0802MB2610.eurprd08.prod.outlook.com> <VI1PR0802MB262180A56B715BD564EA12DA83C20@VI1PR0802MB2621.eurprd08.prod.outlook.com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Tue, Jun 13, 2017 at 03:00:28PM +0100, Wilco Dijkstra wrote:
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;
> return fixed_regs + fixed_regs2;
> > 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.