Skip to content
Snippets Groups Projects
  • Brett Werling's avatar
    d82e33de
    readelf: use fseeko64 or fseeko if possible · d82e33de
    Brett Werling authored
    Changes readelf to make use first of fseeko64 and then fseeko,
    depending on which of those is available. If neither is available,
    reverts to the previous behavior of using fseek.
    
    This is necessary when building readelf for LLP64 systems, where a
    long will only be 32 bits wide. If the elf file in question is >= 2 GiB,
    that is greater than the max long value and therefore fseek will fail
    indicating that the offset is negative. On such systems, making use of
    fseeko64 or fseeko will result in the ability so seek past the 2 GiB
    max long boundary.
    
    Note that large archive handling in readelf remains to be fixed.
    d82e33de
    History
    readelf: use fseeko64 or fseeko if possible
    Brett Werling authored
    Changes readelf to make use first of fseeko64 and then fseeko,
    depending on which of those is available. If neither is available,
    reverts to the previous behavior of using fseek.
    
    This is necessary when building readelf for LLP64 systems, where a
    long will only be 32 bits wide. If the elf file in question is >= 2 GiB,
    that is greater than the max long value and therefore fseek will fail
    indicating that the offset is negative. On such systems, making use of
    fseeko64 or fseeko will result in the ability so seek past the 2 GiB
    max long boundary.
    
    Note that large archive handling in readelf remains to be fixed.