[PATCH] Switch from numerical to defined constants for permissions.

2020-11-01 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Use defined constants for permission values. Also add fallback definitions for them in system.h, to allow for compatibility with systems that don't provide these macros. Include system.h in all tests/ files that required it. Signed-off-by: Érico Rolim --- I'm a bit unsure ab

[PATCH v2] debuginfod.cxx: include libintl.h.

2020-11-01 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim Uncomment the include, since textdomain() and bindtextdomain() functions provided by it are being used. Signed-off-by: Érico Rolim --- This is a follow up to the patch that went the opposite way and removed the calls to bindtextdomain() and textdomain(); it was decided that

[PATCH v2] Support building when fts and obstack aren't part of libc.

2020-11-01 Thread Érico Nogueira via Elfutils-devel
From: Érico Rolim - Make configure.ac test for fts and obstack availability; - Add fts and obstack ldflags to all files that need them; - Add missing argp ldflags to programs in debuginfod/. Signed-off-by: Érico Rolim --- ChangeLog | 4 configure.ac | 20 ++

[PATCH] libelf: Check header exists in elf_strptr

2020-11-01 Thread Mark Wielaard
We already checked the header actually existed for ELFCLASS64 but not for the ELFCLASS32 case. It is very unlikely it is at this point in the code, but theoretically it could happen. Signed-off-by: Mark Wielaard --- libelf/ChangeLog| 4 libelf/elf_strptr.c | 2 +- 2 files changed, 5 ins

[PATCH] libelf: Set dst to zero on failure in __elf_getphdrnum_rdlock

2020-11-01 Thread Mark Wielaard
GCC with -flto finds some (very) unlikely error paths. It flags callers of __elf_getphdrnum_chk_rdlock with *dst not yet set because an internal call to __elf_getphdrnum_rdlock might not initialize *dst either in one particular failure path. The sanity check that __elf_getphdrnum_chk_rdlock then pe

[PATCH] libelf: Use GElf_Ehdr instead of Elf handle in __libelf_data_type

2020-11-01 Thread Mark Wielaard
GCC with -flto detects some (very) unlikely issues in error paths. In theory getting the Ehdr from an Elf handle might fail. But in most cases where __libelf_data_type is used, we already have the Ehdr anyway. So simply pass that to __libelf_data_type. In the one place where we don't have it yet, g