elfutils:users/halamour/try-pr30000

Last commit made on 2023-09-28
Get this branch:
git clone -b users/halamour/try-pr30000 https://git.launchpad.net/elfutils

Branch merges

Branch information

Name:
users/halamour/try-pr30000
Repository:
lp:elfutils

Recent commits

b677f2a... by Housam Alamour <email address hidden>

PR 30000: debuginfod-find should have a source-list verb

* seclines.cxx: Introduce new tool that compiles a list of source
files associated with a specified dwarf/elf file. This
compilation relies on searching the dwarf debug information,
which can be automatically retrieved via debuginfod using
libdwfl functions when required. The target file can
encompass various types, such as an executable, a coredump,
a running process, or the currently executing kernel. The
source file names are rendered as unique entries and then
displayed on the standard output.

* run-srcfiles-self.sh: New test-case for tool.

https://sourceware.org/bugzilla/show_bug.cgi?id=30000

Signed-off-by: Housam Alamour <email address hidden>

276c367... by Mark J. Wielaard

tests: Fix system_elf_gelf_test build without system libelf.h

If there is no system libelf.h then the building of system-elf-gelf-test
fails with:

../libelf/gelf.h:32:10: fatal error: libelf.h: No such file or directory

This is because although the testcase includes the headers as
../libelf/libelf.h and ../libelf/gelf.h, gelf.h itself does an

Fix this by putting a copy of libelf.h in the build test directory
and using -I. for building system-elf-gelf-test.

 * tests/Makefile.am (BUILT_SOURCES): New for libelf.h.
 (CLEANFILES): Add libelf.h.
 (libelf.h): New target that copies srdir libelf.h.
 (system_elf_gelf_test_CPPFLAGS): Add -I.

https://sourceware.org/bugzilla/show_bug.cgi?id=30812

Signed-off-by: Mark Wielaard <email address hidden>

3ef3fab... by Frank Ch. Eigler

PR30809: improve debuginfod client progress-callback parameters

* debuginfod-client.c (debuginfod_query_server): Use fstat(3)
  of the file handle being downloaded into as the preferred
  source of download progress.

Tested by hand, as the testsuite doesn't have enough machinery to
simulate compressed vs. uncompressed service. Hand testing with
(unmodified) fedora-38 gdb and debuginfod-find shows dramatically
improved progress displays: all have quantitative figures when
fetching from real (unmodified) upstream servers.

Signed-off-by: Frank Ch. Eigler <email address hidden>

9c41344... by Xi Ruoyao <email address hidden>

backends: Update list of LoongArch relocations

 * backends/loongarch_reloc.def: Add DELETE, ALIGN, PCREL20_S2,
 CFA, ADD6, SUB6, ADD_ULEB128, SUB_ULEB128, 64_PCREL.

Signed-off-by: Xi Ruoyao <email address hidden>

2ba424d... by Xi Ruoyao <email address hidden>

libelf: Sync elf.h from Glibc

Adds new LoongArch relocations.

 * elf.h: Update from glibc.

Signed-off-by: Xi Ruoyao <email address hidden>

39f2c50... by Mark J. Wielaard

libelf, readelf, elflint: Add RELR support

Handle RELR as defined here:
https://groups.google.com/g/generic-abi/c/bX460iggiKg/m/YT2RrjpMAwAJ

Introduce new ELF_T_RELR Elf_Type and handle it for SHT_RELR. Check
various properties in elflint. Print RELR relocations in
readelf. Just the entries with -U. Just the addresses with -N. And
addresses plus symbol/offsets by default.

Also add a test to check that gelf.h works with the system elf.h.

 * libebl/eblsectiontypename.c (ebl_section_type_name): Add RELR
 to knownstype.
 * libelf/elf32_updatenull.c (updatenull_wrlock): Handle
 sh_entsize for SHT_RELR.
 * libelf/gelf.h (GElf_Relr): New typedef for Elf64_Relr.
 * libelf/gelf_fsize.c (__libelf_type_sizes): Add ELF_T_RELR.
 * libelf/gelf_xlate.c (__elf_xfctstom): Likewise.
 * libelf/gelf_xlate.h: Add RELR as FUNDAMENTAL.
 * libelf/libelf.h (Elf_Type): Add ELF_T_RELR. Add RELR
 defines/typedefs if undefined in system elf.h.
 * libelf/libelfP.h: Define ELF32_FSZ_RELR and ELF64_FSZ_RELR.
 * src/elflint.c (check_reloc_shdr): Check she_entsize for
 ELF_T_RELR.
 (check_relr): New function.
 (check_dynamic): Handle DT_RELR.
 (special_sections): Add SHT_RELR.
 (check_sections): Call check_relr.
 * src/readelf.c (print_relocs): Also accept a Dwfl_Module.
 (handle_relocs_relr): New function.
 (print_dwarf_addr): Make static and declare early.
 (process_elf_file): Pass dwflmod to print_relocs.
 (handle_dynamic): Handle DT_RELRSZ and DTRELRENT.
 * system-elf-gelf-test.c: New test.
 * Makefile.am (TESTS): Add system-elf-gelf-test.
 (check_PROGRAMS): Likewise.
 (system_elf_gelf_test_CPPFLAGS): New variable.
 (system_elf_gelf_test_LDADD): Likewise.

https://sourceware.org/bugzilla/show_bug.cgi?id=28495

Signed-off-by: Mark Wielaard <email address hidden>

09e61a6... by Mark J. Wielaard

libelf: Remove elf_scncnt from libelf.map

elf_scncnt was never implemented. It was probably an old name for
elf_getshnum (which was the deprecated name of the elf_getshdrnum
alias). Just remove it from the map file

 * libelf/libelf.map (ELFUTILS_1.0): Remove elf_scncnt.

https://sourceware.org/bugzilla/show_bug.cgi?id=30729

Reported-by: Kostadin Shishmanov <email address hidden>
Signed-off-by: Mark Wielaard <email address hidden>

27a8496... by Mark J. Wielaard

libelf: Free and clear rawdata_base and zdata_base consistently

There could be a leak if a program called elf_strptr on a compressed
section, but the program never requests the (uncompressed) section data,
but does explicitly (re)compress that same section data.

Fix this by explicitly always freeing and clearing the zdata_base
and rawdata_base in __libelf_reset_rawdata and elf_compress. Also
clear zdata_base in elf_end so the pointer isn't indeterminate when
it is being used in a later comparison against rawdata_base.

 * libelf/elf_compress.c (elf_compress): Explicitly free
 zdata_base before clearing.
 (__libelf_reset_rawdata): Free zdata_base if it isn't
 (going to be) used for rawdata_base. Explicitly clear
 rawdata_base and zdata_base after free.
 * libelf/elf_end.c (elf_end): Clear zdata_base after free.

Signed-off-by: Mark Wielaard <email address hidden>

a78fc84... by Sam James <email address hidden>

tests: run-lfs-symbols.sh needs gawk

With awk=mawk, I get:
```
FAIL: run-lfs-symbols.sh
========================

First sanity-check that LFS detection works.
checking ./testfile-nolfs
awk: line 3: syntax error at or near /
FAIL run-lfs-symbols.sh (exit status: 2)
```

 * tests/run-lfs-symbols.sh: Call 'gawk' instead of 'awk'.

Signed-off-by: Sam James <email address hidden>

1e3f1f9... by Frank Ch. Eigler

SECURITY: new file

Policy drafted in April 2023.

https://<email address hidden>/

Added links to README, and mentioned in configury/spec files for installation.

Signed-off-by: Frank Ch. Eigler <email address hidden>