| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
This enables us to build a fully featured elfutils package on systems
with reduced C libraries, such as windows. All the modules are built
into libgnu.a, which is then linked into all binaries if
--enable-gnulib is given on the configure line.
Change-Id: I743fd22172bc85d9f10dcc3dad8eb921f462b554
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
The way it was before it didn't actually test if elf_update failed, but
rather did something random. !!(<some number>) is a boolean and boolean
true can be represented as anything non-0, including negative numbers.
Change-Id: I1c9540d849931fc28aaa806550d178231baa8b9a
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
| |
Change-Id: I8c8d91521f30863eb19497cb1d9f7ce8649a81ee
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
| |
BYTE_ORDER and friends are customarily defined in endian.h.
Change-Id: Id86f02c08584201013c0f35cf179616b608526dc
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
| |
Otherwise the build will fail on systems that actually need file
extension for executables.
Change-Id: Ief8daaf158182089aa65a9fd693b43c1f4cae9fb
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
| |
Otherwise we skip the munmap() later. This leaks resources.
Change-Id: I9e04ea3f0a608e88c474379df19c41261ecd092e
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
At least one test (dwfl-addr-sect) depends on the order of elf sections
with equal addresses. This is not guaranteed by the code. Compare also
by end address and name to tell entries apart.
Change-Id: I0e85e7b86a0489b6bc85f45f9a359c68a04f635a
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Some compilers implicitly cast the result of uint_fast16_t *
uint_fast16_t to something signed and then complain about the
comparison to (unsigned) size_t.
Casting phnum to size_t is a good idea anyway as 16bit multiplication
can easily overflow and we are not checking for this.
Change-Id: I073202d433d75b540ca042d15c364187a08fec6c
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
| |
We cannot rely on it to be available from any of the other headers.
Change-Id: I33a93fa8d41183908242542b8efafd2355bc968c
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
config.h doesn't have include guards, so including it twice is bad. We
deal with this by checking for PACKAGE_NAME, but only in some places.
Once we start using gnulib, we will need to include config.h before any
gnulib-generated headers. This is problematic if we include it
transitively through our own private headers.
In order to set a clear rule about inclusion of config.h, it is now
included in every .c file as first header, but not in any header. This
will definitely avoid double-inclusion and satisfy the condition that it
has to be included before gnulib headers. It comes at the price of
adding some redundancy, but there is no clean way to avoid this.
Change-Id: Ib78dd7e058ef8ac93cd379dcd14a2ffbc86c1988
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
| |
Change-Id: Ia74c04e2590d2d918fb7d5227a106de789551843
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
| |
If shnum is 0, the many "shnum - 1" would result in an overflow. Check it
for 0, and only subtract once, rather than on every usage.
Change-Id: I37a9e5d4e012a501d5ec98762ec0a435c743e25f
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
| |
F_GETFD is both cheaper and easier to port, and otherwise has the same
effect here.
Change-Id: I62ebfc74855b8d8a938476394c269c17a8be98cc
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
__attribute__ is a GNU extension. If we want to link against the
libraries using a different compiler, it needs to be disabled. It was
already disabled in libdw.h, and this patch extends this to the other
headers. We move the defines to libelf.h as that is included in all
the others.
Change-Id: I6e22674641f19f5a8820e2c7c7ec46f2fd70a8af
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
|
|
| |
Those are deprecated and apparently some implementations of nl_langinfo
return empty strings for them. The tests even tested for those empty
strings even though the intention of the code was clearly to output
"yes" or "no" there.
Change-Id: I4a0a24df2e9b5ac14a7eb6028f89c408b8a8aac7
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
| |
Not all search.h declare it, and it is not very helpful anyway.
Change-Id: Icd3439175048b25058507dd5ec657b5680b82bb2
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
| |
We only include them where we actually need them and only on linux.
Change-Id: Ic3065ffab67ba1177f63204fb91a92c5f4336dbb
Reviewed-by: Christian Kandeler <[email protected]>
|
| |
|
|
|
|
|
|
| |
The bad fts not only needs to be included before config.h, but also
requires various special types without including sys/types.h.
Change-Id: I31ac8d2aadcf7ffb3efb63583b2745991bfd6f90
Reviewed-by: Christian Kandeler <[email protected]>
|
| |\
| |
| |
| | |
Change-Id: Ifefd8ffeadb4e7d6df59cdc606323999eedc9adb
|
| | |
| |
| |
| | |
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Simply unconditionally uncompress any section to make sure indexes between
sections check out. Add some testcases with various compressed sections.
https://sourceware.org/bugzilla/show_bug.cgi?id=21332
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We were calling dwarf_attr_integrate () in the die in the loop instead of
on the result. Which would cause an infinite loop when die != result.
Add a testcase that explicitly checks this case.
https://sourceware.org/bugzilla/show_bug.cgi?id=21330
Signed-off-by: Mark Wielaard <[email protected]>
|
| |\|
| |
| |
| | |
Change-Id: Ie20a924c8a6bd83cf404f236dd288a489ace62a0
|
| | |
| |
| |
| |
| |
| | |
https://sourceware.org/bugzilla/show_bug.cgi?id=21320
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Make sure we can at least read the shnum sections or phnum segments.
Limit the number we do check to those we can actually read.
https://sourceware.org/bugzilla/show_bug.cgi?id=21312
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Calculate and use the expected entsize instead of relying on the one
given by the ELF file section header. Return early if there isn't enough
data in the section to check the full hash table.
https://sourceware.org/bugzilla/show_bug.cgi?id=21311
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Before checking symbol index zero we should make sure the data size
is big enough.
https://sourceware.org/bugzilla/show_bug.cgi?id=21310
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When ELF section data was used, but not updated or marked as dirty and
there also existed non-dirty sections and some padding was needed between
the sections (possibly because of alignment) then elf_update might write
"fill" over some of the existing data. This happened because in that case
the last_position was not updated correctly.
Includes a new testcase fillfile that fails before this patch by showing
fill instead of the expected data in some section data. It succeeds with
this patch.
https://sourceware.org/bugzilla/show_bug.cgi?id=21199
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The maximum compression factor (http://www.zlib.net/zlib_tech.html) is
1032:1. Add a sanity check for that before trying to allocate lots of
memory and trying to decompress lots of bogus data.
https://sourceware.org/bugzilla/show_bug.cgi?id=21301
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ELF notes can have a zero sized name. In which case there is no data at
all (so also no zero terminator). Make sure to use the empty string for
such notes if the code does not otherwise explicitly check n_namesz.
https://sourceware.org/bugzilla/show_bug.cgi?id=21300
Signed-off-by: Mark Wielaard <[email protected]>
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We sanity check to make sure we don't index outside the chain array
by testing inner > max_nsyms. But inner is a zero-based index, while
max_nsyms is the maximum number. Change the check to inner >= max_nsyms.
https://sourceware.org/bugzilla/show_bug.cgi?id=21299
Signed-off-by: Mark Wielaard <[email protected]>
|
| |\|
| |
| |
| | |
Change-Id: I7874d814ddf7e5887fd720c899cb9e7499d5fbb8
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make sure that if we have really lots of labels the tempsym doesn't get
truncated because it is too small to hold the whole name.
This doesn't enable -Wformat-truncation=2 or fix other "issues" pointed
out by enabling this warning because there are currently some issues
with it. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79448
Signed-off-by: Mark Wielaard <[email protected]>
|
| |/
|
|
|
|
|
|
| |
ppc64 and ppc64le ELF files can also contain a power specific
.gnu.attributes section. Add support for those and recognize the new
GNU_Power_ABI_FP Single-precision hard float value.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
| |
Rename version.c so that the implementation is called after the header
and the header doesn't clash with the toplevel version.h. print_version
depends on argp and is only used in the tools.
Signed-off-by: Ulf Hermann <[email protected]>
|
| |
|
|
|
|
| |
If it doesn't exist, provide a definition based on memcpy.
Signed-off-by: Ulf Hermann <[email protected]>
|
| |
|
|
|
|
|
| |
This makes it easier to write a replacement for it on systems where
sysconf(3) doesn't exist.
Signed-off-by: Ulf Hermann <[email protected]>
|
| |
|
|
|
|
|
|
| |
We only need it in nm.c and objdump.c, but it pulls in argp as
dependency. By dropping it from libeu.h, the libraries can be
compiled without argp.
Signed-off-by: Ulf Hermann <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
Some distros now add -D_FORTIFY_SOURCE=2 by default and we have missed
some issues in the past caught by it. Add it to CFLAGS if possible.
The configure check will make sure that it doesn't conflict with any
other CFLAGS already defined.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
| |
This is useful to test unwinding without debug information. The
binaries being examined might still have frame pointers that allow
us to bridge the unknown symbols.
Signed-off-by: Ulf Hermann <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
When unwinding by frame pointer the unwinder might ask for invalid
addresses. We don't have to fail the test in this case. In fact
any broken dwarf information can lead to requests for invalid
addresses, also without frame pointer unwinding.
Signed-off-by: Ulf Hermann <[email protected]>
|
| |
|
|
|
|
| |
Some test binaries were missing and showed up in "git status".
Signed-off-by: Ulf Hermann <[email protected]>
|
| |
|
|
|
|
|
| |
autoconf < 2.64 doesn't define PACKAGE_URL through AC_INIT.
Define it ourselves if needed.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
| |
https://sourceware.org/bugzilla/show_bug.cgi?id=21001
Signed-off-by: Luiz Angelo Daros de Luca <[email protected]>
|
| |
|
|
|
|
| |
https://sourceware.org/bugzilla/show_bug.cgi?id=20999
Signed-off-by: Piotr Drąg <[email protected]>
|
| |
|
|
|
|
| |
https://sourceware.org/bugzilla/show_bug.cgi?id=20999
Signed-off-by: Piotr Drąg <[email protected]>
|
| |
|
|
|
|
| |
https://sourceware.org/bugzilla/show_bug.cgi?id=20999
Signed-off-by: Piotr Drąg <[email protected]>
|
| |
|
|
| |
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fedorahosted used to be our home, but we are now hosted at sourceware.
Change the elfutils project home to http://elfutils.org/
Point hosted services (email, release, git, bug tracker and web pages)
to https://sourceware.org/elfutils/
Move design notes from README to NOTES.
Add URLs for home, releases, bugs, git and mailinglist to README.
Make the --version output of all tools the same by using a common
print_version function and update the publicly shown copyright holder
to the elfutils developers.
Signed-off-by: Mark Wielaard <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
unsigned long int is not always capable to have pointer in some cases
(LLP64, for example). Return a void pointer instead. Other libelf
implementations will also make this change (or already have).
Also update the documentation to state what is created and that NULL
is returned on error (don't document that the returned value is a
pointer to the actual header created).
Signed-off-by: Akihiko Odaki <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
|