This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [gold][aarch64] Patch for erratum-843419 (1 of 2 - report erratum occurrences)


>> 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.

>>     return;
>>   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).

This is OK with that change. Thanks!

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]