summaryrefslogtreecommitdiffstats
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-04-01 02:35:41 +0000
committerAlan Modra <amodra@gmail.com>2005-04-01 02:35:41 +0000
commit7356fed57f1a99325c89d5d05bdc46ebfd52ce16 (patch)
tree83e127798ffa72ef9c532b8f46bc7c2363dc88e3 /bfd/elf64-ppc.c
parent28b13744034126dc942e733967d2dad3986e41d1 (diff)
downloadppe42-binutils-7356fed57f1a99325c89d5d05bdc46ebfd52ce16.tar.gz
ppe42-binutils-7356fed57f1a99325c89d5d05bdc46ebfd52ce16.zip
* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Return -1 on errors
rather than 0.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index ca23f23283..5a5e3a2c81 100644
--- a/bfd/elf64-ppc.c
+++ b/bfd/elf64-ppc.c
@@ -2687,7 +2687,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
syms = bfd_malloc ((symcount + 1) * sizeof (*syms));
if (syms == NULL)
- return 0;
+ return -1;
if (!relocatable && static_count != 0 && dyn_count != 0)
{
@@ -2758,11 +2758,15 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table;
relcount = (opd->flags & SEC_RELOC) ? opd->reloc_count : 0;
-
- if (! relcount
- || ! (*slurp_relocs) (abfd, opd, static_syms, FALSE))
+ if (relcount == 0)
goto done;
+ if (!(*slurp_relocs) (abfd, opd, static_syms, FALSE))
+ {
+ count = -1;
+ goto done;
+ }
+
size = 0;
for (i = secsymend, r = opd->relocation; i < opdsymend; ++i)
{
@@ -2794,7 +2798,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
s = *ret = bfd_malloc (size);
if (s == NULL)
{
- count = 0;
+ count = -1;
goto done;
}
@@ -2847,6 +2851,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
free_contents_and_exit:
free (contents);
}
+ count = -1;
goto done;
}
@@ -2866,10 +2871,7 @@ ppc64_elf_get_synthetic_symtab (bfd *abfd,
s = *ret = bfd_malloc (size);
if (s == NULL)
- {
- count = 0;
- goto free_contents_and_exit;
- }
+ goto free_contents_and_exit;
names = (char *) (s + count);
OpenPOWER on IntegriCloud