| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AC_SYS_LARGEFILE defines _FILE_OFFSET_BITS in config.h if needed for
LFS, and this automatically maps things like open to open64. But quite
a few places used explicit 64-bit names, which won't work on platforms
like FreeBSD where off_t is always 64-bit and there are no foo64 names.
It's better to just trust that AC_SYS_LARGEFILE is doing it correctly.
But we can verify this too, as some file could easily forget to include
config.h. The new tests/run-lfs-symbols.sh checks all build targets
against lfs-symbols (taken from lintian) to make sure everything was
implicitly mapped to 64-bit variants when _FILE_OFFSET_BITS is set.
Signed-off-by: Josh Stone <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can only sanity check the symbols to discarded sections when creating a
debug file. Otherwise we won't keep track of debug_data. This can trigger
erroneously when there are relocation symbols in the symtab for a .debug
section but we are not putting those symbols in a separate .debug file.
Adjust run-strip-test.sh to always run in-place strip size check even
for ET_REL files. Before this fix the sanity check would trigger for
some ET_REL files because they contained such relocation symbols to
.debug sections (but debug_data would be NULL because -f wasn't used).
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ELF files can share the section header string table (e_shstrndx) with
the symtab .strtab section. That might in some cases save a bit of space
since symbols and sections might share some (sub)strings. To handle that
eu-strip just needs to not unconditionally remove the .shstrtab section
(it will be properly marked as used/unused as needed). eu-unstrip needs
to make sure the section names are added to the strtab if it decides to
rewrite that section. Also makes sure that eu-strip won't move around
a SHT_NOBITS section that has SHF_ALLOC set. Although it is allowed to
move such sections around, there is no benefit. And some tools might
expect no allocated section to move around, not even a nobits section.
It also makes it harder to do "roundtripping" sanity checks that make
sure splitting a file with eu-strip and then reconstructed with eu-unstrip
produce the same ELF file (as is done in the new run-strip-strmerge.sh).
Introduces a somewhat large test generator elfstrmerge.c that will
hopefully turn into a more generic string table merger program.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
| |
We already require -std=gnu99 and old-style function definitions might
hide some compiler warnings.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
We try to handle (in-place) stripping of ar archives, but since elf_clone
doesn't really support cloning ar members and we don't handle reducing
the size of the members, moving the offsets of other members. This causes
crashes or writing garbage. Better to just admit that for now we don't
support stripping archives. Call error when we see an ELF_K_AR file.
https://bugzilla.redhat.com/show_bug.cgi?id=766156
https://lists.fedorahosted.org/pipermail/elfutils-devel/2009-August/000567.html
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
There were various places where a bogus/unexpected input file would cause
eu-strip to crash. Also on an unexpected error eu-strip would leak the temp
debug file it was writing.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c34
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
Don't trust the elf version given by the file. It could be completely
bogus. In which case gelf_fsize just returns zero. Which could cause
divide by zero errors.
https://bugzilla.redhat.com/show_bug.cgi?id=1170810#c34
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
| |
futimes is not standard function, and it's not available in uClibc.
Use futimens which is POSIX.
Suggested-by: Mike Frysinger <[email protected]>
Signed-off-by: Max Filippov <[email protected]>
|
| |
|
|
|
|
|
| |
mtrace is a GNU extension not supported by uClibc and it's believed to
not be really used. Drop mtrace() calls and #include <mcheck.h>.
Signed-off-by: Max Filippov <[email protected]>
|
| |
|
|
|
|
|
| |
The date didn't really add much information (it is the day on which the
code happened to be compiled) and it prevents creating reproducible builds.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
| |
Using elf_getphdrnum lets us handle ELF files that use more than PN_XNUM
phdrs. And guards against some corrupt files.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
| |
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
The findtextrel leak is real, when processing lots of files without text
relocations the files and memory wouldn't be released. The strip leak is
minor since it can only happen when using -f which only allows one file
as argument. But it is nice to see valgrind say:
"All heap blocks were freed -- no leaks are possible".
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Change name from "Red Hat elfutils" to "elfutils".
* Update license of standalone tools and test from GPLv2 to GPLv3+.
* Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+.
* Add Developer Certificate of Origin based contributor policy.
top-level:
- COPYING: Upgraded from GPLv2 to GPLv3.
- CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files.
- NEWS: Added note about new contribution and license policy.
- Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST.
- configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'.
backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf:
- All files updated to GPLv2/LGPLv3+. Except some very small files
(<5 lines) which didn't have any headers at all before, the linker
.maps files and the libcpu/defs files which only contain data and
libelf/elf.h which comes from glibc and is under LGPLv2+.
config:
- elfutils.spec.in: Add new License: headers and new %doc files.
- Update all license headers to GPLv2/LGPLv3+ for files used by libs.
src, tests:
- All files updated to GPLv3+. Except for the test bz2 data files, the
linker maps and script files and some very small files (<5 lines)
that don't have any headers.
Signed-off-by: Richard Fontana <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Sun in their implementation messed up the semantics of these functions.
To get back to source code compatibility they asked for a solution.
We simply add aliases for the two affected functions, named
elf_getshdrnum and elf_getshdrstrndx. The semantics remains the
same. Users of the old interfaces receive a warning for now. In
future we might make it impossible to link programs which request
the old interfaces (binary compatibility will of course be maintained).
|
| | |
|
| | |
|
| |
|
|
| |
in all programs into the .rodata section.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* strip.c (handle_elf): Don't keep sections that kept symbol tables
refer to. Instead, just be sure to preserve the original symbol
table in the debug file so those symbols go with their sections and
can be elided from the stripped version of the symbol table.
tests/
* testfile48.bz2, testfile48.bz2.debug: New data files.
* Makefile.am (EXTRA_DIST): Add them.
* run-strip-test8.sh: Use them.
|
| |
|
|
|
|
| |
26cc2ce45739af072e7ff4fdab5e8eb7cd756d50)
to branch 'com.redhat.elfutils' (head bb519012dee7013b2cab5c2f5ed465cb3821b063)
|
| |
|
|
|
|
| |
d15b4eb794e81e477f9896fe82a74cb5ecf4514c)
to branch 'com.redhat.elfutils' (head eaacbf01f8cc89d043ec6eca9b5e35cb5c4cde06)
|
| | |
|
| |
|
|
|
|
| |
Minor fixes.
Update gettext files to 0.16.1.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2007-05-18 Roland McGrath <[email protected]>
* unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
stripped file, so as not to duplicate a section copied in both.
* strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.
tests/
2007-05-18 Roland McGrath <[email protected]>
* run-strip-test4.sh (stripped, debugfile): Use new reference files.
* testfile37.bz2: New data file.
* testfile37.debug.bz2: New data file.
* run-unstrip-test2.sh: New file.
* Makefile.am (TESTS, EXTRA_DIST): Add them.
|
| |
|
|
|
| |
* run-strip-test.sh: When we saved the debug info, test unstrip too.
|
| | |
|
| |
|
|
|
|
| |
b4944cf70801d9dac056f4f80ef1334e5acb8bdc)
to branch 'com.redhat.elfutils.roland.pending' (head e7e402c668fb0670fc5f6b6a522853ae88f32f11)
|
| | |
|
| | |
|
| |
|
|
|
|
| |
4f8fc821345feef58624f0aa5b470d4827577d8c)
to branch 'com.redhat.elfutils' (head 76e26cb54695fd3b21ee8fb5be3036bd68200633)
|
| | |
|
| |
|
|
| |
and b0183df71043735ade5c882809fed6c7ca571b2a
|
| | |
|
| |
|
|
| |
Minor strip cleanups.
|
| | |
|
| |
|
|
|
|
|
| |
* strip.c (options, parse_opt): Grok -R .comment for compatibility
with binutils strip. Likewise -d, -S, as aliases for -g.
Likewise ignore -s/--strip-all.
|
| |
|
|
|
|
| |
* strip.c (process_file): Open read-only when using a different output
file.
|
| |
|