Symbol values in memory word units

Ian Lance Taylor iant@google.com
Tue Dec 2 15:45:00 GMT 2008


Alan Modra <amodra@bigpond.net.au> writes:

> On Mon, Dec 01, 2008 at 05:18:32PM -0800, Oleg Volf wrote:
>> linker expects section's vma and lma in byte units
>
> See bfd_arch_mach_octets_per_byte and OCTETS_PER_BYTE.

But in practice these are poorly defined and it is really hard to use
these successfully.  What I've done in the past is keep symbol values
and relocation addresses in bytes, and adjust in the relocation
routines.  This means that nm, objdump, readelf print the wrong
values, but it's not a difficult mental adjustment.

Ian



More information about the Binutils mailing list