This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch][Gold] BE8 for ARM
- From: Cary Coutant <ccoutant at gmail dot com>
- To: "Bharathi Seshadri (bseshadr)" <bseshadr at cisco dot com>
- Cc: "Richard Earnshaw (lists)" <Richard dot Earnshaw at arm dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Fri, 12 Aug 2016 09:35:17 -0700
- Subject: Re: [Patch][Gold] BE8 for ARM
- Authentication-results: sourceware.org; auth=none
- References: <e124ab5c838a46a1a831cd4caa52c501@XCH-RTP-013.cisco.com> <a2fa5b27-4c6e-274f-a52a-8f164da571ce@arm.com> <CAJimCsGs2eP-LbeAy8=kSrhxw01+GnyN1F9RyTdeOa6bGOPjkw@mail.gmail.com> <926c9132a0364f1b8c6dba6c7a2a46f4@XCH-RTP-013.cisco.com>
> My application is arm only and non-thumb, so I did not include the thumb patch in the initial implementation. I'm now extending it to cover thumb. I'll post the patch when I'm done with testing.
OK, thanks! Here are my comments on the formatting...
+ gold_assert(section_address >= view_address
+ && ((section_address + section_size)
+ <= (view_address + view_size)));
The indentation isn't right here. The "<=" should line up with the
second '(' in the line above.
for (size_t i = 0; i < num_first_plt_words - 1; i++)
- elfcpp::Swap<32, big_endian>::writeval(pov + i * 4, first_plt_entry[i]);
+ if (parameters->options().user_set_be8())
+ elfcpp::Swap<32, false>::writeval(pov + i * 4, first_plt_entry[i]);
+ else
+ elfcpp::Swap<32, big_endian>::writeval(pov + i * 4, first_plt_entry[i]);
(Two places.) I'd prefer to see braces around the body of the for loop
here, since it's a more complex statement.
+ if (parameters->options().user_set_be8())
+ elfcpp::Swap<32, false>::writeval(pov + 16,
+ got_address - (plt_address + 16));
+ else
+ elfcpp::Swap<32, big_endian>::writeval(pov + 16,
got_address - (plt_address + 16));
(Two places.) The indentation is off here, too. In each case,
"got_address" should line up under "pov".
+ if (parameters->options().user_set_be8())
Instead of "user_set_be8", you should probably be using just "be8".
The difference is that if --be8 is ever turned on by default,
user_set_be8() will still be true only if the option is explicitly
specified on the command line. (I do see a few other places in arm.cc
where the same argument applies; those should probably get cleaned up
someday.)
+ DEFINE_bool(be8,options::TWO_DASHES, '\0', false,
+ N_("(ARM only) be8 -byte invariant addressing."), NULL);
The hyphen in front of "byte" seems wrong. (For comparison, ld's help
text is simply "Output BE8 format image", but I find that fairly
unhelpful.)
-cary