This is the mail archive of the
mailing list for the binutils project.
Re: [gold][aarch64] Patch for erratum-843419 (1 of 2 - report erratum occurrences)
- From: HÃn ShÄn (ææ) <shenhan at google dot com>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: binutils <binutils at sourceware dot org>, Jing Yu <jingyu at google dot com>, Doug Kwan <dougkwan at google dot com>, Luis Lozano <llozano at google dot com>, Bhaskar <bjanakiraman at google dot com>, Andrew Hsieh <andrewhsieh at google dot com>, Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>
- Date: Thu, 16 Apr 2015 15:33:10 -0700
- Subject: Re: [gold][aarch64] Patch for erratum-843419 (1 of 2 - report erratum occurrences)
- Authentication-results: sourceware.org; auth=none
- References: <CACkGtrhuUi7DtTQ89khOARvV3SMgyHdSea8EAMqioWT5Kh4R9g at mail dot gmail dot com> <CAJimCsE5vpge_UqaYCqGgTrr5OOvs_a4eQUS9nrrkpnPeQR+2w at mail dot gmail dot com> <CACkGtrhCwX0Qyj1_XQgq-8GOtHjHUu0WKrtOKaOhX13Y6QYaQw at mail dot gmail dot com> <CAJimCsHruf458hd3zY_C5br_FXLigx+oMu2rfo+DSuaofBVEjA at mail dot gmail dot com>
Hi Cary, thanks! (comments addressed and CL submitted)
On Thu, Apr 16, 2015 at 2:37 PM, Cary Coutant <email@example.com> wrote:
>>> Given the constraints on the address, it's inefficient to loop over
>>> every address. I'd suggest instead something like this:
>>> if (output_address & 0x03 != 0)
>> 'output_address' is output section's output_address, so I use
>> 'output_address + span_start' here.
> Alternatively, you could do "output_address += span_start" at the top
> of the function, or pass "output_address + span_start" where you call
> the function.
>>> section_size_type offset = 0;
>>> section_size_type span_length = span_end - span_start;
>>> // The first instruction must be at page offset 0xFF8 or 0xFFC.
>>> unsigned int page_offset = output_address & 0xfff;
>> Same as above, 'output_address' is output section's output_address, so
>> I use 'output_address + span_start' here.
>> If there a consensus/guideline on whether to use '0xfff' or '0xFFF'?
> I find lots of both, but lower-case seems to predominate (I just find
> it easier to count upper-case F's in non-monospaced text like this
> email). Regardless, the 'x' should always be lower-case:
> + page_offset = (output_address + span_start + offset) & 0XFFF;
> + if (page_offset == 0XFF8)
> + offset += 4;
> + else // (page_offset == 0xffc), we move to next page's 0xff8.
> + offset += 0XFFC;
> I'd go with all lower-case (throughout this function).
Done with lower-case.
> This is OK with that change. Thanks!