diff options
author | Ian Lance Taylor <ian@airs.com> | 1994-04-05 15:32:49 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1994-04-05 15:32:49 +0000 |
commit | b3cee0a981326af85e3b0695f728a63f981bf465 (patch) | |
tree | 99a0c79e6eb789249118a4f633524d83c1d8adfc /bfd/i386lynx.c | |
parent | 4e8e5c4ac523dd13db9832f3ed43c19d7e935646 (diff) | |
download | gdb-b3cee0a981326af85e3b0695f728a63f981bf465.zip gdb-b3cee0a981326af85e3b0695f728a63f981bf465.tar.gz gdb-b3cee0a981326af85e3b0695f728a63f981bf465.tar.bz2 |
* aoutx.h (NAME(aout,canonicalize_reloc)): Don't error out if
section->relocation is NULL; malloc might have returned NULL when
given a zero size if there were no relocations.
* bout.c (b_out_canonicalize_reloc): Likewise.
* coffcode.h (coff_canonicalize_reloc): Likewise.
* ecoff.c (ecoff_canonicalize_reloc): Likewise.
* elfcode.h (elf_canonicalize_reloc): Likewise.
* mipsbsd.c (MY(canonicalize_reloc)): Likewise.
* i386lynx.c (NAME(lynx,canonicalize_reloc)): Likewise.
* nlmcode.h (nlm_canonicalize_reloc): Likewise.
* som.c (som_canonicalize_reloc): Likewise.
* hp300hpux.c (MY(slurp_reloc_table)): Likewise. Also, if malloc
returns NULL, don't report an error if we asked for zero bytes.
* i386lynx.c (NAME(lynx,slurp_reloc_table)): If malloc returns
NULL, don't report an error if we asked for zero bytes.
* nlmcode.h (nlm_slurp_reloc_fixups): Likewise.
Diffstat (limited to 'bfd/i386lynx.c')
-rw-r--r-- | bfd/i386lynx.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/bfd/i386lynx.c b/bfd/i386lynx.c index 784a6f2..3db7b14 100644 --- a/bfd/i386lynx.c +++ b/bfd/i386lynx.c @@ -427,7 +427,7 @@ doit: memset (reloc_cache, 0, count * sizeof (arelent)); relocs = (PTR) bfd_alloc (abfd, reloc_size); - if (!relocs) + if (!relocs && reloc_size != 0) { free (reloc_cache); goto nomem; @@ -536,7 +536,7 @@ NAME(lynx,canonicalize_reloc) (abfd, section, relptr, symbols) arelent *tblptr = section->relocation; unsigned int count; - if (!(tblptr || NAME (lynx, slurp_reloc_table) (abfd, section, symbols))) + if (!(tblptr || NAME(lynx,slurp_reloc_table) (abfd, section, symbols))) return -1; if (section->flags & SEC_CONSTRUCTOR) @@ -551,8 +551,6 @@ NAME(lynx,canonicalize_reloc) (abfd, section, relptr, symbols) else { tblptr = section->relocation; - if (!tblptr) - return -1; for (count = 0; count++ < section->reloc_count;) { |