This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [GOLD] Edit PowerPC64 ELFv2 function entry code
- From: Alan Modra <amodra at gmail dot com>
- To: Cary Coutant <ccoutant at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 9 Dec 2015 17:44:08 +1030
- Subject: Re: [GOLD] Edit PowerPC64 ELFv2 function entry code
- Authentication-results: sourceware.org; auth=none
- References: <20151125014026 dot GV8120 at bubble dot grove dot modra dot org> <CAJimCsHrqYDDPXpdqex6NGwntVi=U7Scmof+=t-n8Lza0nbC8g at mail dot gmail dot com> <20151208233210 dot GN1270 at bubble dot grove dot modra dot org> <CAJimCsHxux6_=L7BT9Eq8WpvQb+RY6a=LYRovqcxGZht_R3n7w at mail dot gmail dot com>
On Tue, Dec 08, 2015 at 06:59:29PM -0800, Cary Coutant wrote:
> Do you worry about proper alignment?
We know instructions are 4-byte aligned, so I think it is reasonable
to use elfcpp::Swap rather than elfcpp::Swap_unaligned.
> If gold is running on a host that
> doesn't support unaligned access, any misaligned relocations will
> cause gold to crash. If misaligned relocations are unexpected, it
> would be good to check and issue a graceful warning; if expected, you
> should probably use Swap_unaligned.
You'd need to deliberately craft misaligned relocs to hit this
problem so I think the possibility of misaligned relocs can be
discounted. Checking code would belong in elfcpp_swap.h, wouldn't it?
--
Alan Modra
Australia Development Lab, IBM