From: Tracy Kuhrt <Tracy.Kuhrt@microchip.com>
To: Ian Lance Taylor <ian@zembu.com>
Cc: binutils@sourceware.cygnus.com
Subject: Re: fx_offset Population
Date: Thu, 30 Aug 2001 14:11:00 -0000 [thread overview]
Message-ID: <3B8EAC0C.9BAD2E9@microchip.com> (raw)
In-Reply-To: <sizo8huuvb.fsf@daffy.airs.com>
Ian,
Great! Thanks for helping me figure this one out. Agree that it is better to fix
the root problem than just the symptom.
Tracy
Ian Lance Taylor wrote:
> Tracy Kuhrt <Tracy.Kuhrt@microchip.com> writes:
>
> > The new target that I am porting is using a COFF format. I am trying to
> > place the addend value in the 16-bits that I have for this operand. Where
> > the problem comes in is after fixup_segment calls the md_apply_fix3 function
> > (which divides this addend by 2) it then checks to see that the value it will
> > be writing is able to fit into 2 bytes. 2147450880 (0x7FFF8000) does not fit
> > and I get the error "Value of 2147450880 too large for field of 2 bytes at
> > 0". But a -32768 should fit in 2 bytes.
> >
> > Does this mean that anywhere that my md_apply_fix3 function uses the
> > fx_offset field in a calculation it must first convert it back to a signed
> > value?
>
> Yes, md_apply_fix3 must apply any relocation changes using the correct
> type of arithmetic. In this case, it presumably must use signed
> division.
>
> Always making fx_offset signed is no more correct than always making
> it unsigned. Either way, md_apply_fix3 is responsible for doing the
> right thing.
>
> Ian
prev parent reply other threads:[~2001-08-30 14:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-08-30 13:03 Tracy Kuhrt
2001-08-30 13:08 ` Ian Lance Taylor
2001-08-30 13:41 ` Tracy Kuhrt
2001-08-30 13:59 ` Ian Lance Taylor
2001-08-30 14:11 ` Tracy Kuhrt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3B8EAC0C.9BAD2E9@microchip.com \
--to=tracy.kuhrt@microchip.com \
--cc=binutils@sourceware.cygnus.com \
--cc=ian@zembu.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).