This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
A proposed patch for undefined_symbol ()
- To: binutils at sourceware dot cygnus dot com
- Subject: A proposed patch for undefined_symbol ()
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Wed, 1 Mar 2000 09:59:46 -0800
When we add -Bsymbolic to build a shared library, an undefined symbol
isn't always a fatal error. This patch tries to address it. Is that ok
to install?
Thanks.
--
H.J. Lu (hjl@gnu.org)
--
2000-03-01 H.J. Lu <hjl@gnu.org>
* bfdlink.h (bfd_link_callbacks): Add a boolean arg to
the undefined_symbol callback.
Index: bfdlink.h
===================================================================
RCS file: /work/cvs/gnu/binutils/include/bfdlink.h,v
retrieving revision 1.3
diff -u -p -r1.3 bfdlink.h
--- bfdlink.h 2000/02/08 04:32:56 1.3
+++ bfdlink.h 2000/03/01 17:04:20
@@ -329,10 +329,13 @@ struct bfd_link_callbacks
/* A function which is called when a relocation is attempted against
an undefined symbol. NAME is the symbol which is undefined.
ABFD, SECTION and ADDRESS identify the location from which the
- reference is made. In some cases SECTION may be NULL. */
+ reference is made. FATAL indicates an undefined symbol is a
+ fatal error or not. In some cases SECTION may be NULL. */
boolean (*undefined_symbol) PARAMS ((struct bfd_link_info *,
const char *name, bfd *abfd,
- asection *section, bfd_vma address));
+ asection *section,
+ bfd_vma address,
+ boolean fatal));
/* A function which is called when a reloc overflow occurs. NAME is
the name of the symbol or section the reloc is against,
RELOC_NAME is the name of the relocation, and ADDEND is any
2000-03-01 H.J. Lu <hjl@gnu.org>
* ldmain.c (undefined_symbol): Take one more arg, fatal, to
indicate if the undefined symbol is a fatal error or not.
Don't delete the output file if "fatal" is false.
Index: ldmain.c
===================================================================
RCS file: /work/cvs/gnu/binutils/ld/ldmain.c,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 ldmain.c
--- ldmain.c 1999/07/12 17:14:22 1.1.1.5
+++ ldmain.c 2000/03/01 17:04:02
@@ -117,7 +117,7 @@ static boolean warning_callback PARAMS (
static void warning_find_reloc PARAMS ((bfd *, asection *, PTR));
static boolean undefined_symbol PARAMS ((struct bfd_link_info *,
const char *, bfd *,
- asection *, bfd_vma));
+ asection *, bfd_vma, boolean));
static boolean reloc_overflow PARAMS ((struct bfd_link_info *, const char *,
const char *, bfd_vma,
bfd *, asection *, bfd_vma));
@@ -1144,12 +1168,13 @@ warning_find_reloc (abfd, sec, iarg)
/*ARGSUSED*/
static boolean
-undefined_symbol (info, name, abfd, section, address)
+undefined_symbol (info, name, abfd, section, address, fatal)
struct bfd_link_info *info ATTRIBUTE_UNUSED;
const char *name;
bfd *abfd;
asection *section;
bfd_vma address;
+ boolean fatal;
{
static char *error_name;
static unsigned int error_count;
@@ -1193,8 +1218,14 @@ undefined_symbol (info, name, abfd, sect
if (section != NULL)
{
if (error_count < MAX_ERRORS_IN_A_ROW)
- einfo (_("%X%C: undefined reference to `%T'\n"),
- abfd, section, address, name);
+ {
+ if (fatal == false)
+ einfo (_("%C: undefined reference to `%T'\n"),
+ abfd, section, address, name);
+ else
+ einfo (_("%X%C: undefined reference to `%T'\n"),
+ abfd, section, address, name);
+ }
else if (error_count == MAX_ERRORS_IN_A_ROW)
einfo (_("%D: more undefined references to `%T' follow\n"),
abfd, section, address, name);
@@ -1202,8 +1233,14 @@ undefined_symbol (info, name, abfd, sect
else
{
if (error_count < MAX_ERRORS_IN_A_ROW)
- einfo (_("%X%B: undefined reference to `%T'\n"),
- abfd, name);
+ {
+ if (fatal == false)
+ einfo (_("%B: undefined reference to `%T'\n"),
+ abfd, name);
+ else
+ einfo (_("%X%B: undefined reference to `%T'\n"),
+ abfd, name);
+ }
else if (error_count == MAX_ERRORS_IN_A_ROW)
einfo (_("%B: more undefined references to `%T' follow\n"),
abfd, name);
2000-03-01 H.J. Lu <hjl@gnu.org>
* aoutx.h (aout_link_input_section_std): Pass "true" to
the undefined_symbol callback.
(aout_link_input_section_ext): Likewise.
* bout.c (get_value): Likewise.
* coff-a29k.c (coff_a29k_relocate_section): Likewise.
* coff-alpha.c (alpha_ecoff_get_relocated_section_conten):
Likewise.
(alpha_relocate_section): Likewise.
* coff-arm.c (coff_arm_relocate_section): Likewise.
* coff-i960.c (coff_i960_relocate_section): Likewise.
* coff-mcore.c (coff_mcore_relocate_section): Likewise.
* coff-mips.c (mips_relocate_section): Likewise.
* coff-ppc.c (coff_ppc_relocate_section): Likewise.
* coff-sh.c (sh_relocate_section): Likewise.
* coff-tic80.c (coff_tic80_relocate_section): Likewise.
* cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
* elf-m10200.c (mn10200_elf_relocate_section): Likewise.
* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
* elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
* elf32-fr30.c (fr30_elf_relocate_section): Likewise.
* elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
* elf32-i370.c (i370_elf_relocate_section): Likewise.
* elf32-m32r.c (m32r_elf_relocate_section): Likewise.
* elf32-mcore.c (mcore_elf_relocate_section): Likewise.
* elf32-sh.c (sh_elf_relocate_section): Likewise.
* elf32-v850.c (v850_elf_relocate_section): Likewise.
* elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise.
* elflink.h (elf_link_output_extsym): Likewise.
* pe-mips.c (coff_pe_mips_relocate_section): Likewise.
* reloc.c (bfd_generic_get_relocated_section_conten): Likewise.
* reloc16.c (_bfd_ppc_xcoff_relocate_section): Likewise.
* elf-hppa.h (elf_hppa_relocate_section): Pass "false" to the
undefined_symbol callback when building shared library with
-Bsymbolic and undefined symbols are allowed. Otherwise, pass
"true".
* elf32-arm.h (elf32_arm_relocate_section): Likewise.
* elf32-i386.c (elf_i386_relocate_section): Likewise.
* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
* elf32-mips.c (mips_elf_calculate_relocation): Likewise.
(elf32_mips_get_relocated_section_content): Likewise.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
Index: aoutx.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/aoutx.h,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 aoutx.h
--- aoutx.h 1999/07/17 20:52:20 1.1.1.3
+++ aoutx.h 2000/03/01 17:04:36
@@ -5029,7 +5029,8 @@ aout_link_input_section_std (finfo, inpu
else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
if (! ((*finfo->info->callbacks->undefined_symbol)
- (finfo->info, name, input_bfd, input_section, r_addr)))
+ (finfo->info, name, input_bfd, input_section,
+ r_addr, true)))
return false;
}
@@ -5431,7 +5432,8 @@ aout_link_input_section_ext (finfo, inpu
else
name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
if (! ((*finfo->info->callbacks->undefined_symbol)
- (finfo->info, name, input_bfd, input_section, r_addr)))
+ (finfo->info, name, input_bfd, input_section,
+ r_addr, true)))
return false;
}
Index: bout.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/bout.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 bout.c
--- bout.c 1999/07/19 16:13:13 1.1.1.3
+++ bout.c 2000/03/01 17:04:43
@@ -1047,7 +1047,8 @@ get_value (reloc, link_info, input_secti
{
if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (symbol),
- input_section->owner, input_section, reloc->address)))
+ input_section->owner, input_section, reloc->address,
+ true)))
abort ();
value = 0;
}
Index: coff-a29k.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coff-a29k.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 coff-a29k.c
--- coff-a29k.c 1999/07/19 16:13:13 1.1.1.3
+++ coff-a29k.c 2000/03/01 17:04:48
@@ -416,7 +416,7 @@ coff_a29k_relocate_section (output_bfd,
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
Index: coff-alpha.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coff-alpha.c,v
retrieving revision 1.3
diff -u -p -r1.3 coff-alpha.c
--- coff-alpha.c 1999/09/22 22:12:48 1.3
+++ coff-alpha.c 2000/03/01 17:05:05
@@ -1133,7 +1133,7 @@ alpha_ecoff_get_relocated_section_conten
case bfd_reloc_undefined:
if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*rel->sym_ptr_ptr),
- input_bfd, input_section, rel->address)))
+ input_bfd, input_section, rel->address, true)))
goto error_return;
break;
case bfd_reloc_dangerous:
@@ -1719,7 +1719,7 @@ alpha_relocate_section (output_bfd, info
relocated. */
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, (bfd_vma) 0)))
+ input_section, (bfd_vma) 0, true)))
return false;
addend = 0;
}
@@ -1921,7 +1921,7 @@ alpha_relocate_section (output_bfd, info
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section,
- r_vaddr - input_section->vma)))
+ r_vaddr - input_section->vma, true)))
return false;
relocation = 0;
}
Index: coff-arm.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coff-arm.c,v
retrieving revision 1.1.1.9
diff -u -p -r1.1.1.9 coff-arm.c
--- coff-arm.c 2000/02/29 19:00:05 1.1.1.9
+++ coff-arm.c 2000/03/01 17:05:13
@@ -1535,7 +1535,7 @@ coff_arm_relocate_section (output_bfd, i
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
Index: coff-i960.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coff-i960.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 coff-i960.c
--- coff-i960.c 1999/07/19 16:13:14 1.1.1.3
+++ coff-i960.c 2000/03/01 17:05:20
@@ -458,7 +458,7 @@ coff_i960_relocate_section (output_bfd,
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
Index: coff-mcore.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coff-mcore.c,v
retrieving revision 1.1.1.9
diff -u -p -r1.1.1.9 coff-mcore.c
--- coff-mcore.c 2000/01/21 03:06:03 1.1.1.9
+++ coff-mcore.c 2000/03/01 17:05:35
@@ -492,7 +492,7 @@ coff_mcore_relocate_section (output_bfd,
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
Index: coff-mips.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coff-mips.c,v
retrieving revision 1.2
diff -u -p -r1.2 coff-mips.c
--- coff-mips.c 1999/09/10 22:44:49 1.2
+++ coff-mips.c 2000/03/01 17:05:40
@@ -1781,7 +1781,7 @@ mips_relocate_section (output_bfd, info,
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
input_section,
- int_rel.r_vaddr - input_section->vma)))
+ int_rel.r_vaddr - input_section->vma, true)))
return false;
relocation = 0;
}
Index: coff-ppc.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coff-ppc.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 coff-ppc.c
--- coff-ppc.c 1999/09/13 16:36:41 1.1.1.4
+++ coff-ppc.c 2000/03/01 17:05:50
@@ -1197,7 +1197,7 @@ coff_ppc_relocate_section (output_bfd, i
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
Index: coff-sh.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coff-sh.c,v
retrieving revision 1.2
diff -u -p -r1.2 coff-sh.c
--- coff-sh.c 2000/03/01 16:25:54 1.2
+++ coff-sh.c 2000/03/01 17:05:57
@@ -2950,7 +2950,7 @@ sh_relocate_section (output_bfd, info, i
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
Index: coff-tic80.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/coff-tic80.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 coff-tic80.c
--- coff-tic80.c 1999/07/19 16:13:14 1.1.1.3
+++ coff-tic80.c 2000/03/01 17:06:06
@@ -576,7 +576,7 @@ coff_tic80_relocate_section (output_bfd,
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
Index: cofflink.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/cofflink.c,v
retrieving revision 1.1.1.8
diff -u -p -r1.1.1.8 cofflink.c
--- cofflink.c 2000/01/21 03:06:05 1.1.1.8
+++ cofflink.c 2000/03/01 17:05:27
@@ -2933,7 +2933,7 @@ _bfd_coff_generic_relocate_section (outp
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
Index: elf-hppa.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf-hppa.h,v
retrieving revision 1.1.1.12
diff -u -p -r1.1.1.12 elf-hppa.h
--- elf-hppa.h 1999/09/22 21:50:23 1.1.1.12
+++ elf-hppa.h 2000/03/01 17:22:38
@@ -1079,8 +1079,13 @@ elf_hppa_relocate_section (output_bfd, i
relocation = 0;
}
/* Allow undefined symbols in shared libraries. */
- else if (info->shared && !info->symbolic && !info->no_undefined)
+ else if (info->shared && !info->no_undefined)
{
+ if (info->symbolic)
+ (*info->callbacks->undefined_symbol)
+ (info, h->root.root.string, input_bfd,
+ input_section, rel->r_offset, false);
+
/* If this symbol has an entry in the PA64 dynamic hash
table, then get it. */
dyn_name = get_dyn_name (input_bfd, h, rel,
@@ -1104,7 +1109,7 @@ elf_hppa_relocate_section (output_bfd, i
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
break;
}
Index: elf-m10200.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf-m10200.c,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 elf-m10200.c
--- elf-m10200.c 1999/07/17 20:52:25 1.1.1.2
+++ elf-m10200.c 2000/03/01 17:23:24
@@ -408,7 +408,7 @@ mn10200_elf_relocate_section (output_bfd
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
relocation = 0;
}
@@ -447,7 +447,7 @@ mn10200_elf_relocate_section (output_bfd
case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
Index: elf-m10300.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf-m10300.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 elf-m10300.c
--- elf-m10300.c 1999/12/02 16:44:01 1.1.1.4
+++ elf-m10300.c 2000/03/01 17:23:35
@@ -623,7 +623,7 @@ mn10300_elf_relocate_section (output_bfd
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
relocation = 0;
}
@@ -662,7 +662,7 @@ mn10300_elf_relocate_section (output_bfd
case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
Index: elf32-arm.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-arm.h,v
retrieving revision 1.1.1.13
diff -u -p -r1.1.1.13 elf32-arm.h
--- elf32-arm.h 2000/01/28 16:33:03 1.1.1.13
+++ elf32-arm.h 2000/03/01 17:08:31
@@ -1806,7 +1806,8 @@ elf32_arm_relocate_section (output_bfd,
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ !info->shared || info->no_undefined)))
return false;
relocation = 0;
}
@@ -1844,7 +1845,7 @@ elf32_arm_relocate_section (output_bfd,
case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
Index: elf32-d10v.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-d10v.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 elf32-d10v.c
--- elf32-d10v.c 1999/07/17 20:52:26 1.1.1.3
+++ elf32-d10v.c 2000/03/01 17:08:55
@@ -449,7 +449,7 @@ elf32_d10v_relocate_section (output_bfd,
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
relocation = 0;
}
@@ -485,7 +485,7 @@ elf32_d10v_relocate_section (output_bfd,
case bfd_reloc_undefined:
if (!((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
Index: elf32-fr30.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-fr30.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 elf32-fr30.c
--- elf32-fr30.c 1999/07/17 20:52:26 1.1.1.3
+++ elf32-fr30.c 2000/03/01 17:09:22
@@ -617,7 +617,7 @@ fr30_elf_relocate_section (output_bfd, i
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
#if 0
fprintf (stderr, "unknown: name: %s\n", name);
@@ -643,7 +643,8 @@ fr30_elf_relocate_section (output_bfd, i
case bfd_reloc_undefined:
r = info->callbacks->undefined_symbol
- (info, name, input_bfd, input_section, rel->r_offset);
+ (info, name, input_bfd, input_section, rel->r_offset,
+ true);
break;
case bfd_reloc_outofrange:
Index: elf32-hppa.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-hppa.c,v
retrieving revision 1.7
diff -u -p -r1.7 elf32-hppa.c
--- elf32-hppa.c 1999/08/13 20:20:52 1.7
+++ elf32-hppa.c 2000/03/01 17:09:45
@@ -443,7 +443,7 @@ elf32_hppa_relocate_section (output_bfd,
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
break;
}
@@ -479,7 +479,7 @@ elf32_hppa_relocate_section (output_bfd,
case bfd_reloc_notsupported:
if (!((*info->callbacks->undefined_symbol)
(info, "$global$", input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
return false;
case bfd_reloc_dangerous:
Index: elf32-i370.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-i370.c,v
retrieving revision 1.3
diff -u -p -r1.3 elf32-i370.c
--- elf32-i370.c 2000/02/25 21:39:22 1.3
+++ elf32-i370.c 2000/03/01 17:12:37
@@ -1425,7 +1425,8 @@ i370_elf_relocate_section (output_bfd, i
h->root.root.string,
input_bfd,
input_section,
- rel->r_offset);
+ rel->r_offset,
+ true);
ret = false;
continue;
}
Index: elf32-i386.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-i386.c,v
retrieving revision 1.6
diff -u -p -r1.6 elf32-i386.c
--- elf32-i386.c 2000/02/25 21:39:22 1.6
+++ elf32-i386.c 2000/03/01 17:00:36
@@ -1319,7 +1319,8 @@ elf_i386_relocate_section (output_bfd, i
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ !info->shared || info->no_undefined)))
return false;
relocation = 0;
}
Index: elf32-m32r.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-m32r.c,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 elf32-m32r.c
--- elf32-m32r.c 1999/10/09 16:12:59 1.1.1.5
+++ elf32-m32r.c 2000/03/01 17:13:02
@@ -1018,7 +1018,7 @@ m32r_elf_relocate_section (output_bfd, i
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, offset)))
+ input_section, offset, true)))
return false;
relocation = 0;
}
@@ -1149,7 +1149,7 @@ m32r_elf_relocate_section (output_bfd, i
case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- offset)))
+ offset, true)))
return false;
break;
Index: elf32-m68k.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-m68k.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-m68k.c
--- elf32-m68k.c 2000/02/08 04:32:40 1.2
+++ elf32-m68k.c 2000/03/01 17:13:12
@@ -1485,7 +1485,8 @@ elf_m68k_relocate_section (output_bfd, i
{
if (!(info->callbacks->undefined_symbol
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ !info->shared || info->no_undefined)))
return false;
relocation = 0;
}
Index: elf32-mcore.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-mcore.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 elf32-mcore.c
--- elf32-mcore.c 1999/07/17 20:52:26 1.1.1.4
+++ elf32-mcore.c 2000/03/01 17:13:24
@@ -538,7 +538,7 @@ mcore_elf_relocate_section (output_bfd,
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
ret = false;
Index: elf32-mips.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-mips.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-mips.c
--- elf32-mips.c 2000/02/08 04:32:40 1.2
+++ elf32-mips.c 2000/03/01 17:16:56
@@ -5835,10 +5835,12 @@ mips_elf_calculate_relocation (abfd,
}
else
{
- (*info->callbacks->undefined_symbol)
- (info, h->root.root.root.string, input_bfd,
- input_section, relocation->r_offset);
- return bfd_reloc_undefined;
+ if (! ((*info->callbacks->undefined_symbol)
+ (info, h->root.root.root.string, input_bfd,
+ input_section, relocation->r_offset,
+ !info->shared || info->no_undefined)))
+ return bfd_reloc_undefined;
+ symbol = 0;
}
target_is_16_bit_code_p = (h->root.other == STO_MIPS16);
@@ -8715,7 +8717,8 @@ elf32_mips_get_relocated_section_content
case bfd_reloc_undefined:
if (!((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
- input_bfd, input_section, (*parent)->address)))
+ input_bfd, input_section, (*parent)->address,
+ true)))
goto error_return;
break;
case bfd_reloc_dangerous:
Index: elf32-ppc.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-ppc.c,v
retrieving revision 1.2
diff -u -p -r1.2 elf32-ppc.c
--- elf32-ppc.c 2000/02/08 04:32:40 1.2
+++ elf32-ppc.c 2000/03/01 17:17:50
@@ -3109,7 +3109,9 @@ ppc_elf_relocate_section (output_bfd, in
h->root.root.string,
input_bfd,
input_section,
- rel->r_offset))
+ rel->r_offset,
+ !info->shared
+ || info->no_undefined))
return false;
relocation = 0;
}
@@ -3139,7 +3141,8 @@ ppc_elf_relocate_section (output_bfd, in
h->root.root.string,
input_bfd,
input_section,
- rel->r_offset))
+ rel->r_offset,
+ true))
return false;
continue;
}
Index: elf32-sh.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-sh.c,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 elf32-sh.c
--- elf32-sh.c 2000/02/19 19:21:42 1.1.1.5
+++ elf32-sh.c 2000/03/01 17:18:04
@@ -1789,7 +1789,7 @@ sh_elf_relocate_section (output_bfd, inf
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
relocation = 0;
}
Index: elf32-sparc.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-sparc.c,v
retrieving revision 1.4
diff -u -p -r1.4 elf32-sparc.c
--- elf32-sparc.c 2000/02/29 19:15:14 1.4
+++ elf32-sparc.c 2000/03/01 17:18:15
@@ -1219,7 +1219,8 @@ elf32_sparc_relocate_section (output_bfd
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ !info->shared || info->no_undefined)))
return false;
relocation = 0;
}
Index: elf32-v850.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf32-v850.c,v
retrieving revision 1.1.1.4
diff -u -p -r1.1.1.4 elf32-v850.c
--- elf32-v850.c 1999/07/17 20:52:27 1.1.1.4
+++ elf32-v850.c 2000/03/01 17:18:28
@@ -1625,7 +1625,7 @@ fprintf (stderr, "undefined: sec: %s, na
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset, true)))
return false;
#if 0
fprintf (stderr, "unknown: name: %s\n", h->root.root.string);
@@ -1669,7 +1669,7 @@ fprintf (stderr, "unknown: name: %s\n",
case bfd_reloc_undefined:
if (! ((*info->callbacks->undefined_symbol)
(info, name, input_bfd, input_section,
- rel->r_offset)))
+ rel->r_offset, true)))
return false;
break;
Index: elf64-alpha.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf64-alpha.c,v
retrieving revision 1.7
diff -u -p -r1.7 elf64-alpha.c
--- elf64-alpha.c 2000/02/08 04:32:41 1.7
+++ elf64-alpha.c 2000/03/01 17:18:36
@@ -3476,7 +3476,8 @@ elf64_alpha_relocate_section (output_bfd
{
if (!((*info->callbacks->undefined_symbol)
(info, h->root.root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ !info->shared || info->no_undefined)))
return false;
relocation = 0;
}
Index: elf64-sparc.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elf64-sparc.c,v
retrieving revision 1.4
diff -u -p -r1.4 elf64-sparc.c
--- elf64-sparc.c 2000/02/29 19:15:14 1.4
+++ elf64-sparc.c 2000/03/01 17:18:43
@@ -2055,7 +2055,8 @@ sparc64_elf_relocate_section (output_bfd
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd,
- input_section, rel->r_offset)))
+ input_section, rel->r_offset,
+ !info->shared || info->no_undefined)))
return false;
relocation = 0;
}
Index: elflink.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elflink.c,v
retrieving revision 1.1.1.6
diff -u -p -r1.1.1.6 elflink.c
--- elflink.c 2000/01/28 16:33:07 1.1.1.6
+++ elflink.c 2000/03/01 17:22:47
@@ -234,7 +234,7 @@ _bfd_elf_link_record_dynamic_symbol (inf
const char * name = h->root.root.string;
(*info->callbacks->undefined_symbol)
- (info, name, abfd, bfd_und_section_ptr, 0);
+ (info, name, abfd, bfd_und_section_ptr, 0, true);
}
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
Index: elflink.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elflink.h,v
retrieving revision 1.20
diff -u -p -r1.20 elflink.h
--- elflink.h 2000/02/25 21:39:22 1.20
+++ elflink.h 2000/03/01 17:23:10
@@ -4906,7 +4906,7 @@ elf_link_output_extsym (h, data)
{
if (! ((*finfo->info->callbacks->undefined_symbol)
(finfo->info, h->root.root.string, h->root.u.undef.abfd,
- (asection *) NULL, 0)))
+ (asection *) NULL, 0, true)))
{
eoinfo->failed = true;
return false;
Index: pe-mips.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/pe-mips.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 pe-mips.c
--- pe-mips.c 2000/02/29 19:00:28 1.1.1.1
+++ pe-mips.c 2000/03/01 17:23:45
@@ -777,7 +777,7 @@ coff_pe_mips_relocate_section (output_bf
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
}
}
Index: reloc.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/reloc.c,v
retrieving revision 1.10
diff -u -p -r1.10 reloc.c
--- reloc.c 2000/02/25 21:39:22 1.10
+++ reloc.c 2000/03/01 17:24:54
@@ -2874,7 +2874,8 @@ bfd_generic_get_relocated_section_conten
case bfd_reloc_undefined:
if (!((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
- input_bfd, input_section, (*parent)->address)))
+ input_bfd, input_section, (*parent)->address,
+ true)))
goto error_return;
break;
case bfd_reloc_dangerous:
Index: reloc16.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/reloc16.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 reloc16.c
--- reloc16.c 1999/06/03 18:01:54 1.1.1.1
+++ reloc16.c 2000/03/01 17:23:51
@@ -81,7 +81,8 @@ bfd_coff_reloc16_get_value (reloc, link_
{
if (! ((*link_info->callbacks->undefined_symbol)
(link_info, bfd_asymbol_name (symbol),
- input_section->owner, input_section, reloc->address)))
+ input_section->owner, input_section, reloc->address,
+ true)))
abort ();
value = 0;
}
Index: xcofflink.c
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/xcofflink.c,v
retrieving revision 1.1.1.3
diff -u -p -r1.1.1.3 xcofflink.c
--- xcofflink.c 1999/07/17 20:52:34 1.1.1.3
+++ xcofflink.c 2000/03/01 17:24:08
@@ -6421,7 +6421,7 @@ _bfd_ppc_xcoff_relocate_section (output_
{
if (! ((*info->callbacks->undefined_symbol)
(info, h->root.root.string, input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ rel->r_vaddr - input_section->vma, true)))
return false;
/* Don't try to process the reloc. It can't help, and