This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Better default for elf_backend_section_from_shdr
- From: Zack Weinberg <zack at codesourcery dot com>
- To: binutils at sources dot redhat dot com
- Date: Tue, 01 Mar 2005 14:41:48 -0800
- Subject: Better default for elf_backend_section_from_shdr
Currently elfxx-target.h defaults elf_backend_section_from_shdr to 0.
This means that if a third-party toolchain (or a toolchain configured
for a different ELF architecture) produces sections with types that
the generic code doesn't know about, the reader won't create entries
for them in the elf_elfsections array. And if other sections refer to
those sections (e.g. via relocations) tools such as objdump and nm
will reject the file as ill-formed.
It seems to make more sense to set elf_backend_section_from_shdr to
_bfd_elf_make_section_from_shdr. This causes such sections to be
treated as generic, which is usually the right thing at least for
inspection purposes. So I would like to apply the appended patch.
Thoughts? Should this be done for the other
elf_backend_section_from_* hooks too?
zw
* elfxx-target.h: Default elf_backend_section_from_shdr to
_bfd_elf_make_section_from_shdr.
===================================================================
Index: bfd/elfxx-target.h
--- bfd/elfxx-target.h 22 Feb 2005 00:50:04 -0000 1.78
+++ bfd/elfxx-target.h 1 Mar 2005 22:39:53 -0000
@@ -326,7 +326,7 @@
#define elf_backend_section_processing 0
#endif
#ifndef elf_backend_section_from_shdr
-#define elf_backend_section_from_shdr 0
+#define elf_backend_section_from_shdr _bfd_elf_make_section_from_shdr
#endif
#ifndef elf_backend_section_flags
#define elf_backend_section_flags 0