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: m68hc11 %hi relocate problem with carry


On Fri, Mar 02, 2012 at 07:25:24PM +0000, James Murray wrote:
> I've found what appears to be a bug (or at least a limitation) when
> using a %hi assembler directive in m68hc11. This is supposed to return
> the high byte of the resolved symbol, but if the low byte overflows, the
> carry is missed.
> 
> Could someone point me at some example code in other targets that I
> could study in order to fix m68hc11 ?

68hc11/12 is a REL target, so you'll need to find the matching lo
reloc in order to build up the reloc addend.  It's easy to do if the
relocs are always adjacent, and the hi reloc comes first.  It's not so
easy otherwise (eg. if the hi follows the lo reloc, applying the lo
reloc loses the original addend).  See the mips backend.

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