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

Jose E. Marchesi jose.marchesi@oracle.com
Fri Jun 21 12:14:00 GMT 2019

    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.

Pushed in your behalf.

More information about the Binutils mailing list