Re: [PATCH] addr2line: Use elf_getshdrstrndx not Ehdr field to print section name.

2018-10-26 Thread Mark Wielaard
On Wed, 2018-10-24 at 16:18 +0200, Mark Wielaard wrote: > Using the Ehdr field directly doesn't work when there are a large > number of sections. Pushed to master.

Re: [PATCH] readelf: Use shstrndx to lookup section names.

2018-10-26 Thread Mark Wielaard
On Wed, 2018-10-24 at 16:01 +0200, Mark Wielaard wrote: > The function section_name would use the Ehdr e_shstrndx field to find the > index of the section index string table directly. But it should use > elf_getshdrstrndx. Adjust all callers. Pushed to master.

[PATCH 4/4] strip: Add --reloc-debug-sections-only option.

2018-10-26 Thread Mark Wielaard
This option does the same thing as --reloc-debug-sections without doing any other strip operation. This is useful when you want to remove the debug section relocations in a separate ET_REL debug file that was created without --reloc-debug-sections, or for a file (like the linux debug vmlinux) that

[PATCH 3/4] strip: Extract code to update shdrstrndx into new common function.

2018-10-26 Thread Mark Wielaard
Signed-off-by: Mark Wielaard --- src/ChangeLog | 5 src/strip.c | 94 +++ 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f55ff6c..766c839 100644 --- a/src/ChangeLog +++ b/src/Chan

[PATCH 2/4] strip: Split out debug section relocation into separate helper functions.

2018-10-26 Thread Mark Wielaard
Extract a couple of helper functions out of handle_elf (secndx_name, get_xndxdata and remove_debug_relocations) so they can be reused more easily in the future. Signed-off-by: Mark Wielaard --- src/ChangeLog | 7 + src/strip.c | 541 +++---

[PATCH 1/4] strip: Always copy over any phdrs if there are any.

2018-10-26 Thread Mark Wielaard
Ignore the type of ELF file, just copy over any phdrs if the original file contained any. Also refuse to move around any allocated sections based on whether there are any phdrs instead of on ELF file type. Signed-off-by: Mark Wielaard --- src/ChangeLog | 6 + src/strip.c | 70

Add eu-strip --reloc-debug-sections-only option

2018-10-26 Thread Mark Wielaard
Hi, eu-strip already supports --reloc-debug-sections to resolve all relocations between .debug_ sections while creating a separate .debug file with -f. It is sometimes useful to do the same without doing any other stripping. --reloc-debug-sections-only Similar to --relo