2000-03-01 H.J. Lu <hjl@gnu.org>
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 1 Mar 2000 19:40:54 +0000 (19:40 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 1 Mar 2000 19:40:54 +0000 (19:40 +0000)
* 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.

38 files changed:
bfd/ChangeLog
bfd/aoutx.h
bfd/bout.c
bfd/coff-a29k.c
bfd/coff-alpha.c
bfd/coff-arm.c
bfd/coff-i960.c
bfd/coff-mcore.c
bfd/coff-mips.c
bfd/coff-ppc.c
bfd/coff-sh.c
bfd/coff-tic80.c
bfd/cofflink.c
bfd/elf-hppa.h
bfd/elf-m10200.c
bfd/elf-m10300.c
bfd/elf32-arm.h
bfd/elf32-d10v.c
bfd/elf32-fr30.c
bfd/elf32-hppa.c
bfd/elf32-i370.c
bfd/elf32-i386.c
bfd/elf32-m32r.c
bfd/elf32-m68k.c
bfd/elf32-mcore.c
bfd/elf32-mips.c
bfd/elf32-ppc.c
bfd/elf32-sh.c
bfd/elf32-sparc.c
bfd/elf32-v850.c
bfd/elf64-alpha.c
bfd/elf64-sparc.c
bfd/elflink.c
bfd/elflink.h
bfd/pe-mips.c
bfd/reloc.c
bfd/reloc16.c
bfd/xcofflink.c

index 97c0eefa3773b8a1f312f8dc4c02fc04ff7fbc58..631c7e8901453d22a13a5dd8d927f8c26898f6d8 100644 (file)
@@ -1,3 +1,51 @@
+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.
+
 2000-02-28  Nick Clifton  <nickc@cygnus.com>
 
        * Makefile.am: Add rules to build pe[i]-{sh|mips}.lo objects.
index 895a3215d7dba0f6f20569593ac21ea030a8b8f1..fa107a7cb942ee5a07ebab635362bfffd43af9bc 100644 (file)
@@ -5029,7 +5029,8 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs,
              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, input_bfd, input_section, relocs,
              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 dd1754af255c527a95b0c88844d4a2ce8b219c5e..c230e18c0ea69818e36f5b2b4efac3786bb859b4 100644 (file)
@@ -1047,7 +1047,8 @@ get_value (reloc, link_info, input_section)
        {
          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 9eb68448a2d66415bc37f00b3e44133be683d72e..0374b20b473be93059fd741e522b5292c18882dd 100644 (file)
@@ -416,7 +416,7 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section,
                {
                  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 bc25319f4a64f348f5f1ce21e8356213ed4a90e4..6bbc279aeead9faf9b2b270c97f83b5d518f2679 100644 (file)
@@ -1133,7 +1133,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order,
            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, input_bfd, input_section,
                         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, input_bfd, input_section,
                      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 f0a109e7197234dee447bb09d8362e3754ea2fb8..5bb7be6f6ac73d68ff32a22528158d539642b3c7 100644 (file)
@@ -1535,7 +1535,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 2a7ebfbe96453fdc77350f53c5c47766cc52617a..4c37fab6973afdbd697cff0266016b8da5e34922 100644 (file)
@@ -458,7 +458,7 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 90b7667dfe31b950cde08b61062d7dc8a42169ec..1bc231226cf4c2b5d6283022954f46fe43116cbd 100644 (file)
@@ -492,7 +492,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 1f687fb527efd6df41d467fb6d3edd17d3aa7262..bb4b15e96c244170ae0d05922d0ee7e37e3ffa9f 100644 (file)
@@ -1781,7 +1781,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section,
                  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 f2e8cb8711df34eea522d7f3d885157e8c32eeb4..c5e695d311a93dd16013d10e3da551d0ae7aafcf 100644 (file)
@@ -1197,7 +1197,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 2fdde67301f656b9f43cdbd41db59d5f04bb2822..de5d657a31eb81ed3952b4e42ea00f57ea31c1db 100644 (file)
@@ -2938,7 +2938,7 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents,
            {
              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 1132ea6e8419b6b238677bd48e97b0d06c977758..a8ade33ba9c7cf0449a5a0a47a209ba9c30f4c89 100644 (file)
@@ -576,7 +576,7 @@ coff_tic80_relocate_section (output_bfd, info, input_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 1ad7c986e14ad85355f68b8625bdfa020d2835c5..609f6653e0985f8c9961c7ef627ee0acd489e4c2 100644 (file)
@@ -2933,7 +2933,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_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 99cc17e51f5d418175519016a22328b1cd4b3570..b55e1c4e5bc1111f238c2e38128794d6edf8e42b 100644 (file)
@@ -1079,8 +1079,13 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
                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, info, input_bfd, input_section,
            {
              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 88556fbc7a53491a89bf4bb41e903a287ebfdd96..1939635cb2b0fbf83dff353a0d0b1960d56e0597 100644 (file)
@@ -408,7 +408,7 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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, info, input_bfd, input_section,
            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 5dbd2d6d4d79a92c111b97b52b907cdb9d93f64d..bb86497bc9961da6f77519d3c38af56eb3c48c74 100644 (file)
@@ -623,7 +623,7 @@ mn10300_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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, info, input_bfd, input_section,
            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 7b78fd6c812aa54082f8b722327cca67320e62b3..eaaf9763b4083327ea128d54aa00a3bf3bc882a3 100644 (file)
@@ -1806,7 +1806,8 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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, info, input_bfd, input_section,
            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 29deb7c70c1e5e9afaaf11351024379f0a4a9e4f..dd2e892ad0862dcbb6e4d1effbe627d0d69f21ca 100644 (file)
@@ -449,7 +449,7 @@ elf32_d10v_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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, info, input_bfd, input_section,
            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 04c7d378b731689c19c9c03d4b569be8e1220575..6b295d3e52a2137eabcdd17e628471e0c578655c 100644 (file)
@@ -617,7 +617,7 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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, info, input_bfd, input_section,
              
            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 874fd6e89e9a637394e199395b42d6b2c64d493d..683a308515af25911bdf8920f8cedd0ef09b2dad 100644 (file)
@@ -443,7 +443,7 @@ elf32_hppa_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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, info, input_bfd, input_section,
            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 6dc993d26e5e300132421125ba7e5cdadfe21de9..4d66bcfe299802a8045914940de4b013d9f30b2b 100644 (file)
@@ -1425,7 +1425,8 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                                   h->root.root.string,
                                                   input_bfd,
                                                   input_section,
-                                                  rel->r_offset);
+                                                  rel->r_offset,
+                                                  true);
              ret = false;
              continue;
            }
index 0153fa872eb98704a98356ac5198b209b472cb18..90efba8dc9bc824f2e0397f6eb3bb4fedf225d12 100644 (file)
@@ -1319,7 +1319,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 e9ce55b198ff2a5d9c9ee5b2e885d00481c3631a..be6af6c95bb43258c64515551f6b93f4de6ff599 100644 (file)
@@ -1018,7 +1018,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                {
                  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, info, input_bfd, input_section,
            case bfd_reloc_undefined:
              if (! ((*info->callbacks->undefined_symbol)
                     (info, name, input_bfd, input_section,
-                     offset)))
+                     offset, true)))
                return false;
              break;
 
index 06ba12c9983bcc492c7c2883f9b8d01b28181609..518b6bcfd0d4005a8c6d87971980ae48f975d8a5 100644 (file)
@@ -1485,7 +1485,8 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 6a8b70a443a2f0b462ba42e7f76c1240e2fe20a0..c8e66dfa183b96315013f6e9320407a4f4b94c25 100644 (file)
@@ -538,7 +538,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 d9832b67b94066ec617398fc06e8a23c59394071..2fd04cc9f4b27a67325eafa27c996d71df1c1e5e 100644 (file)
@@ -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_contents (abfd, link_info, link_order, data,
                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 7c5f589cd12076f0c18a6c3c6ac99e3f0dcc4479..242cfb730ab5f12fe792969c1f49ff10b5bf7958 100644 (file)
@@ -3109,7 +3109,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                                                         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, info, input_bfd, input_section,
                                                          h->root.root.string,
                                                          input_bfd,
                                                          input_section,
-                                                         rel->r_offset))
+                                                         rel->r_offset,
+                                                         true))
                return false;
              continue;
            }
