* elf32-i386.c (elf_i386_relocate_section): Make undefined symbols
authorJakub Jelinek <jakub@redhat.com>
Mon, 11 Aug 2003 14:26:11 +0000 (14:26 +0000)
committerJakub Jelinek <jakub@redhat.com>
Mon, 11 Aug 2003 14:26:11 +0000 (14:26 +0000)
fatal if -pie.
* elf32-s390.c (elf_s390_relocate_section): Likewise.
* elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
* elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
* elf64-s390.c (elf_s390_relocate_section): Likewise.
* elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
* elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise.
(ppc_elf_relocate_section) <case R_PPC_RELAX32>: Issue fatal error
on undefined symbols if -pie.
* elf32-sh.c (sh_elf_relocate_section): Likewise.

12 files changed:
bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf32-ppc.c
bfd/elf32-s390.c
bfd/elf32-sh.c
bfd/elf32-sparc.c
bfd/elf64-alpha.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elf64-sparc.c
bfd/elf64-x86-64.c
bfd/elfxx-ia64.c

index 0709dc3ec5617c740a79d16083b5497c7a812a1b..93cd6c0161a3c0dd47404bc336666cbe47c0cf54 100644 (file)
@@ -1,3 +1,20 @@
+2003-08-11  Jakub Jelinek  <jakub@redhat.com>
+
+       * elf32-i386.c (elf_i386_relocate_section): Make undefined symbols
+       fatal if -pie.
+       * elf32-s390.c (elf_s390_relocate_section): Likewise.
+       * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+       * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+       * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+       * elf64-s390.c (elf_s390_relocate_section): Likewise.
+       * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+       * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
+       * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
+       * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+       (ppc_elf_relocate_section) <case R_PPC_RELAX32>: Issue fatal error
+       on undefined symbols if -pie.
+       * elf32-sh.c (sh_elf_relocate_section): Likewise.
+
 2003-08-11  Alan Modra  <amodra@bigpond.net.au>
 
        * elf64-ppc.c (ppc64_elf_relocate_section): Add special case for crt1.o
index 23020b417bb76611fa7272725d88bfe76a09ad84..77b5e369bce1cb1599162b68d43a0b18d177c41e 100644 (file)
@@ -2186,7 +2186,7 @@ elf_i386_relocate_section (bfd *output_bfd,
              if (! ((*info->callbacks->undefined_symbol)
                     (info, h->root.root.string, input_bfd,
                      input_section, rel->r_offset,
-                     (!info->shared || info->no_undefined
+                     (info->executable || info->no_undefined
                       || ELF_ST_VISIBILITY (h->other)))))
                return FALSE;
            }
index b820638a58e8aa74a90a8f29215d4239c557368e..b78a64c0cf5b33ae5e93ae5fc218cdd29aa97120 100644 (file)
@@ -4760,7 +4760,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
            {
              if (! ((*info->callbacks->undefined_symbol)
                     (info, h->root.root.string, input_bfd, input_section,
-                     rel->r_offset, (!info->shared
+                     rel->r_offset, (info->executable
                                      || info->no_undefined
                                      || ELF_ST_VISIBILITY (h->other)))))
                return FALSE;
@@ -5529,7 +5529,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
                                 + sym_sec->output_offset);
                      }
                  }
-               else if (info->shared
+               else if (!info->executable
                         && !info->no_undefined
                         && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
                  ;
@@ -5538,7 +5538,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
                    if (! ((*info->callbacks->undefined_symbol)
                           (info, h->root.root.string, input_bfd,
                            input_section, rel->r_offset,
-                           (!info->shared || info->no_undefined
+                           (info->executable || info->no_undefined
                             || ELF_ST_VISIBILITY (h->other)))))
                      return FALSE;
                    continue;
index 85e9ab6ae0f036a4465021414cd04f0b607c6b2f..bead5d02758a5b90f131980f7774151c6b74f848 100644 (file)
@@ -2365,7 +2365,7 @@ elf_s390_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,
-                     (!info->shared || info->no_undefined
+                     (info->executable || info->no_undefined
                       || ELF_ST_VISIBILITY (h->other)))))
                return FALSE;
              relocation = 0;
index ac410c2842c03b098448852ce554c5bb6c8f5ad4..b509536e47693eb6cbc13380c345032be40c5e80 100644 (file)
@@ -4764,7 +4764,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
            }
          else if (h->root.type == bfd_link_hash_undefweak)
            relocation = 0;
