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] Edit PowerPC64 ELFv2 function entry code


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


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