This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: powerpc64 oprofile and objdump -d segfaults
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sourceware dot org
- Date: Thu, 21 May 2009 23:42:57 +0930
- Subject: Re: powerpc64 oprofile and objdump -d segfaults
- References: <20090521134826.GD3704@bubble.grove.modra.org>
On Thu, May 21, 2009 at 11:18:26PM +0930, Alan Modra wrote:
> and ld currently does not remove local function symbols in this
> case, instead giving them a value of zero.
This arranges to have the unwanted local .opd function symbols
removed.
* elf-bfd.h (struct elf_backend_data
<elf_backend_link_output_symbol_hook>): Return an int.
* elf64-ppc.c (ppc64_elf_output_symbol_hook): Return 2 to drop
symbols on deleted .opd entries.
* elflink.c (elf_link_output_sym): Return without outputting sym
if output_symbol_hook returns 2.
(elf_link_output_extsym): Don't assign h->indx when symbol discarded.
Abort if we must not discard sym.
(elf_link_input_bfd): Similarly, don't set finfo->indices for
local syms.
(bfd_elf_final_link): Adjust elf_link_output_sym calls.
* elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Adjust for
elf_backend_link_output_symbol_hook return type change.
* elf32-arm.c (output_arch_syminfo): Likewise.
(elf32_arm_output_map_sym, elf32_arm_output_stub_sym): Likewise.
(elf32_arm_output_arch_local_syms): Likewise.
* elf32-cr16c.c (elf32_cr16c_link_output_symbol_hook): Likewise.
* elf32-score.c (s3_bfd_score_elf_link_output_symbol_hook): Likewise.
(bfd_score_elf_link_output_symbol_hook): Likewise.
* elf32-score.h (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
* elf32-score7.c (s7_bfd_score_elf_link_output_symbol_hook): Likewise.
* elf32-sh64.c (sh64_elf_link_output_symbol_hook): Likewise.
* elf32-spu.c (spu_elf_output_symbol_hook): Likewise.
* elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise.
* elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise.
* elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise.
* elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise.
* elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
* elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise.
* elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise.
Index: bfd/elf-bfd.h
===================================================================
RCS file: /cvs/src/src/bfd/elf-bfd.h,v
retrieving revision 1.282
diff -u -p -r1.282 elf-bfd.h
--- bfd/elf-bfd.h 30 Apr 2009 15:47:09 -0000 1.282
+++ bfd/elf-bfd.h 21 May 2009 08:27:34 -0000
@@ -745,8 +745,10 @@ struct elf_backend_data
const char **name, flagword *flags, asection **sec, bfd_vma *value);
/* If this field is not NULL, it is called by the elf_link_output_sym
- phase of a link for each symbol which will appear in the object file. */
- bfd_boolean (*elf_backend_link_output_symbol_hook)
+ phase of a link for each symbol which will appear in the object file.
+ On error, this function returns 0. 1 is returned when the symbol
+ should be output, 2 is returned when the symbol should be discarded. */
+ int (*elf_backend_link_output_symbol_hook)
(struct bfd_link_info *info, const char *, Elf_Internal_Sym *,
asection *, struct elf_link_hash_entry *);
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.294
diff -u -p -r1.294 elf64-ppc.c
--- bfd/elf64-ppc.c 21 May 2009 13:49:11 -0000 1.294
+++ bfd/elf64-ppc.c 21 May 2009 13:55:59 -0000
@@ -11759,7 +11759,7 @@ ppc64_elf_relocate_section (bfd *output_
/* Adjust the value of any local symbols in opd sections. */
-static bfd_boolean
+static int
ppc64_elf_output_symbol_hook (struct bfd_link_info *info,
const char *name ATTRIBUTE_UNUSED,
Elf_Internal_Sym *elfsym,
@@ -11771,11 +11771,11 @@ ppc64_elf_output_symbol_hook (struct bfd
bfd_vma value;
if (h != NULL)
- return TRUE;
+ return 1;
opd = get_opd_info (input_sec);
if (opd == NULL || opd->adjust == NULL)
- return TRUE;
+ return 1;
value = elfsym->st_value - input_sec->output_offset;
if (!info->relocatable)
@@ -11783,10 +11783,10 @@ ppc64_elf_output_symbol_hook (struct bfd
adjust = opd->adjust[value / 8];
if (adjust == -1)
- elfsym->st_value = 0;
- else
- elfsym->st_value += adjust;
- return TRUE;
+ return 2;
+
+ elfsym->st_value += adjust;
+ return 1;
}
/* Finish up dynamic symbol handling. We set the contents of various
Index: bfd/elflink.c
===================================================================
RCS file: /cvs/src/src/bfd/elflink.c,v
retrieving revision 1.336
diff -u -p -r1.336 elflink.c
--- bfd/elflink.c 4 May 2009 12:09:29 -0000 1.336
+++ bfd/elflink.c 21 May 2009 14:09:18 -0000
@@ -8196,7 +8196,7 @@ elf_link_flush_output_syms (struct elf_f
/* Add a symbol to the output symbol table. */
-static bfd_boolean
+static int
elf_link_output_sym (struct elf_final_link_info *finfo,
const char *name,
Elf_Internal_Sym *elfsym,
@@ -8205,7 +8205,7 @@ elf_link_output_sym (struct elf_final_li
{
bfd_byte *dest;
Elf_External_Sym_Shndx *destshndx;
- bfd_boolean (*output_symbol_hook)
+ int (*output_symbol_hook)
(struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *,
struct elf_link_hash_entry *);
const struct elf_backend_data *bed;
@@ -8214,8 +8214,9 @@ elf_link_output_sym (struct elf_final_li
output_symbol_hook = bed->elf_backend_link_output_symbol_hook;
if (output_symbol_hook != NULL)
{
- if (! (*output_symbol_hook) (finfo->info, name, elfsym, input_sec, h))
- return FALSE;
+ int ret = (*output_symbol_hook) (finfo->info, name, elfsym, input_sec, h);
+ if (ret != 1)
+ return ret;
}
if (name == NULL || *name == '\0')
@@ -8227,13 +8228,13 @@ elf_link_output_sym (struct elf_final_li
elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab,
name, TRUE, FALSE);
if (elfsym->st_name == (unsigned long) -1)
- return FALSE;
+ return 0;
}
if (finfo->symbuf_count >= finfo->symbuf_size)
{
if (! elf_link_flush_output_syms (finfo, bed))
- return FALSE;
+ return 0;
}
dest = finfo->symbuf + finfo->symbuf_count * bed->s->sizeof_sym;
@@ -8247,7 +8248,7 @@ elf_link_output_sym (struct elf_final_li
amt = finfo->shndxbuf_size * sizeof (Elf_External_Sym_Shndx);
destshndx = bfd_realloc (destshndx, amt * 2);
if (destshndx == NULL)
- return FALSE;
+ return 0;
finfo->symshndxbuf = destshndx;
memset ((char *) destshndx + amt, 0, amt);
finfo->shndxbuf_size *= 2;
@@ -8259,7 +8260,7 @@ elf_link_output_sym (struct elf_final_li
finfo->symbuf_count += 1;
bfd_get_symcount (finfo->output_bfd) += 1;
- return TRUE;
+ return 1;
}
/* Return TRUE if the dynamic symbol SYM in ABFD is supported. */
@@ -8445,6 +8446,8 @@ elf_link_output_extsym (struct elf_link_
Elf_Internal_Sym sym;
asection *input_sec;
const struct elf_backend_data *bed;
+ long indx;
+ int ret;
if (h->root.type == bfd_link_hash_warning)
{
@@ -8787,13 +8790,17 @@ elf_link_output_extsym (struct elf_link_
if (strip || (input_sec->flags & SEC_EXCLUDE) != 0)
return TRUE;
- h->indx = bfd_get_symcount (finfo->output_bfd);
-
- if (! elf_link_output_sym (finfo, h->root.root.string, &sym, input_sec, h))
+ indx = bfd_get_symcount (finfo->output_bfd);
+ ret = elf_link_output_sym (finfo, h->root.root.string, &sym, input_sec, h);
+ if (ret == 0)
{
eoinfo->failed = TRUE;
return FALSE;
}
+ else if (ret == 1)
+ h->indx = indx;
+ else if (h->indx == -2)
+ abort();
return TRUE;
}
@@ -8961,6 +8968,8 @@ elf_link_input_bfd (struct elf_final_lin
asection *isec;
const char *name;
Elf_Internal_Sym osym;
+ long indx;
+ int ret;
*pindex = -1;
@@ -9048,8 +9057,6 @@ elf_link_input_bfd (struct elf_final_lin
&& bfd_is_local_label_name (input_bfd, name)))
continue;
- /* If we get here, we are going to output this symbol. */
-
osym = *isym;
/* Adjust the section index for the output file. */
@@ -9079,8 +9086,12 @@ elf_link_input_bfd (struct elf_final_lin
}
}
- if (! elf_link_output_sym (finfo, name, &osym, isec, NULL))
+ indx = bfd_get_symcount (output_bfd);
+ ret = elf_link_output_sym (finfo, name, &osym, isec, NULL);
+ if (ret == 0)
return FALSE;
+ else if (ret == 1)
+ *pindex = indx;
}
/* Relocate the contents of each section. */
@@ -9129,6 +9140,8 @@ elf_link_input_bfd (struct elf_final_lin
Elf_Internal_Sym sym = isymbuf[symndx];
asection *sec = finfo->sections[symndx]->output_section;
const char *name;
+ long indx;
+ int ret;
name = bfd_elf_string_from_elf_section (input_bfd,
symtab_hdr->sh_link,
@@ -9143,9 +9156,14 @@ elf_link_input_bfd (struct elf_final_lin
sym.st_value += o->output_offset;
- finfo->indices[symndx] = bfd_get_symcount (output_bfd);
- if (! elf_link_output_sym (finfo, name, &sym, o, NULL))
+ indx = bfd_get_symcount (output_bfd);
+ ret = elf_link_output_sym (finfo, name, &sym, o, NULL);
+ if (ret == 0)
return FALSE;
+ else if (ret == 1)
+ finfo->indices[symndx] = indx;
+ else
+ abort ();
}
elf_section_data (osec)->this_hdr.sh_info
= finfo->indices[symndx];
@@ -9536,6 +9554,7 @@ elf_link_input_bfd (struct elf_final_lin
unsigned long shlink;
const char *name;
asection *osec;
+ long indx;
if (finfo->info->strip == strip_all)
{
@@ -9575,12 +9594,15 @@ elf_link_input_bfd (struct elf_final_lin
}
}
- finfo->indices[r_symndx]
- = bfd_get_symcount (output_bfd);
-
- if (! elf_link_output_sym (finfo, name, &sym, sec,
- NULL))
+ indx = bfd_get_symcount (output_bfd);
+ ret = elf_link_output_sym (finfo, name, &sym, sec,
+ NULL);
+ if (ret == 0)
return FALSE;
+ else if (ret == 1)
+ finfo->indices[r_symndx] = indx;
+ else
+ abort ();
}
r_symndx = finfo->indices[r_symndx];
@@ -10332,8 +10354,8 @@ bfd_elf_final_link (bfd *abfd, struct bf
elfsym.st_info = 0;
elfsym.st_other = 0;
elfsym.st_shndx = SHN_UNDEF;
- if (! elf_link_output_sym (&finfo, NULL, &elfsym, bfd_und_section_ptr,
- NULL))
+ if (elf_link_output_sym (&finfo, NULL, &elfsym, bfd_und_section_ptr,
+ NULL) != 1)
goto error_return;
}
@@ -10358,7 +10380,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
elfsym.st_shndx = i;
if (!info->relocatable)
elfsym.st_value = o->vma;
- if (!elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL))
+ if (elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL) != 1)
goto error_return;
}
}
@@ -10534,7 +10556,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
table, do it now. */
if (bed->elf_backend_output_arch_local_syms)
{
- typedef bfd_boolean (*out_sym_func)
+ typedef int (*out_sym_func)
(void *, const char *, Elf_Internal_Sym *, asection *,
struct elf_link_hash_entry *);
@@ -10645,7 +10667,7 @@ bfd_elf_final_link (bfd *abfd, struct bf
table, do it now. */
if (bed->elf_backend_output_arch_syms)
{
- typedef bfd_boolean (*out_sym_func)
+ typedef int (*out_sym_func)
(void *, const char *, Elf_Internal_Sym *, asection *,
struct elf_link_hash_entry *);
Index: bfd/elf-vxworks.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-vxworks.c,v
retrieving revision 1.11
diff -u -p -r1.11 elf-vxworks.c
--- bfd/elf-vxworks.c 9 Nov 2007 10:20:17 -0000 1.11
+++ bfd/elf-vxworks.c 21 May 2009 08:27:34 -0000
@@ -127,7 +127,7 @@ elf_vxworks_create_dynamic_sections (bfd
}
/* Tweak magic VxWorks symbols as they are written to the output file. */
-bfd_boolean
+int
elf_vxworks_link_output_symbol_hook (struct bfd_link_info *info
ATTRIBUTE_UNUSED,
const char *name,
@@ -141,7 +141,7 @@ elf_vxworks_link_output_symbol_hook (str
&& elf_vxworks_gott_symbol_p (h->root.u.undef.abfd, name))
sym->st_info = ELF_ST_INFO (STB_GLOBAL, ELF_ST_TYPE (sym->st_info));
- return TRUE;
+ return 1;
}
/* Copy relocations into the output file. Fixes up relocations against PLT
Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.194
diff -u -p -r1.194 elf32-arm.c
--- bfd/elf32-arm.c 15 May 2009 00:08:12 -0000 1.194
+++ bfd/elf32-arm.c 21 May 2009 08:27:41 -0000
@@ -11998,8 +11998,8 @@ typedef struct
struct bfd_link_info *info;
asection *sec;
int sec_shndx;
- bfd_boolean (*func) (void *, const char *, Elf_Internal_Sym *,
- asection *, struct elf_link_hash_entry *);
+ int (*func) (void *, const char *, Elf_Internal_Sym *,
+ asection *, struct elf_link_hash_entry *);
} output_arch_syminfo;
enum map_symbol_type
@@ -12029,9 +12029,7 @@ elf32_arm_output_map_sym (output_arch_sy
sym.st_other = 0;
sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE);
sym.st_shndx = osi->sec_shndx;
- if (!osi->func (osi->finfo, names[type], &sym, osi->sec, NULL))
- return FALSE;
- return TRUE;
+ return osi->func (osi->finfo, names[type], &sym, osi->sec, NULL) == 1;
}
@@ -12129,9 +12127,7 @@ elf32_arm_output_stub_sym (output_arch_s
sym.st_other = 0;
sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_FUNC);
sym.st_shndx = osi->sec_shndx;
- if (!osi->func (osi->finfo, name, &sym, osi->sec, NULL))
- return FALSE;
- return TRUE;
+ return osi->func (osi->finfo, name, &sym, osi->sec, NULL) == 1;
}
static bfd_boolean
@@ -12244,10 +12240,10 @@ arm_map_one_stub (struct bfd_hash_entry
elf32_arm_output_arch_local_syms (bfd *output_bfd,
struct bfd_link_info *info,
void *finfo,
- bfd_boolean (*func) (void *, const char *,
- Elf_Internal_Sym *,
- asection *,
- struct elf_link_hash_entry *))
+ int (*func) (void *, const char *,
+ Elf_Internal_Sym *,
+ asection *,
+ struct elf_link_hash_entry *))
{
output_arch_syminfo osi;
struct elf32_arm_link_hash_table *htab;
Index: bfd/elf32-cr16c.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-cr16c.c,v
retrieving revision 1.12
diff -u -p -r1.12 elf32-cr16c.c
--- bfd/elf32-cr16c.c 3 Jul 2007 14:26:40 -0000 1.12
+++ bfd/elf32-cr16c.c 21 May 2009 08:27:41 -0000
@@ -927,7 +927,7 @@ elf32_cr16c_add_symbol_hook (bfd *abfd,
return TRUE;
}
-static bfd_boolean
+static int
elf32_cr16c_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED,
Elf_Internal_Sym *sym,
@@ -946,7 +946,7 @@ elf32_cr16c_link_output_symbol_hook (str
sym->st_shndx = SHN_CR16C_NCOMMON;
}
- return TRUE;
+ return 1;
}
/* Definitions for setting CR16C target vector. */
Index: bfd/elf32-score.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-score.c,v
retrieving revision 1.14
diff -u -p -r1.14 elf32-score.c
--- bfd/elf32-score.c 2 Mar 2009 10:33:05 -0000 1.14
+++ bfd/elf32-score.c 21 May 2009 08:27:44 -0000
@@ -3068,7 +3068,7 @@ s3_bfd_score_elf_symbol_processing (bfd
}
}
-static bfd_boolean
+static int
s3_bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED,
Elf_Internal_Sym *sym,
@@ -3081,7 +3081,7 @@ s3_bfd_score_elf_link_output_symbol_hook
if (sym->st_shndx == SHN_COMMON && strcmp (input_sec->name, ".scommon") == 0)
sym->st_shndx = SHN_SCORE_SCOMMON;
- return TRUE;
+ return 1;
}
static bfd_boolean
@@ -4179,7 +4179,7 @@ _bfd_score_elf_symbol_processing (bfd *a
return s7_bfd_score_elf_symbol_processing (abfd, asym);
}
-static bfd_boolean
+static int
_bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED,
Elf_Internal_Sym *sym,
@@ -4194,7 +4194,7 @@ _bfd_score_elf_link_output_symbol_hook (
common in the output file. */
if (sym->st_shndx == SHN_COMMON && strcmp (input_sec->name, ".scommon") == 0)
sym->st_shndx = SHN_SCORE_SCOMMON;
- return TRUE;
+ return 1;
}
if (bfd_get_mach (info->input_bfds) == bfd_mach_score3)
Index: bfd/elf32-score.h
===================================================================
RCS file: /cvs/src/src/bfd/elf32-score.h,v
retrieving revision 1.1
diff -u -p -r1.1 elf32-score.h
--- bfd/elf32-score.h 2 Mar 2009 10:33:05 -0000 1.1
+++ bfd/elf32-score.h 21 May 2009 08:27:44 -0000
@@ -61,7 +61,7 @@ s7_bfd_score_elf_add_symbol_hook (bfd *,
extern void
s7_bfd_score_elf_symbol_processing (bfd *, asymbol *);
-extern bfd_boolean
+extern int
s7_bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *,
const char *,
Elf_Internal_Sym *,
Index: bfd/elf32-score7.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-score7.c,v
retrieving revision 1.1
diff -u -p -r1.1 elf32-score7.c
--- bfd/elf32-score7.c 2 Mar 2009 10:33:05 -0000 1.1
+++ bfd/elf32-score7.c 21 May 2009 08:27:46 -0000
@@ -2903,7 +2903,7 @@ s7_bfd_score_elf_symbol_processing (bfd
}
}
-bfd_boolean
+int
s7_bfd_score_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED,
Elf_Internal_Sym *sym,
@@ -2916,7 +2916,7 @@ s7_bfd_score_elf_link_output_symbol_hook
if (sym->st_shndx == SHN_COMMON && strcmp (input_sec->name, ".scommon") == 0)
sym->st_shndx = SHN_SCORE_SCOMMON;
- return TRUE;
+ return 1;
}
bfd_boolean
Index: bfd/elf32-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh64.c,v
retrieving revision 1.43
diff -u -p -r1.43 elf32-sh64.c
--- bfd/elf32-sh64.c 3 Jul 2007 14:26:41 -0000 1.43
+++ bfd/elf32-sh64.c 21 May 2009 08:27:47 -0000
@@ -60,7 +60,7 @@ static int sh64_elf_get_symbol_type
static bfd_boolean sh64_elf_add_symbol_hook
(bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **,
flagword *, asection **, bfd_vma *);
-static bfd_boolean sh64_elf_link_output_symbol_hook
+static int sh64_elf_link_output_symbol_hook
(struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *,
struct elf_link_hash_entry *);
static bfd_boolean sh64_backend_section_from_shdr
@@ -477,7 +477,7 @@ sh64_elf_add_symbol_hook (bfd *abfd, str
we don't need to look up and make sure to emit the main symbol for each
DataLabel symbol. */
-bfd_boolean
+static int
sh64_elf_link_output_symbol_hook (struct bfd_link_info *info,
const char *cname,
Elf_Internal_Sym *sym,
@@ -492,7 +492,7 @@ sh64_elf_link_output_symbol_hook (struct
name[strlen (name) - strlen (DATALABEL_SUFFIX)] = 0;
}
- return TRUE;
+ return 1;
}
/* Check a SH64-specific reloc and put the value to relocate to into
Index: bfd/elf32-spu.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-spu.c,v
retrieving revision 1.78
diff -u -p -r1.78 elf32-spu.c
--- bfd/elf32-spu.c 14 May 2009 17:56:56 -0000 1.78
+++ bfd/elf32-spu.c 21 May 2009 08:27:49 -0000
@@ -4984,7 +4984,7 @@ spu_elf_relocate_section (bfd *output_bf
/* Adjust _SPUEAR_ syms to point at their overlay stubs. */
-static bfd_boolean
+static int
spu_elf_output_symbol_hook (struct bfd_link_info *info,
const char *sym_name ATTRIBUTE_UNUSED,
Elf_Internal_Sym *sym,
@@ -5016,7 +5016,7 @@ spu_elf_output_symbol_hook (struct bfd_l
}
}
- return TRUE;
+ return 1;
}
static int spu_plugin = 0;
Index: bfd/elf32-v850.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-v850.c,v
retrieving revision 1.72
diff -u -p -r1.72 elf32-v850.c
--- bfd/elf32-v850.c 25 Nov 2008 13:03:55 -0000 1.72
+++ bfd/elf32-v850.c 21 May 2009 08:27:50 -0000
@@ -2095,7 +2095,7 @@ v850_elf_add_symbol_hook (bfd *abfd,
return TRUE;
}
-static bfd_boolean
+static int
v850_elf_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED,
Elf_Internal_Sym *sym,
@@ -2122,7 +2122,7 @@ v850_elf_link_output_symbol_hook (struct
sym->st_other &= ~(V850_OTHER_SDA | V850_OTHER_ZDA | V850_OTHER_TDA
| V850_OTHER_ERROR);
- return TRUE;
+ return 1;
}
static bfd_boolean
Index: bfd/elf64-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-hppa.c,v
retrieving revision 1.91
diff -u -p -r1.91 elf64-hppa.c
--- bfd/elf64-hppa.c 18 Mar 2009 11:27:17 -0000 1.91
+++ bfd/elf64-hppa.c 21 May 2009 08:27:55 -0000
@@ -184,7 +184,7 @@ static bfd_boolean elf64_hppa_mark_milli
static bfd_boolean elf64_hppa_size_dynamic_sections
(bfd *, struct bfd_link_info *);
-static bfd_boolean elf64_hppa_link_output_symbol_hook
+static int elf64_hppa_link_output_symbol_hook
(struct bfd_link_info *, const char *, Elf_Internal_Sym *,
asection *, struct elf_link_hash_entry *);
@@ -1914,7 +1914,7 @@ elf64_hppa_size_dynamic_sections (bfd *o
the symbols have their expected value in the normal symbol
table. Ick. */
-static bfd_boolean
+static int
elf64_hppa_link_output_symbol_hook (struct bfd_link_info *info ATTRIBUTE_UNUSED,
const char *name,
Elf_Internal_Sym *sym,
@@ -1926,7 +1926,7 @@ elf64_hppa_link_output_symbol_hook (stru
/* We may be called with the file symbol or section symbols.
They never need munging, so it is safe to ignore them. */
if (!name || !eh)
- return TRUE;
+ return 1;
/* Function symbols for which we created .opd entries *may* have been
munged by finish_dynamic_symbol and have to be un-munged here.
@@ -1942,7 +1942,7 @@ elf64_hppa_link_output_symbol_hook (stru
sym->st_shndx = hh->st_shndx;
}
- return TRUE;
+ return 1;
}
/* Finish up dynamic symbol handling. We set the contents of various
Index: bfd/elf64-mmix.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mmix.c,v
retrieving revision 1.57
diff -u -p -r1.57 elf64-mmix.c
--- bfd/elf64-mmix.c 28 Sep 2007 08:43:45 -0000 1.57
+++ bfd/elf64-mmix.c 21 May 2009 08:27:55 -0000
@@ -159,7 +159,7 @@ struct bpo_greg_section_info
struct bpo_reloc_request *reloc_request;
};
-static bfd_boolean mmix_elf_link_output_symbol_hook
+static int mmix_elf_link_output_symbol_hook
PARAMS ((struct bfd_link_info *, const char *, Elf_Internal_Sym *,
asection *, struct elf_link_hash_entry *));
@@ -2082,7 +2082,7 @@ _bfd_mmix_check_all_relocs (abfd, info)
the register section, and scale them down to correspond to the register
number. */
-static bfd_boolean
+static int
mmix_elf_link_output_symbol_hook (info, name, sym, input_sec, h)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
const char *name ATTRIBUTE_UNUSED;
@@ -2099,7 +2099,7 @@ mmix_elf_link_output_symbol_hook (info,
sym->st_shndx = SHN_REGISTER;
}
- return TRUE;
+ return 1;
}
/* We fake a register section that holds values that are register numbers.
Index: bfd/elf64-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sh64.c,v
retrieving revision 1.82
diff -u -p -r1.82 elf64-sh64.c
--- bfd/elf64-sh64.c 25 Nov 2008 13:03:56 -0000 1.82
+++ bfd/elf64-sh64.c 21 May 2009 08:28:02 -0000
@@ -2879,7 +2879,7 @@ sh64_elf64_add_symbol_hook (bfd *abfd, s
we don't need to look up and make sure to emit the main symbol for each
DataLabel symbol. */
-static bfd_boolean
+static int
sh64_elf64_link_output_symbol_hook (struct bfd_link_info *info,
const char *cname,
Elf_Internal_Sym *sym,
@@ -2894,7 +2894,7 @@ sh64_elf64_link_output_symbol_hook (stru
name[strlen (name) - strlen (DATALABEL_SUFFIX)] = 0;
}
- return TRUE;
+ return 1;
}
/* Set bit 0 on the entry address; it always points to SHmedia code. This
Index: bfd/elf64-sparc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-sparc.c,v
retrieving revision 1.117
diff -u -p -r1.117 elf64-sparc.c
--- bfd/elf64-sparc.c 15 Feb 2008 03:35:52 -0000 1.117
+++ bfd/elf64-sparc.c 21 May 2009 08:28:02 -0000
@@ -538,10 +538,11 @@ elf64_sparc_add_symbol_hook (bfd *abfd,
static bfd_boolean
elf64_sparc_output_arch_syms (bfd *output_bfd ATTRIBUTE_UNUSED,
struct bfd_link_info *info,
- PTR finfo, bfd_boolean (*func) (PTR, const char *,
- Elf_Internal_Sym *,
- asection *,
- struct elf_link_hash_entry *))
+ PTR finfo,
+ int (*func) (PTR, const char *,
+ Elf_Internal_Sym *,
+ asection *,
+ struct elf_link_hash_entry *))
{
int reg;
struct _bfd_sparc_elf_app_reg *app_regs =
@@ -585,10 +586,10 @@ elf64_sparc_output_arch_syms (bfd *outpu
sym.st_other = 0;
sym.st_info = ELF_ST_INFO (app_regs [reg].bind, STT_REGISTER);
sym.st_shndx = app_regs [reg].shndx;
- if (! (*func) (finfo, app_regs [reg].name, &sym,
- sym.st_shndx == SHN_ABS
- ? bfd_abs_section_ptr : bfd_und_section_ptr,
- NULL))
+ if ((*func) (finfo, app_regs [reg].name, &sym,
+ sym.st_shndx == SHN_ABS
+ ? bfd_abs_section_ptr : bfd_und_section_ptr,
+ NULL) != 1)
return FALSE;
}
Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.254
diff -u -p -r1.254 elfxx-mips.c
--- bfd/elfxx-mips.c 6 Feb 2009 14:11:00 -0000 1.254
+++ bfd/elfxx-mips.c 21 May 2009 08:28:17 -0000
@@ -6785,7 +6785,7 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd
symbol. We mark symbols as small common if appropriate. This is
also where we undo the increment of the value for a mips16 symbol. */
-bfd_boolean
+int
_bfd_mips_elf_link_output_symbol_hook
(struct bfd_link_info *info ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED, Elf_Internal_Sym *sym,
@@ -6801,7 +6801,7 @@ _bfd_mips_elf_link_output_symbol_hook
if (ELF_ST_IS_MIPS16 (sym->st_other))
sym->st_value &= ~1;
- return TRUE;
+ return 1;
}
/* Functions for the dynamic linker. */
Index: bfd/elfxx-mips.h
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.h,v
retrieving revision 1.41
diff -u -p -r1.41 elfxx-mips.h
--- bfd/elfxx-mips.h 8 Aug 2008 19:24:48 -0000 1.41
+++ bfd/elfxx-mips.h 21 May 2009 08:28:17 -0000
@@ -41,7 +41,7 @@ extern bfd_boolean _bfd_mips_elf_section
extern bfd_boolean _bfd_mips_elf_add_symbol_hook
(bfd *, struct bfd_link_info *, Elf_Internal_Sym *,
const char **, flagword *, asection **, bfd_vma *);
-extern bfd_boolean _bfd_mips_elf_link_output_symbol_hook
+extern int _bfd_mips_elf_link_output_symbol_hook
(struct bfd_link_info *, const char *, Elf_Internal_Sym *,
asection *, struct elf_link_hash_entry *);
extern bfd_boolean _bfd_mips_elf_create_dynamic_sections
--
Alan Modra
Australia Development Lab, IBM