aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffgen.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-11-06 14:39:58 +0000
committerNick Clifton <nickc@redhat.com>2014-11-06 14:39:58 +0000
commit834107255bbefceb445fa733ebc1ea5d9f41ec7f (patch)
treed4568c90b8576dfb3318bb273a09ee074af5fc97 /bfd/coffgen.c
parent1fe9dc4519a86b856da7de0837366bbece82f2de (diff)
downloadgdb-834107255bbefceb445fa733ebc1ea5d9f41ec7f.zip
gdb-834107255bbefceb445fa733ebc1ea5d9f41ec7f.tar.gz
gdb-834107255bbefceb445fa733ebc1ea5d9f41ec7f.tar.bz2
Revert changes in previous deltas that introduced new failures into
the linker testsuite. * aoutx.h (slurp_symbol_table): Revert previous delta. (slurp_reloc_table): Likewise. * compress.c (bfd_get_full_section_contents): Remove file size test. * coffgen.c (coff_get_normalized_symtab): Allow zero-sized symtabs and do not complain about linker generated files.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r--bfd/coffgen.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index d0bf2c1a..4856a40 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -1622,7 +1622,10 @@ _bfd_coff_get_external_symbols (bfd *abfd)
/* 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)
@@ -1757,11 +1760,12 @@ coff_get_normalized_symtab (bfd *abfd)
return obj_raw_syments (abfd);
size = obj_raw_syment_count (abfd);
- if (size == 0)
- return NULL;
/* 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))
+ 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);