aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffgen.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-11-07 09:37:39 +1030
committerAlan Modra <amodra@gmail.com>2014-11-07 13:19:15 +1030
commit405724050266e30fcc8cbcee416cde41862e8e8f (patch)
treef35a8d0b9758bbae7c5b50431042e07246802ae5 /bfd/coffgen.c
parent2dd2cd1c92d09ad96b643d2574d0dc6cd7e4841a (diff)
downloadgdb-405724050266e30fcc8cbcee416cde41862e8e8f.zip
gdb-405724050266e30fcc8cbcee416cde41862e8e8f.tar.gz
gdb-405724050266e30fcc8cbcee416cde41862e8e8f.tar.bz2
Revert bfd_get_size checks
* archive.c (_bfd_slurp_extended_name_table): Revert bfd_get_size check. * coffcode.h (coff_set_alignment_hook): Likewise. (coff_slurp_line_table): Likewise. * coffgen.c (coff_get_normalized_symtab): Likewise. (_bfd_coff_get_external_symbols): Likewise. * elf.c (bfd_elf_get_str_section): Likewise. * tekhex.c (first_phase): Likewise.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r--bfd/coffgen.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index 4856a40..9ad0783 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -1619,14 +1619,6 @@ _bfd_coff_get_external_symbols (bfd *abfd)
if (size == 0)
return TRUE;
- /* PR binutils/17512: Do not even try to load
- a symbol table bigger than the entire file... */
- if (size >= (bfd_size_type) bfd_get_size (abfd))
- {
- fprintf (stderr, "XXX SIZE FAIL 1\n");
- return FALSE;
- }
-
syms = bfd_malloc (size);
if (syms == NULL)
return FALSE;
@@ -1759,16 +1751,7 @@ coff_get_normalized_symtab (bfd *abfd)
if (obj_raw_syments (abfd) != NULL)
return obj_raw_syments (abfd);
- size = obj_raw_syment_count (abfd);
- /* PR binutils/17512: Do not even try to load
- a symbol table bigger than the entire file...
- Note - we do not fail on a size of 0. Linker created
- bfds can have this property and they are not corrupt. */
- if (size >= (bfd_size_type) bfd_get_size (abfd)
- && bfd_get_size (abfd) > 0)
- return NULL;
-
- size *= sizeof (combined_entry_type);
+ size = obj_raw_syment_count (abfd) * sizeof (combined_entry_type);
internal = (combined_entry_type *) bfd_zalloc (abfd, size);
if (internal == NULL && size != 0)
return NULL;