linker dhd
David Huggins-Daines
dhd@puffin.external.hp.com
Mon, 14 Feb 2000 15:27:06 -0700
CVSROOT: /home/cvs/parisc
Module name: linker
Changes by: dhd 00/02/14 15:27:06
Modified files:
. : Makefile.in allocate.c byteorder.c comdat.c
dead_proc.c debug_opt.c driver.c elftypes.h
fdp.c fixups.c get_text_off.c get_text_off.h
ld_linkmap.c ld_linkmap.h ld_strings.c
libraries.c libraries.h linker.c linker.h
o2n_driver.c o2n_tally.c output.c spaces.c
stubs.c subspaces.c symbols.c symbols.h util.c
util.h
Added files:
. : som_struct_io.c som_struct_io.h
Log message:
64-bit-cleanliness fixes (not entirely done, but it doesn't segfault
on Alpha/linux anymore, which is a good thing :)
Basically we don't read/write structs directly as bytstreams anymore,
using the stuff in som_struct_io.h instead. The reason for this is
that certain 32-bit fields in the structs were being reused (abused)
as pointers internally, and converted to/from string table indices
when reading and writing.
Well obviously this doesn't work on LP64 architectures, and can't be
easily kludged around by using longs, since the fields are and must
remain 32 bits wide on disk. So I've added some wrappers around
ffetch() and fdump() [1] that read and write the correct number of
bytes, compensating for the extra and separate char* fields that I
tacked on. Also the wrappers take care of the byteswapping of the
structs for us.
[1] Why exactly did these HP engineers decide to reinvent stdio
buffering (in ffetch() and fdump())? HP/UX libc can't be *that*
bad...