diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2009-03-19 14:42:52 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2009-03-19 14:42:52 +0000 |
commit | 55f25fc330f3b22081bb4748b0f6c2009567512d (patch) | |
tree | 21e040032fe1e769a30cf827e1ddfc6a728c4c6a /binutils/readelf.c | |
parent | 982807ce66548e8260b49fe5ce2f7474231368e9 (diff) | |
download | gdb-55f25fc330f3b22081bb4748b0f6c2009567512d.zip gdb-55f25fc330f3b22081bb4748b0f6c2009567512d.tar.gz gdb-55f25fc330f3b22081bb4748b0f6c2009567512d.tar.bz2 |
2009-03-19 H.J. Lu <hongjiu.lu@intel.com>
* readelf.c (debug_apply_relocations): Check relocations
against STT_SECTION symbol.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r-- | binutils/readelf.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c index 276d4dd..c0c5beb 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -8387,20 +8387,20 @@ debug_apply_relocations (void * file, sym = symtab + get_reloc_symindex (rp->r_info); /* If the reloc has a symbol associated with it, - make sure that it is of an appropriate type. */ + make sure that it is of an appropriate type. + + Relocations against symbols without type can happen. + Gcc -feliminate-dwarf2-dups may generate symbols + without type for debug info. + + Icc generates relocations against function symbols + instead of local labels. + + Relocations against object symbols can happen, eg when + referencing a global array. For an example of this see + the _clz.o binary in libgcc.a. */ if (sym != symtab - && ELF_ST_TYPE (sym->st_info) != STT_SECTION - /* Relocations against symbols without type can happen. - Gcc -feliminate-dwarf2-dups may generate symbols - without type for debug info. */ - && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE - /* Icc generates relocations against function symbols - instead of local labels. */ - && ELF_ST_TYPE (sym->st_info) != STT_FUNC - /* Relocations against object symbols can happen, - eg when referencing a global array. For an - example of this see the _clz.o binary in libgcc.a. */ - && ELF_ST_TYPE (sym->st_info) != STT_OBJECT) + && ELF_ST_TYPE (sym->st_info) > STT_SECTION) { warn (_("skipping unexpected symbol type %s in %ld'th relocation in section %s\n"), get_symbol_type (ELF_ST_TYPE (sym->st_info)), |