diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2001-01-20 06:08:35 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2001-01-20 06:08:35 +0000 |
commit | c84921762444577d7ba8233382a40c00a54a013b (patch) | |
tree | 87aa1b880cef89766650211fcd8283c19e21dcab /bfd | |
parent | 1aad8cf8bbe8c89de937b352f3899a49800e0e07 (diff) | |
download | gdb-c84921762444577d7ba8233382a40c00a54a013b.zip gdb-c84921762444577d7ba8233382a40c00a54a013b.tar.gz gdb-c84921762444577d7ba8233382a40c00a54a013b.tar.bz2 |
2001-01-19 H.J. Lu <hjl@gnu.org>
* elf32-i386.c (elf_i386_check_relocs): Report files with bad
relocation section names.
(elf_i386_relocate_section): Report files with bad relocation
section names and return false.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elf32-i386.c | 37 |
2 files changed, 37 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b160268..a0a974c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2001-01-19 H.J. Lu <hjl@gnu.org> + + * elf32-i386.c (elf_i386_check_relocs): Report files with bad + relocation section names. + (elf_i386_relocate_section): Report files with bad relocation + section names and return false. + 2001-01-17 Bo Thorsen <bo@suse.de> * targets.c: Alphabetize list of xvecs. diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index f538bf6..b433c25 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -670,9 +670,20 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (name == NULL) return false; - BFD_ASSERT (strncmp (name, ".rel", 4) == 0 - && strcmp (bfd_get_section_name (abfd, sec), - name + 4) == 0); + if (strncmp (name, ".rel", 4) != 0 + || strcmp (bfd_get_section_name (abfd, sec), + name + 4) != 0) + { + if (abfd->my_archive) + (*_bfd_error_handler) (_("%s(%s): bad relocation section name `%s\'"), + bfd_get_filename (abfd->my_archive), + bfd_get_filename (abfd), + name); + else + (*_bfd_error_handler) (_("%s: bad relocation section name `%s\'"), + bfd_get_filename (abfd), + name); + } sreloc = bfd_get_section_by_name (dynobj, name); if (sreloc == NULL) @@ -1626,10 +1637,22 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (name == NULL) return false; - BFD_ASSERT (strncmp (name, ".rel", 4) == 0 - && strcmp (bfd_get_section_name (input_bfd, - input_section), - name + 4) == 0); + if (strncmp (name, ".rel", 4) != 0 + || strcmp (bfd_get_section_name (input_bfd, + input_section), + name + 4) != 0) + { + if (input_bfd->my_archive) + (*_bfd_error_handler) (_("%s(%s): bad relocation section name `%s\'"), + bfd_get_filename (input_bfd->my_archive), + bfd_get_filename (input_bfd), + name); + else + (*_bfd_error_handler) (_("%s: bad relocation section name `%s\'"), + bfd_get_filename (input_bfd), + name); + return false; + } sreloc = bfd_get_section_by_name (dynobj, name); BFD_ASSERT (sreloc != NULL); |