This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: fx_offset Population
- To: Tracy Kuhrt <Tracy dot Kuhrt at microchip dot com>
- Subject: Re: fx_offset Population
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 30 Aug 2001 13:08:08 -0700
- Cc: binutils at sourceware dot cygnus dot com
- References: <3B8E9C1C.861BE80A@microchip.com>
Tracy Kuhrt <Tracy.Kuhrt@microchip.com> writes:
> In fix_new_internal, the fx_offset member of the fixP structure is
> populated with the offset, which is the value from the expressionS
> structure's'X_add_number. The problem...
>
> X_add_number is an offsetT (which in the end is a signed value).
> fx_offset is a valueT (which in the end is an unsigned value).
> When setting fx_offset to X_add_number, X_add_number is converted from a
> signed value to an unsigned value. So in my test case, I have the
> expression . - 65536. When the fixup is created -65536 is converted to
> an unsigned 4294901760.
>
> What would be the harm of changing fx_offset to be an offsetT?
Probably none.
However, at the level of the assembler, the differences between signed
and unsigned numbers in relocation offsets are, as far as I know,
inconsequential. I understand what you write above, but I don't
understand what the actual problem is. Even if you change fx_offset,
the number is just going to wind up in the addend field of an arelent,
and that is also unsigned.
Can you explain the real problem?
Ian