index ea0426e24b850cbc4a49b5ad8db7fb3713391cf4..19042871ae42eac0973ea04e096aef1898c54c40 100644 (file)
@@ -1789,7 +1789,7 @@ sh_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 f39fc1b5ec4dafe953b32acb8237f693674e6873..e61a82fabeb5cc8a0134068635ecb107e86afd8b 100644 (file)
@@ -1219,7 +1219,8 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 119e5980852b4cb37d4ed8dad03c3253e80c914d..4fe28fc92b912a13a94092fb211c67a28c273291 100644 (file)
@@ -1625,7 +1625,7 @@ fprintf (stderr, "undefined: sec: %s, name: %s\n",
            {
              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", h->root.root.string);
            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 a21d1b9f32c03568cd213a756c63030b7b4f4f0f..3d17b54463bffff1cf60c5c17487cc46aceb9b93 100644 (file)
@@ -3476,7 +3476,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 4420cbcf25a8d3a0598ca71cf8bc4ad09b4b6d34..46e777552f2aac9c5d42088a1aa3f662bafa9332 100644 (file)
@@ -2055,7 +2055,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section,
            {
              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 91a00e7b31e73217a2ada4ff430ae4cdcff0c3d2..6534d84b18a0681d1585ad61b02d67e46350a0ad 100644 (file)
@@ -234,7 +234,7 @@ _bfd_elf_link_record_dynamic_symbol (info, h)
              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 6acb790196b72b25e47c8be81970f541f31a792e..394f1c825641f257e40ffcb9e93f3dfb3adc68cc 100644 (file)
@@ -4395,7 +4395,9 @@ elf_bfd_final_link (abfd, info)
     }
 
   /* That wrote out all the local symbols.  Finish up the symbol table
-     with the global symbols.  */
+     with the global symbols. Even if we want to strip everything we
+     can, we still need to deal with those global symbols that got
+     converted to local in a version script. */
 
   if (info->shared)
     {
@@ -4904,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 51e3b1da57779d3735df9c64e5261d62dd84b1db..8f6e454cc62baa396cc4c5862bd3bb550f6fd7d4 100644 (file)
@@ -777,7 +777,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_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 79d602a2ef7c55af1a42d1fa6a9506807126fb9b..7edeeaa1f25fe71285cf3b5013c435abccaab28c 100644 (file)
@@ -2874,7 +2874,8 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data,
                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 7e7952ed5064ae4f1e4653807208b86357f74567..fd8758aec4c5da83291bfcde8b886652339ffe39 100644 (file)
@@ -81,7 +81,8 @@ bfd_coff_reloc16_get_value (reloc, link_info, input_section)
        {
          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 9ec75bd01d8f4edabd7300b9bad2dbeacfc51bab..3f488d7f3820d4a231f94b1579e9955563b5223b 100644 (file)
@@ -6421,7 +6421,7 @@ _bfd_ppc_xcoff_relocate_section (output_bfd, info, input_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;
 
              /* Don't try to process the reloc.  It can't help, and