Hi,
I'm trying to debug why strip on mips isn't working properly. What I see is that for the debug sections, sh_type is not set to SHT_PROGBITS but to SHT_MIPS_DWARF.
The stripped file still ends up with the debug information it it, and the file that is supposed to have the debug symbols in it has it set to SHT_NOBITS, and is rather small.
I'm assuming this is because of the SHT_MIPS_DWARF. I'm not sure how to find where it's going wrong.
Kurt
Corey Minyard cited this problem and had a fix (which we've not yet reviewed). I've just now noticed that Corey didn't post to the list, but only sent a private message to me and Ulrich.
Corey, can you post your message to the list for everyone to see?
Thanks, Roland
On 03/20/2012 06:16 PM, Roland McGrath wrote:
Corey Minyard cited this problem and had a fix (which we've not yet reviewed). I've just now noticed that Corey didn't post to the list, but only sent a private message to me and Ulrich.
Corey, can you post your message to the list for everyone to see?
Thanks, Roland
Ok, sorry, I couldn't find the mailing list referenced in the sources. Here's the patch. It doesn't really feel like the right way to fix this, but I couldn't think of a better way.
-corey
MIPS gives SHT_MIPS_DWARF type to debug sections which is not handled properly by the strip utility, it changes the section type to SHT_NOTYPE in the stripped file.
--- elfutils-0.96/libelf/elf-knowledge.h.orig 2005-06-28 15:08:39.000000000 -0700 +++ elfutils-0.96/libelf/elf-knowledge.h 2005-06-28 15:06:42.000000000 -0700 @@ -46,7 +46,7 @@ && ((remove_comment) || strcmp (name, ".comment") != 0))) \ /* So far we do not remove any of the non-standard sections. \ XXX Maybe in future. */ \ - && (shdr)->sh_type < SHT_NUM) + && ((shdr)->sh_type < SHT_NUM || (shdr)->sh_type == SHT_MIPS_DWARF))
/* Test whether `sh_info' field in section header contains a section
I don't see any reason to treat nonstandard section types specially at all. The norm is to strip non-allocated sections. We have special exceptions for SHT_NOTE and a few named SHT_PROGBITS sections that particularly should not be stripped. If there are any nonstandard types that should not be stripped, then we can add special cases for those.
Unless anyone can cite a good reason not to, I'll just remove the < SHT_NUM check entirely.
Thanks, Roland
On Wed, 2012-03-21 at 09:32 -0700, Roland McGrath wrote:
I don't see any reason to treat nonstandard section types specially at all. The norm is to strip non-allocated sections. We have special exceptions for SHT_NOTE and a few named SHT_PROGBITS sections that particularly should not be stripped. If there are any nonstandard types that should not be stripped, then we can add special cases for those.
Unless anyone can cite a good reason not to, I'll just remove the < SHT_NUM check entirely.
I cannot think of a good reason not to. Except that there might be unknown arch specific section types that need special handling because they aren't marked SHF_ALLOC but still cannot be stripped. But like you said, lets add explicit special cases for them if they do pop up.
Cheers,
Mark
I've made the change. It would good if we had a test case affected by it.
Thanks, Roland
On Thu, Mar 22, 2012 at 10:26:28AM -0700, Roland McGrath wrote:
I've made the change. It would good if we had a test case affected by it.
The test run-strip-reloc.sh failed on a mips binary. The stripping works now with the patch.
The next problem I see is that eu-readelf -w doesn't actually show the contents of the debug sections, either on the non-stripped or debug only file.
This then results in the grep returning 1, and so the same test still fails.
Kurt
The test run-strip-reloc.sh failed on a mips binary. The stripping works now with the patch.
We like to have consistent tests regardless of host (as well as the tests that use the native-built binaries). So what I was suggesting was a new test with precise stored binaries.
The next problem I see is that eu-readelf -w doesn't actually show the contents of the debug sections, either on the non-stripped or debug only file.
Well, we don't actually have a mips backend, so various problems are to be expected until that porting work gets done. That particular one is due to the SHT_PROGBITS check in readelf.c:print_debug. Since SHT_MIPS_DWARF is in the SHT_LOPROC..SHT_HIPROC range, it wouldn't be proper to match it generically, so we really do need to add an ebl hook for this and then write a mips backend that defines it.
Thanks, Roland
On Thu, Mar 22, 2012 at 12:46:15PM -0700, Roland McGrath wrote:
The test run-strip-reloc.sh failed on a mips binary. The stripping works now with the patch.
We like to have consistent tests regardless of host (as well as the tests that use the native-built binaries). So what I was suggesting was a new test with precise stored binaries.
I can provide you binaries for all arches in Debian if you want, if you tell me which source to build, and how you want it build.
The next problem I see is that eu-readelf -w doesn't actually show the contents of the debug sections, either on the non-stripped or debug only file.
Well, we don't actually have a mips backend, so various problems are to be expected until that porting work gets done. That particular one is due to the SHT_PROGBITS check in readelf.c:print_debug. Since SHT_MIPS_DWARF is in the SHT_LOPROC..SHT_HIPROC range, it wouldn't be proper to match it generically, so we really do need to add an ebl hook for this and then write a mips backend that defines it.
I have a mips backend already. I have various backends you don't have and I've tried a few times to get some of them applied without much luck.
So if you provide a hook for it, I'm more than happy to implement it on mips.
Kurt
I can provide you binaries for all arches in Debian if you want, if you tell me which source to build, and how you want it build.
All the test cases have been built from trivial sources so that they are clearly public domain and no license issues apply to the binaries we put in the archive. For this issue, any
I have a mips backend already. I have various backends you don't have and I've tried a few times to get some of them applied without much luck.
The barrier in the past has been the unclear policy about copyright ownership for nontrivial additions to elfutils by people who are not Red Hat employees. I'm no longer a Red Hat employee myself, but I haven't contributed much new since that's been the case. Perhaps Mark can take up the subject with his management and finally get a policy. I imagine it will be something like that contributors need to agree to the Fedora CLA, but that's only a guess.
So if you provide a hook for it, I'm more than happy to implement it on mips.
It's pretty straightforward to add new ebl hooks (libebl/ebl-hooks.h, and a default implementation in libebl/eblopenbackend.c). We can discuss the details here.
It may make sense just to extend the existing debugscn_p hook to look at the shdr as well, rather than adding a separate hook.
Thanks, Roland
On Thu, Mar 22, 2012 at 01:15:22PM -0700, Roland McGrath wrote:
The barrier in the past has been the unclear policy about copyright ownership for nontrivial additions to elfutils by people who are not Red Hat employees. I'm no longer a Red Hat employee myself, but I haven't contributed much new since that's been the case. Perhaps Mark can take up the subject with his management and finally get a policy. I imagine it will be something like that contributors need to agree to the Fedora CLA, but that's only a guess.
Yes, something like that was the idea. I did contact legal in the past to clear things up, but like all things involving legal if you don't keep pushing... I'll ping again and make sure to get a real actionable answer this time.
Cheers,
Mark
On Thu, Mar 22, 2012 at 10:18:53PM +0100, Mark Wielaard wrote:
On Thu, Mar 22, 2012 at 01:15:22PM -0700, Roland McGrath wrote:
The barrier in the past has been the unclear policy about copyright ownership for nontrivial additions to elfutils by people who are not Red Hat employees. I'm no longer a Red Hat employee myself, but I haven't contributed much new since that's been the case. Perhaps Mark can take up the subject with his management and finally get a policy. I imagine it will be something like that contributors need to agree to the Fedora CLA, but that's only a guess.
Yes, something like that was the idea. I did contact legal in the past to clear things up, but like all things involving legal if you don't keep pushing... I'll ping again and make sure to get a real actionable answer this time.
Any news on this?
Kurt
On Wed, 2012-05-09 at 22:09 +0200, Kurt Roeckx wrote:
Yes, something like that was the idea. I did contact legal in the past to clear things up, but like all things involving legal if you don't keep pushing... I'll ping again and make sure to get a real actionable answer this time.
Any news on this?
Thanks for the ping. Again I got distracted by 1001 other things. Sigh. Sorry. There isn't anything difficult to this as far as I understand, but I still need to get a positive OK from legal. I'll contact them later today to get this resolved.
Apologies for being so slow/distracted,
Mark
On Thu, 2012-03-22 at 13:15 -0700, Roland McGrath wrote:
I can provide you binaries for all arches in Debian if you want, if you tell me which source to build, and how you want it build.
All the test cases have been built from trivial sources so that they are clearly public domain and no license issues apply to the binaries we put in the archive. For this issue, any
... seems Roland forgot to finish that thought :)
If you look in the tests/run-*.sh files some have comments how the testfiles were created. It would be beneficial if you could generate test binaries on some architectures not yet covered using those. Often they are simple hello world style 1 liners (or at least < 5 liners). See for example run-prelink-addr-test.sh, run-strip-reloc.sh, run-strip-groups.sh, run-typeiter.sh. Though maybe those aren't the best examples since they all test something specific (they just came up with embedded source code in my quick scan). But I didn't see any more general test. Maybe we need one?
Cheers,
Mark
On Tue, Mar 27, 2012 at 12:14:16PM +0200, Mark Wielaard wrote:
On Thu, 2012-03-22 at 13:15 -0700, Roland McGrath wrote:
I can provide you binaries for all arches in Debian if you want, if you tell me which source to build, and how you want it build.
All the test cases have been built from trivial sources so that they are clearly public domain and no license issues apply to the binaries we put in the archive. For this issue, any
... seems Roland forgot to finish that thought :)
If you look in the tests/run-*.sh files some have comments how the testfiles were created. It would be beneficial if you could generate test binaries on some architectures not yet covered using those. Often they are simple hello world style 1 liners (or at least < 5 liners). See for example run-prelink-addr-test.sh, run-strip-reloc.sh, run-strip-groups.sh, run-typeiter.sh. Though maybe those aren't the best examples since they all test something specific (they just came up with embedded source code in my quick scan). But I didn't see any more general test. Maybe we need one?
What I would find useful is one that tests the various return value locations, and that covers the different psABIs. I have an example file that's at least a good start.
Anyway, I can provide binaries for at least the following Debian arches: - amd64 (x86_64) - armel - armhf - hurd-i386 - i386 - ia64 - kfreebsd-amd64 - kfreebsd-i386 - mips - mipsel - powerpc - s390 - s390x - sparc - sparc64
And probably for some of those too: - arm - alpha - hppa - m68k - powerpcspe - ppc64 - sh4
It's just a matter of collecting the sources files, and how you want it compiled.
Kurt
On Thu, Mar 22, 2012 at 01:15:22PM -0700, Roland McGrath wrote:
It's pretty straightforward to add new ebl hooks (libebl/ebl-hooks.h, and a default implementation in libebl/eblopenbackend.c). We can discuss the details here.
It may make sense just to extend the existing debugscn_p hook to look at the shdr as well, rather than adding a separate hook.
So I've tried to do that, but then ran into problems with ldscript.[yc]. It doesn't seem to be using anything of the libraries.
So I've changed the prototype to use (const char *name, const GElf_Shdr *shdr). Do you think it makes sense that I pass a NULL as shdr in that case and only check the name in case it's NULL?
Kurt
Signed-off-by: Kurt Roeckx kurt@roeckx.be --- libebl/ChangeLog | 4 ++++ libebl/eblopenbackend.c | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/libebl/ChangeLog b/libebl/ChangeLog index 941ed6f..49c8540 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -1,3 +1,7 @@ +2012-08-12 Kurt Roeckx kurt@roeckx.be + + * eblopenbackend.c (default_debugscn_p): Support compressed section + 2011-06-26 Mark Wielaard mjw@redhat.com
* eblopenbackend.c (default_debugscn_p): Add .debug_macro. diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c index b39ab2e..251d7cc 100644 --- a/libebl/eblopenbackend.c +++ b/libebl/eblopenbackend.c @@ -657,7 +657,13 @@ default_debugscn_p (const char *name) const size_t ndwarf_scn_names = (sizeof (dwarf_scn_names) / sizeof (dwarf_scn_names[0])); for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt) - if (strcmp (name, dwarf_scn_names[cnt]) == 0) + if (strcmp (name, dwarf_scn_names[cnt]) == 0 +#if USE_ZLIB + || (name[0] == '.' && name[1] == 'z' + && dwarf_scn_names[cnt][1] == 'd' + && strcmp (&name[2], &dwarf_scn_names[cnt][1]) == 0) +#endif + ) return true;
return false;
Signed-off-by: Kurt Roeckx kurt@roeckx.be --- src/readelf.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/readelf.c b/src/readelf.c index 36724a7..cba5717 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -7786,8 +7786,9 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr) { GElf_Shdr shdr_mem; GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); + const char *name = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
- if (shdr != NULL && shdr->sh_type == SHT_PROGBITS) + if (ebl_debugscn_p(ebl, name) && shdr != NULL && shdr->sh_type == SHT_PROGBITS) { static const struct { @@ -7821,8 +7822,6 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr) }; const int ndebug_sections = (sizeof (debug_sections) / sizeof (debug_sections[0])); - const char *name = elf_strptr (ebl->elf, shstrndx, - shdr->sh_name); int n;
for (n = 0; n < ndebug_sections; ++n)
On Sun, Aug 12, 2012 at 06:29:00PM +0200, Kurt Roeckx wrote:
const char *name = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
if (ebl_debugscn_p(ebl, name) && shdr != NULL && shdr->sh_type == SHT_PROGBITS)
You will have to check name != NULL since ebl_debugscn_p will just crash when given NULL as name argument.
Cheers,
Mark
Pass NULL to only check the name.
Signed-off-by: Kurt Roeckx kurt@roeckx.be --- backends/ChangeLog | 5 +++++ backends/i386_symbol.c | 8 ++++---- backends/libebl_CPU.h | 2 +- libdwfl/ChangeLog | 4 ++++ libdwfl/relocate.c | 2 +- libebl/ChangeLog | 6 ++++++ libebl/ebl-hooks.h | 4 ++-- libebl/ebldebugscnp.c | 8 +++----- libebl/eblopenbackend.c | 4 ++-- libebl/eblsectionstripp.c | 4 ++-- libebl/libebl.h | 4 ++-- src/ChangeLog | 7 +++++++ src/ldgeneric.c | 5 +++-- src/ldscript.y | 4 ++-- src/readelf.c | 2 +- src/strip.c | 4 ++-- 16 files changed, 47 insertions(+), 26 deletions(-)
diff --git a/backends/ChangeLog b/backends/ChangeLog index 744d1d5..dee3540 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,8 @@ +2012-08-12 Kurt Roeckx kurt@roeckx.be + + * libebl_CPU.h (generic_debugscn_p): Add shdr param + * i386_symbol.c (i386_debugscn_p): Add shdr param + 2011-03-09 Mark Wielaard mjw@redhat.com
* alpha_init.c (alpha_init): Initialize check_st_other_bits hook. diff --git a/backends/i386_symbol.c b/backends/i386_symbol.c index 7dbf899..521325a 100644 --- a/backends/i386_symbol.c +++ b/backends/i386_symbol.c @@ -64,12 +64,12 @@ i386_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type) } }
-/* Check section name for being that of a debug information section. */ -bool (*generic_debugscn_p) (const char *); +/* Check section for being a debug information section. */ +bool (*generic_debugscn_p) (const char *, const GElf_Shdr *); bool -i386_debugscn_p (const char *name) +i386_debugscn_p (const char *name, const GElf_Shdr *shdr) { - return (generic_debugscn_p (name) + return (generic_debugscn_p (name, shdr) || strcmp (name, ".stab") == 0 || strcmp (name, ".stabstr") == 0); } diff --git a/backends/libebl_CPU.h b/backends/libebl_CPU.h index 36b3a4a..f887d4d 100644 --- a/backends/libebl_CPU.h +++ b/backends/libebl_CPU.h @@ -43,7 +43,7 @@ extern const char *EBLHOOK(init) (Elf *elf, GElf_Half machine,
#define HOOK(eh, name) eh->name = EBLHOOK(name)
-extern bool (*generic_debugscn_p) (const char *) attribute_hidden; +extern bool (*generic_debugscn_p) (const char *, const GElf_Shdr *shdr) attribute_hidden;
#endif /* libebl_CPU.h */ diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 36db7a3..3b64552 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,7 @@ +2012-08-12 Kurt Roeckx kurt@roeckx.be + + * relocate.c (relocate_section): Update to call ebl_debugscn_p with shdr + 2012-08-01 Petr Machata pmachata@redhat.com
* offline.c (process_archive_member): Ignore entry "/SYM64/". diff --git a/libdwfl/relocate.c b/libdwfl/relocate.c index 2c24bd5..35ae8ab 100644 --- a/libdwfl/relocate.c +++ b/libdwfl/relocate.c @@ -288,7 +288,7 @@ relocate_section (Dwfl_Module *mod, Elf *relocated, const GElf_Ehdr *ehdr, /* No contents to relocate. */ return DWFL_E_NOERROR;
- if (debugscn && ! ebl_debugscn_p (mod->ebl, tname)) + if (debugscn && ! ebl_debugscn_p (mod->ebl, tname, tshdr)) /* This relocation section is not for a debugging section. Nothing to do here. */ return DWFL_E_NOERROR; diff --git a/libebl/ChangeLog b/libebl/ChangeLog index 49c8540..3851a0a 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -1,6 +1,12 @@ 2012-08-12 Kurt Roeckx kurt@roeckx.be
* eblopenbackend.c (default_debugscn_p): Support compressed section + * ebl-hooks.h (debugscn_p): Add shdr as parameter + * libebl.h (ebl_debugscn_p): Add shdr as parameter + * ebldebugscnp.c (ebl_debugscn_p): Pass extra shdr parameter + * eblopenbackend.c (default_debugscn_p): Add shdr as parameter + * eblsectionstripp.c (ebl_section_strip_p): Call ebl_debugscn_p with + shdr param
2011-06-26 Mark Wielaard mjw@redhat.com
diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h index f629bce..84ffbd2 100644 --- a/libebl/ebl-hooks.h +++ b/libebl/ebl-hooks.h @@ -108,8 +108,8 @@ bool EBLHOOK(check_object_attribute) (Ebl *, const char *, int, uint64_t, /* Describe auxv element type. */ int EBLHOOK(auxv_info) (GElf_Xword, const char **, const char **);
-/* Check section name for being that of a debug informatino section. */ -bool EBLHOOK(debugscn_p) (const char *); +/* Check section for being a debug information section. */ +bool EBLHOOK(debugscn_p) (const char *, const GElf_Shdr *shdr);
/* Check whether given relocation is a copy relocation. */ bool EBLHOOK(copy_reloc_p) (int); diff --git a/libebl/ebldebugscnp.c b/libebl/ebldebugscnp.c index f2351e2..87b5b8d 100644 --- a/libebl/ebldebugscnp.c +++ b/libebl/ebldebugscnp.c @@ -1,4 +1,4 @@ -/* Check section name for being that of a debug informatino section. +/* Check section for being a debug information section. Copyright (C) 2002 Red Hat, Inc. This file is part of elfutils. Written by Ulrich Drepper drepper@redhat.com, 2002. @@ -36,9 +36,7 @@
bool -ebl_debugscn_p (ebl, name) - Ebl *ebl; - const char *name; +ebl_debugscn_p (Ebl *ebl, const char *name, const GElf_Shdr *shdr) { - return ebl->debugscn_p (name); + return ebl->debugscn_p (name, shdr); } diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c index 251d7cc..86c00b5 100644 --- a/libebl/eblopenbackend.c +++ b/libebl/eblopenbackend.c @@ -173,7 +173,7 @@ static int default_auxv_info (GElf_Xword a_type, const char **name, const char **format); static bool default_object_note (const char *name, uint32_t type, uint32_t descsz, const char *desc); -static bool default_debugscn_p (const char *name); +static bool default_debugscn_p (const char *name, const GElf_Shdr *shdr); static bool default_copy_reloc_p (int reloc); static bool default_none_reloc_p (int reloc); static bool default_relative_reloc_p (int reloc); @@ -616,7 +616,7 @@ default_object_note (const char *name __attribute__ ((unused)), }
static bool -default_debugscn_p (const char *name) +default_debugscn_p (const char *name, const GElf_Shdr *shdr) { /* We know by default only about the DWARF debug sections which have fixed names. */ diff --git a/libebl/eblsectionstripp.c b/libebl/eblsectionstripp.c index 9497068..15d0cb0 100644 --- a/libebl/eblsectionstripp.c +++ b/libebl/eblsectionstripp.c @@ -43,7 +43,7 @@ ebl_section_strip_p (Ebl *ebl, const GElf_Ehdr *ehdr, const GElf_Shdr *shdr, is unfortunately no other way. */ if (unlikely (only_remove_debug)) { - if (ebl_debugscn_p (ebl, name)) + if (ebl_debugscn_p (ebl, name, shdr)) return true;
if (shdr->sh_type == SHT_RELA || shdr->sh_type == SHT_REL) @@ -55,7 +55,7 @@ ebl_section_strip_p (Ebl *ebl, const GElf_Ehdr *ehdr, const GElf_Shdr *shdr, { const char *s_l = elf_strptr (ebl->elf, ehdr->e_shstrndx, shdr_l->sh_name); - if (s_l != NULL && ebl_debugscn_p (ebl, s_l)) + if (s_l != NULL && ebl_debugscn_p (ebl, s_l, shdr)) return true; } } diff --git a/libebl/libebl.h b/libebl/libebl.h index 0d5621d..25aab77 100644 --- a/libebl/libebl.h +++ b/libebl/libebl.h @@ -180,8 +180,8 @@ extern bool ebl_check_object_attribute (Ebl *ebl, const char *vendor, const char **value_name);
-/* Check section name for being that of a debug informatino section. */ -extern bool ebl_debugscn_p (Ebl *ebl, const char *name); +/* Check section for being a debug information section. */ +extern bool ebl_debugscn_p (Ebl *ebl, const char *name, const GElf_Shdr *shdr);
/* Check whether given relocation is a copy relocation. */ extern bool ebl_copy_reloc_p (Ebl *ebl, int reloc); diff --git a/src/ChangeLog b/src/ChangeLog index 294e31b..e9c4b65 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-08-12 Kurt Roeckx kurt@roeckx.be + + * ldgeneric.c (mark_section_group): Pass shdr to ebl_debugscn_p() + * ldscript.y: Pass shdr to ebl_debugscn_p() + * strip.c (handle_elf) Pass shdr to ebl_debugscn_p() + * readelf.c (print_debug): Pass shdr to ebl_debugscn_p() + 2012-06-27 Mark Wielaard mjw@redhat.com
* readelf.c (dwarf_form_string): Handle DW_FORM_GNU_ref_alt and diff --git a/src/ldgeneric.c b/src/ldgeneric.c index 1b5d0f9..16bb838 100644 --- a/src/ldgeneric.c +++ b/src/ldgeneric.c @@ -881,13 +881,14 @@ mark_section_group (struct usedfiles *fileinfo, Elf32_Word shndx, /* If we are stripping, remove debug sections. */ || (!ebl_debugscn_p (ld_state.ebl, elf_strptr (fileinfo->elf, fileinfo->shstrndx, - shdr->sh_name)) + shdr->sh_name), shdr) /* And the relocation sections for the debug sections. */ && ((shdr->sh_type != SHT_RELA && shdr->sh_type != SHT_REL) || !ebl_debugscn_p (ld_state.ebl, elf_strptr (fileinfo->elf, fileinfo->shstrndx, - SCNINFO_SHDR (fileinfo->scninfo[shdr->sh_info].shdr).sh_name))))) + SCNINFO_SHDR (fileinfo->scninfo[shdr->sh_info].shdr).sh_name), + &SCNINFO_SHDR (fileinfo->scninfo[shdr->sh_info].shdr))))) { struct scninfo *ignore;
diff --git a/src/ldscript.y b/src/ldscript.y index ec58e21..247dd16 100644 --- a/src/ldscript.y +++ b/src/ldscript.y @@ -212,7 +212,7 @@ outputsection: assignment ';' $$->val.section.name = $1; $$->val.section.input = $3->next; if (ld_state.strip == strip_debug - && ebl_debugscn_p (ld_state.ebl, $1)) + && ebl_debugscn_p (ld_state.ebl, $1, NULL)) $$->val.section.ignored = true; else $$->val.section.ignored = false; @@ -235,7 +235,7 @@ outputsection: assignment ';' new_input_section_name ($1, false); $$->val.section.input->val.section->keep_flag = false; if (ld_state.strip == strip_debug - && ebl_debugscn_p (ld_state.ebl, $1)) + && ebl_debugscn_p (ld_state.ebl, $1, NULL)) $$->val.section.ignored = true; else $$->val.section.ignored = false; diff --git a/src/readelf.c b/src/readelf.c index cba5717..d16fb3f 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -7788,7 +7788,7 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr) GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); const char *name = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
- if (ebl_debugscn_p(ebl, name) && shdr != NULL && shdr->sh_type == SHT_PROGBITS) + if (ebl_debugscn_p(ebl, name, shdr) && shdr != NULL && shdr->sh_type == SHT_PROGBITS) { static const struct { diff --git a/src/strip.c b/src/strip.c index 5e9c883..cf01031 100644 --- a/src/strip.c +++ b/src/strip.c @@ -1648,7 +1648,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname,
const char *tname = elf_strptr (debugelf, shstrndx, tshdr->sh_name); - if (! tname || ! ebl_debugscn_p (ebl, tname)) + if (! tname || ! ebl_debugscn_p (ebl, tname, tshdr)) continue;
/* OK, lets relocate all trivial cross debug section @@ -1698,7 +1698,7 @@ handle_elf (int fd, Elf *elf, const char *prefix, const char *fname, &xndx); Elf32_Word sec = (sym->st_shndx == SHN_XINDEX ? xndx : sym->st_shndx); - if (ebl_debugscn_p (ebl, shdr_info[sec].name)) + if (ebl_debugscn_p (ebl, shdr_info[sec].name, &shdr_info[sec].shdr)) { size_t size;
I'd put the SHDR parameter first. That's more consistent with how we've chosen the signatures of other hooks.
I'm inclined toward the suggestion I just made in another message, to make a NULL value for NAME valid by updating the existing implementations. In that case, the strip.c change:
- if (! tname || ! ebl_debugscn_p (ebl, tname)) + if (! tname || ! ebl_debugscn_p (ebl, tname, tshdr))
should be:
- if (! tname || ! ebl_debugscn_p (ebl, tname)) + if (! ebl_debugscn_p (ebl, tshdr, tname))
so it's up to the backend hook how to respond when the name isn't available. (Not that this scenario really matters, as it indicates a bogus ELF file.)
There are some style issues with your ChangeLog entries and some lines you've made too long (all lines should be < 80 columns). Mark can help you get all those nits right. (I'll be on vacation after today.)
Thanks, Roland
Signed-off-by: Kurt Roeckx kurt@roeckx.be --- backends/ChangeLog | 1 + backends/i386_symbol.c | 2 ++ libebl/ChangeLog | 1 + libebl/eblopenbackend.c | 2 ++ src/ChangeLog | 1 + src/readelf.c | 2 +- 6 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/backends/ChangeLog b/backends/ChangeLog index dee3540..03da036 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -2,6 +2,7 @@
* libebl_CPU.h (generic_debugscn_p): Add shdr param * i386_symbol.c (i386_debugscn_p): Add shdr param + * i386_symbol.c (i386_debugscn_p): Check the shdr param
2011-03-09 Mark Wielaard mjw@redhat.com
diff --git a/backends/i386_symbol.c b/backends/i386_symbol.c index 521325a..5b4d710 100644 --- a/backends/i386_symbol.c +++ b/backends/i386_symbol.c @@ -69,6 +69,8 @@ bool (*generic_debugscn_p) (const char *, const GElf_Shdr *); bool i386_debugscn_p (const char *name, const GElf_Shdr *shdr) { + if (shdr && shdr->sh_type != SHT_PROGBITS) + return false; return (generic_debugscn_p (name, shdr) || strcmp (name, ".stab") == 0 || strcmp (name, ".stabstr") == 0); diff --git a/libebl/ChangeLog b/libebl/ChangeLog index 3851a0a..799ddc0 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -7,6 +7,7 @@ * eblopenbackend.c (default_debugscn_p): Add shdr as parameter * eblsectionstripp.c (ebl_section_strip_p): Call ebl_debugscn_p with shdr param + * blopenbackend.c (default_debugscn_p): Check the shdr param
2011-06-26 Mark Wielaard mjw@redhat.com
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c index 86c00b5..2e74970 100644 --- a/libebl/eblopenbackend.c +++ b/libebl/eblopenbackend.c @@ -656,6 +656,8 @@ default_debugscn_p (const char *name, const GElf_Shdr *shdr) }; const size_t ndwarf_scn_names = (sizeof (dwarf_scn_names) / sizeof (dwarf_scn_names[0])); + if (shdr && shdr->sh_type != SHT_PROGBITS) + return false; for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt) if (strcmp (name, dwarf_scn_names[cnt]) == 0 #if USE_ZLIB diff --git a/src/ChangeLog b/src/ChangeLog index e9c4b65..657dac7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -4,6 +4,7 @@ * ldscript.y: Pass shdr to ebl_debugscn_p() * strip.c (handle_elf) Pass shdr to ebl_debugscn_p() * readelf.c (print_debug): Pass shdr to ebl_debugscn_p() + * print_debug (print_debug): Don't check shdr anymore
2012-06-27 Mark Wielaard mjw@redhat.com
diff --git a/src/readelf.c b/src/readelf.c index d16fb3f..7db57a2 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -7788,7 +7788,7 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr) GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); const char *name = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
- if (ebl_debugscn_p(ebl, name, shdr) && shdr != NULL && shdr->sh_type == SHT_PROGBITS) + if (ebl_debugscn_p(ebl, name, shdr)) { static const struct {
This change is probably reasonable (modulo style issues). I'm ambivalent.
On Sun, Aug 12, 2012 at 06:28:59PM +0200, Kurt Roeckx wrote:
@@ -657,7 +657,13 @@ default_debugscn_p (const char *name) const size_t ndwarf_scn_names = (sizeof (dwarf_scn_names) / sizeof (dwarf_scn_names[0])); for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt)
- if (strcmp (name, dwarf_scn_names[cnt]) == 0)
- if (strcmp (name, dwarf_scn_names[cnt]) == 0
+#if USE_ZLIB
- || (name[0] == '.' && name[1] == 'z'
&& dwarf_scn_names[cnt][1] == 'd'
&& strcmp (&name[2], &dwarf_scn_names[cnt][1]) == 0)
+#endif
I don't think it is necessary to depend on USE_ZLIB here, we are just checking the name, not the content anyway.
I am a little worried this might now return true for cases that the caller might not be prepared to handle. If the Elf was opened through libdwfl the section would be automagically decompressed, but See for example strip, which might try to read the data "raw" when --reloc-debug-sections is given.
So this might be a good time to audit all callers and make sure they won't choke on finding compressed data in the elf section.
Cheers,
Mark
On Mon, Aug 13, 2012 at 01:36:10PM +0200, Mark Wielaard wrote:
On Sun, Aug 12, 2012 at 06:28:59PM +0200, Kurt Roeckx wrote:
@@ -657,7 +657,13 @@ default_debugscn_p (const char *name) const size_t ndwarf_scn_names = (sizeof (dwarf_scn_names) / sizeof (dwarf_scn_names[0])); for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt)
- if (strcmp (name, dwarf_scn_names[cnt]) == 0)
- if (strcmp (name, dwarf_scn_names[cnt]) == 0
+#if USE_ZLIB
- || (name[0] == '.' && name[1] == 'z'
&& dwarf_scn_names[cnt][1] == 'd'
&& strcmp (&name[2], &dwarf_scn_names[cnt][1]) == 0)
+#endif
I don't think it is necessary to depend on USE_ZLIB here, we are just checking the name, not the content anyway.
I did that based on the same #if in readelf.c
Kurt
On Mon, Aug 13, 2012 at 06:22:29PM +0200, Kurt Roeckx wrote:
On Mon, Aug 13, 2012 at 01:36:10PM +0200, Mark Wielaard wrote:
On Sun, Aug 12, 2012 at 06:28:59PM +0200, Kurt Roeckx wrote:
@@ -657,7 +657,13 @@ default_debugscn_p (const char *name) const size_t ndwarf_scn_names = (sizeof (dwarf_scn_names) / sizeof (dwarf_scn_names[0])); for (size_t cnt = 0; cnt < ndwarf_scn_names; ++cnt)
- if (strcmp (name, dwarf_scn_names[cnt]) == 0)
- if (strcmp (name, dwarf_scn_names[cnt]) == 0
+#if USE_ZLIB
- || (name[0] == '.' && name[1] == 'z'
&& dwarf_scn_names[cnt][1] == 'd'
&& strcmp (&name[2], &dwarf_scn_names[cnt][1]) == 0)
+#endif
I don't think it is necessary to depend on USE_ZLIB here, we are just checking the name, not the content anyway.
I did that based on the same #if in readelf.c
aha, I missed that, sorry. But this comes back to my comment on the other patch. In the case of readelf.c this makes sense, since it uses libdwfl to access the elf data it can "transparently" read the compressed data. But other callers might not be able to process compressed sections. So I think we should carefully audit all callers to make sure that if debugscn_p () returns true for a compressed section then they are actually able to process the data.
Thanks,
Mark
On Mon, 2012-08-13 at 21:01 +0200, Mark Wielaard wrote:
But this comes back to my comment on the other patch. In the case of readelf.c this makes sense, since it uses libdwfl to access the elf data it can "transparently" read the compressed data. But other callers might not be able to process compressed sections. So I think we should carefully audit all callers to make sure that if debugscn_p () returns true for a compressed section then they are actually able to process the data.
So a quick scan of uses of ebl_debugscn_p, ebl_section_strip_p and SECTION_STRIP_P:
- libdwfl/relocate.c (relocate_section) Uses elf_rawdata () so won't be able to handle the section. - src/elfcmp.c seems fine, just checks both files have the same stripped out sections. - src/strip.c ebl_section_strip_p usage looks fine since it doesn't interpret the section data, but a testcase would be nice. But ebl_debugscn_p is used to see if --reloc-debug-sections makes sense, and it won't be able to handle zdebug sections. - libelf/elf32_checksum.c: Seems fine since it just uses the raw data to calculate the checksum. O, and it seems SECTION_STRIP_P doesn't actually depend on ebl_debugscn_p anymore, despite the /* The SECTION_STRIP_P macro wants to call into libebl which we cannot do and do not have to do here. Provide a dummy replacement. */ #define ebl_debugscn_p(ebl, name) true We should probably remove that then while we are at it. - src/ldgeneric.c and src/ldscript.y might be fine, but I don't really know this code. - src/readelf.c doesn't use it yet, but this patch will introduce it. Should be fine since all section data is accessed through libdw which would have uncompressed it.
Cheers,
Mark
On Tue, 2012-08-14 at 16:18 +0200, Mark Wielaard wrote:
- libelf/elf32_checksum.c: Seems fine since it just uses the raw data to calculate the checksum. O, and it seems SECTION_STRIP_P doesn't actually depend on ebl_debugscn_p anymore, despite the /* The SECTION_STRIP_P macro wants to call into libebl which we cannot do and do not have to do here. Provide a dummy replacement. */ #define ebl_debugscn_p(ebl, name) true We should probably remove that then while we are at it.
Double checked and done.
commit 2105022c82697f6879ead5c8eee24d8fedac65b2 Author: Mark Wielaard mjw@redhat.com Date: Tue Aug 14 16:48:50 2012 +0200
elf32_checksum.c: Removed unused ebl_debugscn_p define and confusing comment.
Signed-off-by: Mark Wielaard mjw@redhat.com
diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 18ada85..5ac70f5 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,3 +1,8 @@ +2012-08-14 Mark Wielaard mjw@redhat.com + + * elf32_checksum.c (ebl_debugscn_p): Removed unused define and + confusing outdated comment. + 2012-08-01 Petr Machata pmachata@redhat.com
* elf_getarsym (read_number_entries): New function. diff --git a/libelf/elf32_checksum.c b/libelf/elf32_checksum.c index 7c53b17..4c59856 100644 --- a/libelf/elf32_checksum.c +++ b/libelf/elf32_checksum.c @@ -46,11 +46,6 @@ #endif
-/* The SECTION_STRIP_P macro wants to call into libebl which we cannot - do and do not have to do here. Provide a dummy replacement. */ -#define ebl_debugscn_p(ebl, name) true - - #define process_block(crc, data) \ __libelf_crc32 (crc, data->d_buf, data->d_size)
On Tue, Aug 14, 2012 at 04:18:58PM +0200, Mark Wielaard wrote:
On Mon, 2012-08-13 at 21:01 +0200, Mark Wielaard wrote:
But this comes back to my comment on the other patch. In the case of readelf.c this makes sense, since it uses libdwfl to access the elf data it can "transparently" read the compressed data. But other callers might not be able to process compressed sections. So I think we should carefully audit all callers to make sure that if debugscn_p () returns true for a compressed section then they are actually able to process the data.
So a quick scan of uses of ebl_debugscn_p, ebl_section_strip_p and SECTION_STRIP_P:
- libdwfl/relocate.c (relocate_section) Uses elf_rawdata () so won't be able to handle the section.
I assume that this is not a new problem, just something it didn't handle before either?
What would need to happen in this case?
Kurt
On Wed, 2012-08-15 at 00:54 +0200, Kurt Roeckx wrote:
On Tue, Aug 14, 2012 at 04:18:58PM +0200, Mark Wielaard wrote:
On Mon, 2012-08-13 at 21:01 +0200, Mark Wielaard wrote:
But this comes back to my comment on the other patch. In the case of readelf.c this makes sense, since it uses libdwfl to access the elf data it can "transparently" read the compressed data. But other callers might not be able to process compressed sections. So I think we should carefully audit all callers to make sure that if debugscn_p () returns true for a compressed section then they are actually able to process the data.
So a quick scan of uses of ebl_debugscn_p, ebl_section_strip_p and SECTION_STRIP_P:
- libdwfl/relocate.c (relocate_section) Uses elf_rawdata () so won't be able to handle the section.
I assume that this is not a new problem, just something it didn't handle before either?
Yes, but it wouldn't even try for compressed sections before, because ebl_debugscn_p would not return true for them.
What would need to happen in this case?
In this case I think the easiest would be to ignore these sections for now like before. I made the list just to see where there are behavioral changes that we need to look at if we change this test. Testcases that trigger the change would be good so we can decide what to do (if anything).
There is a bug open against handling compressed debug sections more generically: https://bugzilla.redhat.com/show_bug.cgi?id=807053
Cheers,
Mark
This is completely orthogonal to your MIPS-related changes, isn't it? I think Mark is on top of the issues about fixing this issue. But it seems to me it could wait and be considered independent of your MIPS-enabling work. Since we're not going to have thorough support for .zdebug_* sections in this release cycle, I'd be inclined to just leave this area alone for now.
Thanks, Roland
On Thu, Aug 23, 2012 at 04:52:58PM -0700, Roland McGrath wrote:
This is completely orthogonal to your MIPS-related changes, isn't it? I think Mark is on top of the issues about fixing this issue. But it
The reason I did this is because readelf.c does the same thing, and I think I would cause a regression there if I didn't.
Kurt
On Thu, Aug 23, 2012 at 04:52:58PM -0700, Roland McGrath wrote:
This is completely orthogonal to your MIPS-related changes, isn't it? I think Mark is on top of the issues about fixing this issue. But it
The reason I did this is because readelf.c does the same thing, and I think I would cause a regression there if I didn't.
I see your point. I think the upshot of Mark's analysis is that it's not meaningfully risky to do this change. The one caller that doesn't handle it well is already pretty scrod when faced with any .zdebug_* sections. So unless Mark objects, I think this is fine (I don't think it matters much one way or the other to put it in #if USE_ZLIB).
Thanks, Roland
So I've tried to do that, but then ran into problems with ldscript.[yc]. It doesn't seem to be using anything of the libraries.
That's part of the linker implementation, which is utterly incomplete, never tested and never used (and probably it will never be finished). So while it's always good not to regress anything, it doesn't really matter much here.
So I've changed the prototype to use (const char *name, const GElf_Shdr *shdr). Do you think it makes sense that I pass a NULL as shdr in that case and only check the name in case it's NULL?
The ldscript.y uses are considering a section name rather than a section that actually exists anywhere. So it makes sense for them to pass NULL for the shdr argument and for the function to ignore the shdr when it's NULL. Probably the best way to write the MIPS backend implementation is:
bool mips_debugscn_p (const GElf_Shdr *shdr, const char *name) { if (shdr != NULL && shdr->sh_type == SHT_MIPS_DWARF) return true; return (*generic_debugscn_p) (shdr, name); }
(See i386_{symbol,init}.c for setting up generic_debugscn_p.) That ensures a correct result when we're using this to override readelf's SHT_PROGBITS check, but doesn't defeat the name-based logic, in case some tools use the canonical sh_type even on MIPS.
I think the change that makes sense in readelf is just this:
--- a/src/readelf.c +++ b/src/readelf.c @@ -7273,7 +7273,10 @@ print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr) GElf_Shdr shdr_mem; GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
- if (shdr != NULL && shdr->sh_type == SHT_PROGBITS) + if (shdr != NULL + && (shdr->sh_type == SHT_PROGBITS + || ebl_debugscn_p (ebl, shdr, elf_strptr (ebl->elf, shstrndx, + shdr->sh_name)))) { static const struct {
That is, use the hook to override the SHT_PROGBITS check, but don't change any of the rest of the name-based logic.
Alternatively, we could just pass NULL for the name here and change the existing debugscn_p implementations so they just return false when given NULL for name. Then this call is really just serving as the override for the SHT_PROGBITS check with no other logic.
Thanks, Roland
On Thu, Aug 23, 2012 at 04:42:16PM -0700, Roland McGrath wrote:
Probably the best way to write the MIPS backend implementation is:
bool mips_debugscn_p (const GElf_Shdr *shdr, const char *name) { if (shdr != NULL && shdr->sh_type == SHT_MIPS_DWARF) return true; return (*generic_debugscn_p) (shdr, name); }
Does that mean generic_debugscn shouldn't check the shdr? Because now it would check it and then fail for mips because it's not SHT_PROGBITS.
I guess I'm missing something.
Kurt
On Sun, Aug 26, 2012 at 04:17:36PM +0200, Kurt Roeckx wrote:
On Thu, Aug 23, 2012 at 04:42:16PM -0700, Roland McGrath wrote:
Probably the best way to write the MIPS backend implementation is:
bool mips_debugscn_p (const GElf_Shdr *shdr, const char *name) { if (shdr != NULL && shdr->sh_type == SHT_MIPS_DWARF) return true; return (*generic_debugscn_p) (shdr, name); }
Does that mean generic_debugscn shouldn't check the shdr? Because now it would check it and then fail for mips because it's not SHT_PROGBITS.
I guess I'm missing something.
Can you comment on this?
Do you think it might be better to have a new hook instead, that uses the current one?
Kurt
mips_debugscn_p (const GElf_Shdr *shdr, const char *name) { if (shdr != NULL && shdr->sh_type == SHT_MIPS_DWARF) return true; return (*generic_debugscn_p) (shdr, name); }
Does that mean generic_debugscn shouldn't check the shdr? Because now it would check it and then fail for mips because it's not SHT_PROGBITS.
The code above never calls generic_debugscn if sh_type is SHT_MIPS_DWARF. If the type is neither SHT_MIPS_DWARF nor SHT_PROGBITS, I don't know why we'd want it to return true. I don't understand what case you are concerned about.
Thanks, Roland
On Fri, Sep 14, 2012 at 01:40:59PM -0700, Roland McGrath wrote:
mips_debugscn_p (const GElf_Shdr *shdr, const char *name) { if (shdr != NULL && shdr->sh_type == SHT_MIPS_DWARF) return true; return (*generic_debugscn_p) (shdr, name); }
Does that mean generic_debugscn shouldn't check the shdr? Because now it would check it and then fail for mips because it's not SHT_PROGBITS.
The code above never calls generic_debugscn if sh_type is SHT_MIPS_DWARF. If the type is neither SHT_MIPS_DWARF nor SHT_PROGBITS, I don't know why we'd want it to return true. I don't understand what case you are concerned about.
Re-reading the code I don't understand either.
Kurt
On Wed, Mar 21, 2012 at 09:32:16AM -0700, Roland McGrath wrote:
I don't see any reason to treat nonstandard section types specially at all. The norm is to strip non-allocated sections. We have special exceptions for SHT_NOTE and a few named SHT_PROGBITS sections that particularly should not be stripped. If there are any nonstandard types that should not be stripped, then we can add special cases for those.
Unless anyone can cite a good reason not to, I'll just remove the < SHT_NUM check entirely.
This change http://git.fedorahosted.org/cgit/elfutils.git/commit/?id=8e8f0be57354d3fa094... resulted to a regression on ARM because it now strips sections of type SHT_ARM_ATTRIBUTES, like this one:
$ readelf -A /bin/sh Attribute Section: aeabi File Attributes Tag_CPU_name: "7-A" Tag_CPU_arch: v7 Tag_CPU_arch_profile: Application Tag_ARM_ISA_use: Yes Tag_THUMB_ISA_use: Thumb-2 Tag_FP_arch: VFPv3-D16 Tag_ABI_PCS_wchar_t: 4 Tag_ABI_FP_denormal: Needed Tag_ABI_FP_exceptions: Needed Tag_ABI_FP_number_model: IEEE 754 Tag_ABI_align_needed: 8-byte Tag_ABI_enum_size: int Tag_ABI_HardFP_use: SP and DP Tag_ABI_VFP_args: VFP registers
SHT_ARM_ATTRIBUTES is defined as SHT_LOPROC + 3. As a quick fix I've just reverted that commit locally, but I'm not familiar with the code to propose an acceptable fix.
Why do you think that stripping SHT_ARM_ATTRIBUTES sections is wrong? They are only used for linking and for debugging.
On Wed, Oct 17, 2012 at 11:24:33AM -0700, Roland McGrath wrote:
Why do you think that stripping SHT_ARM_ATTRIBUTES sections is wrong? They are only used for linking and for debugging.
Yes, because they are used for linking, and there seems to be no such thing as linkinfo yet (like debuginfo but for linking).
On Wed, Oct 17, 2012 at 11:24:33AM -0700, Roland McGrath wrote:
Why do you think that stripping SHT_ARM_ATTRIBUTES sections is wrong? They are only used for linking and for debugging.
Yes, because they are used for linking, and there seems to be no such thing as linkinfo yet (like debuginfo but for linking).
strip also removes the symbol table, so linking is impossible. Give an example of something that you were doing before that worked and now is broken.
On Wed, Oct 17, 2012 at 11:50:30AM -0700, Roland McGrath wrote:
On Wed, Oct 17, 2012 at 11:24:33AM -0700, Roland McGrath wrote:
Why do you think that stripping SHT_ARM_ATTRIBUTES sections is wrong? They are only used for linking and for debugging.
Yes, because they are used for linking, and there seems to be no such thing as linkinfo yet (like debuginfo but for linking).
strip also removes the symbol table, so linking is impossible. Give an example of something that you were doing before that worked and now is broken.
I've rechecked, linking seems to work as before, and absence of SHT_ARM_ATTRIBUTES doesn't seem to affect it. All the rest is not important, so there is no regression. Sorry for the noise.
elfutils-devel@lists.fedorahosted.org