-         else if (info->shared
+         else if (! info->executable
                   && ! info->no_undefined
                   && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT)
            relocation = 0;
@@ -4773,7 +4773,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
              if (! ((*info->callbacks->undefined_symbol)
                     (info, h->root.root.string, input_bfd,
                      input_section, rel->r_offset,
-                     (!info->shared || info->no_undefined
+                     (info->executable || info->no_undefined
                       || ELF_ST_VISIBILITY (h->other)))))
                return FALSE;
              relocation = 0;
index 136d80e37d9f68f837c132706ed36f33d00b22c7..d8ad11d77abc65f77dd346d67d65c2697cc1e46e 100644 (file)
@@ -2218,7 +2218,7 @@ 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,
-                     (!info->shared || info->no_undefined
+                     (info->executable || info->no_undefined
                       || ELF_ST_VISIBILITY (h->other)))))
                return FALSE;
            }
index 1d35a6d5d014dcbf60637b21c49e2c2fc6df23f3..4511f71cb5edf1473753fa8cd1dfa8f6fa7fbf6a 100644 (file)
@@ -4481,7 +4481,7 @@ 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,
-                    (!info->shared || info->no_undefined
+                    (info->executable || info->no_undefined
                      || ELF_ST_VISIBILITY (h->root.other)))))
                return FALSE;
              continue;
index 966dc431cdeababb5c5ef96d103e497affdf3310..4291f9bb01d5817340adf34eb5fb9dfd14ed0daf 100644 (file)
@@ -7384,7 +7384,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
            {
              if (! ((*info->callbacks->undefined_symbol)
                     (info, h->root.root.string, input_bfd, input_section,
-                     rel->r_offset, (!info->shared
+                     rel->r_offset, (info->executable
                                      || info->no_undefined
                                      || ELF_ST_VISIBILITY (h->other)))))
                return FALSE;
index 23ca8aade009f6cb335b14d2e01fb68088378e87..0a5e472467209c86162a5befb85603e0d14afe2a 100644 (file)
@@ -2335,7 +2335,7 @@ elf_s390_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,
-                     (!info->shared || info->no_undefined
+                     (info->executable || info->no_undefined
                       || ELF_ST_VISIBILITY (h->other)))))
                return FALSE;
              relocation = 0;
index 25c609fc5993a62dbfc32d9818c4dc70a3601711..d554134b3495910a53f0573d2bdc0e7e67c603ce 100644 (file)
@@ -2106,7 +2106,7 @@ 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,
-                     (!info->shared || info->no_undefined
+                     (info->executable || info->no_undefined
                       || ELF_ST_VISIBILITY (h->other)))))
                return FALSE;
 
index 39d5abbe6fd3b22a633aa055b6ed05f283a15d32..970d742d0d18c37bc16d6006befb1b09884d6075 100644 (file)
@@ -1861,7 +1861,7 @@ elf64_x86_64_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
              if (! ((*info->callbacks->undefined_symbol)
                     (info, h->root.root.string, input_bfd,
                      input_section, rel->r_offset,
-                     (!info->shared || info->no_undefined
+                     (info->executable || info->no_undefined
                       || ELF_ST_VISIBILITY (h->other)))))
                return FALSE;
              relocation = 0;
index fe1490ac9ab7aca96fdb38d56548a9389b1511f9..3175b815f317ff746072d3d1dbd1a6bb61edf77e 100644 (file)
@@ -3893,7 +3893,7 @@ elfNN_ia64_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,
-                     (!info->shared || info->no_undefined
+                     (info->executable || info->no_undefined
                       || ELF_ST_VISIBILITY (h->other)))))
                return FALSE;
              continue;