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]

[PATCH v2 0/6] endianness fixes and preparation for strtab work


This collection of roughly-related acccumulated patches fixes a bunch of
bugs related to big-endian usage and cross-endian operation (reading
files on one endianness that were generated on another).

It also fixes a few nits involving lack of diagnostics of various forms
of file corruption and out-of-memory errors and prepares for upcoming
patches by discarding the mmap-based memory allocator: we always use
malloc() now, and no longer try to mprotect() our storage.

The endianness fixes trigger one format change: the struct ctf_slice_t
is naturally aligned now, even though this wastes space: slices are
expected to be relatively rare, and not aligning it causes the entire
rest of the file to be unaligned, necessitating memmove() to access
all future elements -- which we are not doing, so platforms incapable
of unaligned I/O crash instead.  This format change has no implications
for existing users, since nothing generates slices yet, so there is no
format version bump and we can keep using CTF_VERSION_3.

The test matrix has expanded to cover opening of foreign-endian
.ctf-containing ELF files and foreign-endian raw CTF and CTFA files on
both big- and little-endian platforms (for as long as I continue to have
access to them, that is: in particular I'm not sure how long I'll have
access to a Windows box for mingw tests, since my ancient Windows 7
laptop is about to be retired).

Changes since version 1:

 - cover letter
 - The ctf_open endianness patch is new.

Nick Alcock (6):
  libctf: handle errors on dynhash insertion better
  libctf: drop mmap()-based CTF data allocator
  libctf: dump header offsets into the debugging output
  libctf: unidentified type kinds on open are a sign of file corruption
  libctf: endianness fixes
  libctf: fix ctf_open endianness problems with raw CTF files

 include/ctf.h         | 10 +++++---
 libctf/ctf-create.c   | 49 ++++++++++++++++++++++-------------
 libctf/ctf-impl.h     |  9 ++-----
 libctf/ctf-open-bfd.c | 22 +++++++++-------
 libctf/ctf-open.c     | 59 ++++++++++++++++++++-----------------------
 libctf/ctf-subr.c     | 51 -------------------------------------
 6 files changed, 80 insertions(+), 120 deletions(-)

-- 
2.21.0.237.gd0cfaa883d


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]