X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libdwfl%2Fopen.c;h=92f2798b4074ba227582f24f6f9d42513920f7f1;hb=82c3b58b54026d061a4d81ad95f3023d5d883ab2;hp=40aac38801ef5fc2c5a29a0179fed0fcb3fcc8d3;hpb=a286dd013ef8d46edf013efc0908822a59d8ac81;p=platform%2Fupstream%2Felfutils.git diff --git a/libdwfl/open.c b/libdwfl/open.c index 40aac38..92f2798 100644 --- a/libdwfl/open.c +++ b/libdwfl/open.c @@ -1,5 +1,5 @@ -/* Decompression support for libdwfl: zlib (gzip) and/or bzlib (bzip2). - Copyright (C) 2009 Red Hat, Inc. +/* Decompression support for libdwfl: zlib (gzip), bzlib (bzip2) or lzma (xz). + Copyright (C) 2009, 2016 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -32,10 +32,6 @@ #include -#if !USE_ZLIB -# define __libdw_gunzip(...) DWFL_E_BADELF -#endif - #if !USE_BZLIB # define __libdw_bunzip2(...) DWFL_E_BADELF #endif @@ -52,8 +48,7 @@ decompress (int fd __attribute__ ((unused)), Elf **elf) void *buffer = NULL; size_t size = 0; -#if USE_ZLIB || USE_BZLIB || USE_LZMA - const off64_t offset = (*elf)->start_offset; + const off_t offset = (*elf)->start_offset; void *const mapped = ((*elf)->map_address == NULL ? NULL : (*elf)->map_address + offset); const size_t mapped_size = (*elf)->maximum_size; @@ -65,7 +60,6 @@ decompress (int fd __attribute__ ((unused)), Elf **elf) error = __libdw_bunzip2 (fd, offset, mapped, mapped_size, &buffer, &size); if (error == DWFL_E_BADELF) error = __libdw_unlzma (fd, offset, mapped, mapped_size, &buffer, &size); -#endif if (error == DWFL_E_NOERROR) { @@ -132,7 +126,7 @@ __libdw_open_file (int *fdp, Elf **elfp, bool close_on_fail, bool archive_ok) /* It's not an ELF file or a compressed file. See if it's an image with a header preceding the real file. */ - off64_t offset = elf->start_offset; + off_t offset = elf->start_offset; error = __libdw_image_header (*fdp, &offset, (elf->map_address == NULL ? NULL : elf->map_address + offset),