aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-08-18 09:33:35 +0930
committerAlan Modra <amodra@gmail.com>2014-08-18 09:33:35 +0930
commit759388538d1339f6a634b2777e24f46427dd9c96 (patch)
tree7476c5a31a0fe3ebf289411c3b02897a4f6d6211 /bfd/elflink.c
parent1e53931944810798e6741f664bd3ec727272fe11 (diff)
downloadgdb-759388538d1339f6a634b2777e24f46427dd9c96.zip
gdb-759388538d1339f6a634b2777e24f46427dd9c96.tar.gz
gdb-759388538d1339f6a634b2777e24f46427dd9c96.tar.bz2
Return error status from bfd_elf_discard_info.
bfd/ * elflink.c (bfd_elf_discard_info): Return int error status. * stabs.c (_bfd_discard_section_stabs): Comment typo fix. * bfd-in.h (bfd_elf_discard_info): Updata prototype. * bfd-in2.h: Regenerate. ld/ * emultempl/aarch64elf.em (gld${EMULATION_NAME}_after_allocation): Handle error status from bfd_elf_discard_info. * emultempl/armelf.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/metagelf.em: Likewise. * emultempl/nios2elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise. * emultempl/vms.em: Likewise.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 5e5af32..d20f357 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -12629,21 +12629,21 @@ bfd_elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie)
}
/* Discard unneeded references to discarded sections.
- Returns TRUE if any section's size was changed. */
-/* This function assumes that the relocations are in sorted order,
- which is true for all known assemblers. */
+ Returns -1 on error, 1 if any section's size was changed, 0 if
+ nothing changed. This function assumes that the relocations are in
+ sorted order, which is true for all known assemblers. */
-bfd_boolean
+int
bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
{
struct elf_reloc_cookie cookie;
asection *o;
bfd *abfd;
- bfd_boolean ret = FALSE;
+ int changed = 0;
if (info->traditional_format
|| !is_elf_hash_table (info->hash))
- return FALSE;
+ return 0;
o = bfd_get_section_by_name (output_bfd, ".stab");
if (o != NULL)
@@ -12662,13 +12662,13 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
continue;
if (!init_reloc_cookie_for_section (&cookie, info, i))
- return FALSE;
+ return -1;
if (_bfd_discard_section_stabs (abfd, i,
elf_section_data (i)->sec_info,
bfd_elf_reloc_symbol_deleted_p,
&cookie))
- ret = TRUE;
+ changed = 1;
fini_reloc_cookie_for_section (&cookie, i);
}
@@ -12692,13 +12692,13 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
continue;
if (!init_reloc_cookie_for_section (&cookie, info, i))
- return FALSE;
+ return -1;
_bfd_elf_parse_eh_frame (abfd, info, i, &cookie);
if (_bfd_elf_discard_section_eh_frame (abfd, info, i,
bfd_elf_reloc_symbol_deleted_p,
&cookie))
- ret = TRUE;
+ changed = 1;
fini_reloc_cookie_for_section (&cookie, i);
}
@@ -12717,10 +12717,10 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
if (bed->elf_backend_discard_info != NULL)
{
if (!init_reloc_cookie (&cookie, info, abfd))
- return FALSE;
+ return -1;
if ((*bed->elf_backend_discard_info) (abfd, &cookie, info))
- ret = TRUE;
+ changed = 1;
fini_reloc_cookie (&cookie, abfd);
}
@@ -12729,9 +12729,9 @@ bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info)
if (info->eh_frame_hdr
&& !info->relocatable
&& _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info))
- ret = TRUE;
+ changed = 1;
- return ret;
+ return changed;
}
bfd_boolean