Summary: | objdump -p considers an empty .gnu.version_r invalid | ||
---|---|---|---|
Product: | binutils | Reporter: | Fangrui Song <i> |
Component: | binutils | Assignee: | Alan Modra <amodra> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | herrtimson |
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | 2.40 | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Fangrui Song
2022-09-13 07:18:19 UTC
Is there any point in allowing an empty .gnu.version_r section? The spec (https://sourceware.org/gnu-gabi/program-loading-and-dynamic-linking.txt) doesn't reject it. For a section whose content is a concatenated N items, the ELF spirits typically allows N==0, as otherwise it needs an additional sentence to disallow the case, which is unnecessary. It seems that the reference implementation of Go may generate .gnu.version_r at least in some cases: https://github.com/llvm/llvm-project/issues/57707 OK, so if we have linkers that produce them, I suppose they ought to be allowed. Easily done. The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f9a59eea78428159a9522bd64ec354a872f1dc31 commit f9a59eea78428159a9522bd64ec354a872f1dc31 Author: Alan Modra <amodra@gmail.com> Date: Wed Sep 21 19:34:08 2022 +0930 PR29566, objdump -p considers an empty .gnu.version_r invalid Allow and ignore an empty section. PR 29566 * elf.c (bfd_section_from_shdr): Don't set elf_dynverdef or elf_dynverref for empty sections. (_bfd_elf_slurp_version_tables): Remove now redundant tests. Fixed for 2.40 |