2010-09-24 Thomas Schwinge <thomas@codesourcery.com>
authorThomas Schwinge <tschwinge@gnu.org>
Fri, 24 Sep 2010 12:14:26 +0000 (12:14 +0000)
committerThomas Schwinge <tschwinge@gnu.org>
Fri, 24 Sep 2010 12:14:26 +0000 (12:14 +0000)
* elf32-arm.c, elf32-cris.c, elf32-hppa.c, elf32-i370.c, elf32-m32r.c,
elf32-m68k.c, elf32-microblaze.c, elf32-ppc.c, elf32-score.c,
elf32-score7.c, elf32-sh.c, elf32-vax.c, elf32-xtensa.c, elf64-alpha.c,
elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-sparc.c, elfcode.h,
elflink.c, elfxx-ia64.c, elfxx-mips.c: Use STN_UNDEF when referring to
the zero symbol index.

23 files changed:
bfd/ChangeLog
bfd/elf32-arm.c
bfd/elf32-cris.c
bfd/elf32-hppa.c
bfd/elf32-i370.c
bfd/elf32-m32r.c
bfd/elf32-m68k.c
bfd/elf32-microblaze.c
bfd/elf32-ppc.c
bfd/elf32-score.c
bfd/elf32-score7.c
bfd/elf32-sh.c
bfd/elf32-vax.c
bfd/elf32-xtensa.c
bfd/elf64-alpha.c
bfd/elf64-hppa.c
bfd/elf64-mips.c
bfd/elf64-ppc.c
bfd/elf64-sparc.c
bfd/elfcode.h
bfd/elflink.c
bfd/elfxx-ia64.c
bfd/elfxx-mips.c

index 22f9a2049fed88074a81cec21d68f18abd115cee..b281a045201b2744cd6e1b28515952d96d0cc901 100644 (file)
@@ -1,5 +1,12 @@
 2010-09-24  Thomas Schwinge  <thomas@codesourcery.com>
 
+       * elf32-arm.c, elf32-cris.c, elf32-hppa.c, elf32-i370.c, elf32-m32r.c,
+       elf32-m68k.c, elf32-microblaze.c, elf32-ppc.c, elf32-score.c,
+       elf32-score7.c, elf32-sh.c, elf32-vax.c, elf32-xtensa.c, elf64-alpha.c,
+       elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-sparc.c, elfcode.h,
+       elflink.c, elfxx-ia64.c, elfxx-mips.c: Use STN_UNDEF when referring to
+       the zero symbol index.
+
        * elflink.c (bfd_elf_reloc_symbol_deleted_p): Compare the symbol index
        to STN_UNDEF, not SHN_UNDEF.
 
index 74fb85576390c58ff048d8f7c4ec621d7f6809b9..2125582ee8a87340ac6f711e929f8776a8ad5581 100644 (file)
@@ -9063,7 +9063,7 @@ elf32_arm_relocate_section (bfd *                  output_bfd,
            name = bfd_section_name (input_bfd, sec);
        }
 
-      if (r_symndx != 0
+      if (r_symndx != STN_UNDEF
          && r_type != R_ARM_NONE
          && (h == NULL
              || h->root.type == bfd_link_hash_defined
@@ -10902,7 +10902,7 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
          /* PR 9934: It is possible to have relocations that do not
             refer to symbols, thus it is also possible to have an
             object file containing relocations but no symbol table.  */
-         && (r_symndx > 0 || nsyms > 0))
+         && (r_symndx > STN_UNDEF || nsyms > 0))
        {
          (*_bfd_error_handler) (_("%B: bad symbol index: %d"), abfd,
                                   r_symndx);
index 71634c93ebd6c9ad709cbef0dc4da1c0b6853ab6..f3ed80d18e945b2fa7586aa78a9285284d8b31c5 100644 (file)
@@ -1493,7 +1493,7 @@ cris_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
        case R_CRIS_16:
        case R_CRIS_32:
          if (info->shared
-             && r_symndx != 0
+             && r_symndx != STN_UNDEF
              && (input_section->flags & SEC_ALLOC) != 0
              && ((r_type != R_CRIS_8_PCREL
                   && r_type != R_CRIS_16_PCREL
index 1a6fef882732b1f8ded133e9037c1818f50a3c95..3a3a355d6e6f258bd8a48622b45611da245d01b2 100644 (file)
@@ -4472,7 +4472,7 @@ static enum elf_reloc_type_class
 elf32_hppa_reloc_type_class (const Elf_Internal_Rela *rela)
 {
   /* Handle TLS relocs first; we don't want them to be marked
-     relative by the "if (ELF32_R_SYM (rela->r_info) == 0)"
+     relative by the "if (ELF32_R_SYM (rela->r_info) == STN_UNDEF)"
      check below.  */
   switch ((int) ELF32_R_TYPE (rela->r_info))
     {
@@ -4482,7 +4482,7 @@ elf32_hppa_reloc_type_class (const Elf_Internal_Rela *rela)
         return reloc_class_normal;
     }
 
-  if (ELF32_R_SYM (rela->r_info) == 0)
+  if (ELF32_R_SYM (rela->r_info) == STN_UNDEF)
     return reloc_class_relative;
 
   switch ((int) ELF32_R_TYPE (rela->r_info))
index 67e6598523661b0034c106dac254648206b96d27..01f9fb861249d44351ece1a18f48213ec9d60385 100644 (file)
@@ -1183,7 +1183,7 @@ i370_elf_relocate_section (bfd *output_bfd,
        case (int) R_I370_ADDR31:
        case (int) R_I370_ADDR16:
          if (info->shared
-             && r_symndx != 0)
+             && r_symndx != STN_UNDEF)
            {
              Elf_Internal_Rela outrel;
              bfd_byte *loc;
index 28eff7666ceaf4216cd81ad20e510f05c3071a97..3df6addb69e72a778a3100b4bdcbf2196c51812c 100644 (file)
@@ -2897,7 +2897,7 @@ m32r_elf_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
             case R_M32R_HI16_ULO_RELA:
             case R_M32R_LO16_RELA:
               if (info->shared
-                  && r_symndx != 0
+                  && r_symndx != STN_UNDEF
                   && (input_section->flags & SEC_ALLOC) != 0
                   && ((   r_type != R_M32R_10_PCREL_RELA
                        && r_type != R_M32R_18_PCREL_RELA
index 732361217613c2e294f72cd3e175d9d89faf0734..8d1ee7f5e72a131efd9fece70fa254f34986567e 100644 (file)
@@ -4034,7 +4034,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
        case R_68K_PC16:
        case R_68K_PC32:
          if (info->shared
-             && r_symndx != 0
+             && r_symndx != STN_UNDEF
              && (input_section->flags & SEC_ALLOC) != 0
              && (h == NULL
                  || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
@@ -4169,7 +4169,7 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section,
          return FALSE;
        }
 
-      if (r_symndx != 0
+      if (r_symndx != STN_UNDEF
          && r_type != R_68K_NONE
          && (h == NULL
              || h->root.type == bfd_link_hash_defined
index a64926a51efa5bd94dc93c4b4c4dc6b2eca4a325..e260c5557758351bfb8e8663a792388153a9e6a8 100644 (file)
@@ -1067,10 +1067,10 @@ microblaze_elf_relocate_section (bfd *output_bfd,
            case (int) R_MICROBLAZE_64:
            case (int) R_MICROBLAZE_32:
              {
-               /* r_symndx will be zero only for relocs against symbols
+               /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
                   from removed linkonce sections, or sections discarded by
                   a linker script.  */
-               if (r_symndx == 0 || (input_section->flags & SEC_ALLOC) == 0)
+               if (r_symndx == STN_UNDEF || (input_section->flags & SEC_ALLOC) == 0)
                  {
                    relocation += addend;
                    if (r_type == R_MICROBLAZE_32)
index ef0e15927e9af4d3940e196abce5eec88bd39d00..2b457d6d9bfe43e6a89151c7121fa4a1c0c4d254 100644 (file)
@@ -6985,9 +6985,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
                        if (local_sections[r_symndx] == sec)
                          break;
                      if (r_symndx >= symtab_hdr->sh_info)
-                       r_symndx = 0;
+                       r_symndx = STN_UNDEF;
                      rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
-                     if (r_symndx != 0)
+                     if (r_symndx != STN_UNDEF)
                        rel->r_addend -= (local_syms[r_symndx].st_value
                                          + sec->output_offset
                                          + sec->output_section->vma);
@@ -7053,9 +7053,9 @@ ppc_elf_relocate_section (bfd *output_bfd,
                if (local_sections[r_symndx] == sec)
                  break;
              if (r_symndx >= symtab_hdr->sh_info)
-               r_symndx = 0;
+               r_symndx = STN_UNDEF;
              rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
-             if (r_symndx != 0)
+             if (r_symndx != STN_UNDEF)
                rel->r_addend -= (local_syms[r_symndx].st_value
                                  + sec->output_offset
                                  + sec->output_section->vma);
@@ -7658,7 +7658,7 @@ ppc_elf_relocate_section (bfd *output_bfd,
                             sym_name);
                          ret = FALSE;
                        }
-                     else if (r_symndx == 0 || bfd_is_abs_section (sec))
+                     else if (r_symndx == STN_UNDEF || bfd_is_abs_section (sec))
                        ;
                      else if (sec == NULL || sec->owner == NULL)
                        {
index f1f1aae1e721c6566562298ef92a37d5dfa8996b..fec177af07106992b6f3fa5515080a32bda19527 100644 (file)
@@ -2126,7 +2126,7 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
                && h != NULL
                && h->root.def_dynamic
                && !h->root.def_regular))
-           && r_symndx != 0
+           && r_symndx != STN_UNDEF
            && (input_section->flags & SEC_ALLOC) != 0)
         {
           /* If we're creating a shared library, or this relocation is against a symbol
@@ -2139,8 +2139,8 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
                                                     input_section))
             return bfd_reloc_undefined;
         }
-      else if (r_symndx == 0)
-        /* r_symndx will be zero only for relocs against symbols
+      else if (r_symndx == STN_UNDEF)
+        /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
            from removed linkonce sections, or sections discarded by
            a linker script.  */
         value = 0;
index 85ce236a4f15a81f070433951447499f1534f5b3..f780e56ab791f5ffbd2f2bcd9c421aa135598184 100644 (file)
@@ -2025,7 +2025,7 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
                && h != NULL
                && h->root.def_dynamic
                && !h->root.def_regular))
-           && r_symndx != 0
+           && r_symndx != STN_UNDEF
            && (input_section->flags & SEC_ALLOC) != 0)
         {
           /* If we're creating a shared library, or this relocation is against a symbol
@@ -2038,8 +2038,8 @@ score_elf_final_link_relocate (reloc_howto_type *howto,
                                                     input_section))
             return bfd_reloc_undefined;
         }
-      else if (r_symndx == 0)
-        /* r_symndx will be zero only for relocs against symbols
+      else if (r_symndx == STN_UNDEF)
+        /* r_symndx will be STN_UNDEF (zero) only for relocs against symbols
            from removed linkonce sections, or sections discarded by
            a linker script.  */
         value = 0;
index 023ed7ede7b475e87baf64a24cd8769a44c10079..493764340686895c982b69c1bb72e22503f622c3 100644 (file)
@@ -4405,7 +4405,7 @@ sh_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
              && (h == NULL
                  || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
                  || h->root.type != bfd_link_hash_undefweak)
-             && r_symndx != 0
+             && r_symndx != STN_UNDEF
              && (input_section->flags & SEC_ALLOC) != 0
              && !is_vxworks_tls
              && (r_type == R_SH_DIR32
index 1582ac764d579c53ea25b4f5d832b848d1b5bda7..db67faf850ab79b91973c5e7b9601b3c3d2e8259 100644 (file)
@@ -1611,7 +1611,7 @@ elf_vax_relocate_section (bfd *output_bfd,
        case R_VAX_16:
        case R_VAX_32:
          if (info->shared
-             && r_symndx != 0
+             && r_symndx != STN_UNDEF
              && (input_section->flags & SEC_ALLOC) != 0
              && ((r_type != R_VAX_PC8
                   && r_type != R_VAX_PC16
index 9b9b5de06a8e730fe1a495639ac62f20658ec3e8..f9ecde5fa80e88ff19bc16bd5103e5ba7be4f0e0 100644 (file)
@@ -2800,7 +2800,7 @@ elf_xtensa_relocate_section (bfd *output_bfd,
            name = bfd_section_name (input_bfd, sec);
        }
 
-      if (r_symndx != 0
+      if (r_symndx != STN_UNDEF
          && r_type != R_XTENSA_NONE
          && (h == NULL
              || h->root.type == bfd_link_hash_defined
index 19326cf81b3dd840e1491828020a3200a2cc472d..1df020c3975b7ec4afdfdba58d06aa07265122c6 100644 (file)
@@ -1866,8 +1866,8 @@ elf64_alpha_check_relocs (bfd *abfd, struct bfd_link_info *info,
 
        case R_ALPHA_TLSLDM:
          /* The symbol for a TLSLDM reloc is ignored.  Collapse the
-            reloc to the 0 symbol so that they all match.  */
-         r_symndx = 0;
+            reloc to the STN_UNDEF (0) symbol so that they all match.  */
+         r_symndx = STN_UNDEF;
          h = 0;
          maybe_dynamic = FALSE;
          /* FALLTHRU */
@@ -3491,7 +3491,7 @@ elf64_alpha_relax_tls_get_addr (struct alpha_relax_info *info, bfd_vma symval,
      as appropriate.  */
 
   use_gottprel = FALSE;
-  new_symndx = is_gd ? ELF64_R_SYM (irel->r_info) : 0;
+  new_symndx = is_gd ? ELF64_R_SYM (irel->r_info) : STN_UNDEF;
 
   /* Beware of the compiler hoisting part of the sequence out a loop
      and adjusting the destination register for the TLSGD insn.  If this
@@ -3724,8 +3724,8 @@ elf64_alpha_relax_section (bfd *abfd, asection *sec,
 
        case R_ALPHA_TLSLDM:
          /* The symbol for a TLSLDM reloc is ignored.  Collapse the
-             reloc to the 0 symbol so that they all match.  */
-         r_symndx = 0;
+             reloc to the STN_UNDEF (0) symbol so that they all match.  */
+         r_symndx = STN_UNDEF;
          break;
 
        default:
@@ -4154,9 +4154,9 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
       r_symndx = ELF64_R_SYM(rel->r_info);
 
       /* The symbol for a TLSLDM reloc is ignored.  Collapse the
-        reloc to the 0 symbol so that they all match.  */
+        reloc to the STN_UNDEF (0) symbol so that they all match.  */
       if (r_type == R_ALPHA_TLSLDM)
-       r_symndx = 0;
+       r_symndx = STN_UNDEF;
 
       if (r_symndx < symtab_hdr->sh_info)
        {
@@ -4166,10 +4166,10 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
          msec = sec;
          value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel);
 
-         /* If this is a tp-relative relocation against sym 0,
+         /* If this is a tp-relative relocation against sym STN_UNDEF (0),
             this is hackery from relax_section.  Force the value to
             be the tls module base.  */
-         if (r_symndx == 0
+         if (r_symndx == STN_UNDEF
              && (r_type == R_ALPHA_TLSLDM
                  || r_type == R_ALPHA_GOTTPREL
                  || r_type == R_ALPHA_TPREL64
@@ -4455,7 +4455,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
                dynaddend = value - dtp_base;
              }
            else if (info->shared
-                    && r_symndx != 0
+                    && r_symndx != STN_UNDEF
                     && (input_section->flags & SEC_ALLOC)
                     && !undef_weak_ref)
              {
@@ -4503,7 +4503,7 @@ elf64_alpha_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
          /* ??? .eh_frame references to discarded sections will be smashed
             to relocations against SHN_UNDEF.  The .eh_frame format allows
             NULL to be encoded as 0 in any format, so this works here.  */
-         if (r_symndx == 0)
+         if (r_symndx == STN_UNDEF)
            howto = (elf64_alpha_howto_table
                     + (r_type - R_ALPHA_SREL32 + R_ALPHA_REFLONG));
          goto default_reloc;
index ba6b1f84c7219c921c920b066ece7521e1474aa5..4efab4fc269bd64489d71861d277ce21326a0448 100644 (file)
@@ -2465,7 +2465,7 @@ elf64_hppa_finalize_dynreloc (struct elf_link_hash_entry *eh,
 static enum elf_reloc_type_class
 elf64_hppa_reloc_type_class (const Elf_Internal_Rela *rela)
 {
-  if (ELF64_R_SYM (rela->r_info) == 0)
+  if (ELF64_R_SYM (rela->r_info) == STN_UNDEF)
     return reloc_class_relative;
 
   switch ((int) ELF64_R_TYPE (rela->r_info))
index bb079cf33e91157a34118052ec72a3475621411d..5001d42315bbb6f64feb0a68efa2235652b0da06 100644 (file)
@@ -2619,7 +2619,7 @@ mips_elf64_slurp_one_reloc_table (bfd *abfd, asection *asect,
            default:
              if (! used_sym)
                {
-                 if (rela.r_sym == 0)
+                 if (rela.r_sym == STN_UNDEF)
                    relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
                  else
                    {
index 2073bdc11da94c62dbd7da3a7b4ca043b3c7e949..a4f3064a4f7702210a929e632f2082e3e63a7bed 100644 (file)
@@ -11668,7 +11668,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
 
       /* Check that tls relocs are used with tls syms, and non-tls
         relocs are used with non-tls syms.  */
-      if (r_symndx != 0
+      if (r_symndx != STN_UNDEF
          && r_type != R_PPC64_NONE
          && (h == NULL
              || h->elf.root.type == bfd_link_hash_defined
@@ -11917,9 +11917,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
                        if (local_sections[r_symndx] == sec)
                          break;
                      if (r_symndx >= symtab_hdr->sh_info)
-                       r_symndx = 0;
+                       r_symndx = STN_UNDEF;
                      rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
-                     if (r_symndx != 0)
+                     if (r_symndx != STN_UNDEF)
                        rel->r_addend -= (local_syms[r_symndx].st_value
                                          + sec->output_offset
                                          + sec->output_section->vma);
@@ -12025,9 +12025,9 @@ ppc64_elf_relocate_section (bfd *output_bfd,
                if (local_sections[r_symndx] == sec)
                  break;
              if (r_symndx >= symtab_hdr->sh_info)
-               r_symndx = 0;
+               r_symndx = STN_UNDEF;
              rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET;
-             if (r_symndx != 0)
+             if (r_symndx != STN_UNDEF)
                rel->r_addend -= (local_syms[r_symndx].st_value
                                  + sec->output_offset
                                  + sec->output_section->vma);
@@ -12569,7 +12569,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
        case R_PPC64_TOC:
          /* Relocation value is TOC base.  */
          relocation = TOCstart;
-         if (r_symndx == 0)
+         if (r_symndx == STN_UNDEF)
            relocation += htab->stub_group[input_section->id].toc_off;
          else if (unresolved_reloc)
            ;
@@ -12819,7 +12819,7 @@ ppc64_elf_relocate_section (bfd *output_bfd,
                             sym_name);
                          ret = FALSE;
                        }
-                     else if (r_symndx == 0 || bfd_is_abs_section (sec))
+                     else if (r_symndx == STN_UNDEF || bfd_is_abs_section (sec))
                        ;
                      else if (sec == NULL || sec->owner == NULL)
                        {
index 5a2fda26840a9c09094bf87403bcb5c046db5a5d..ca692d291dce93a0559c4260c6d1bffc551a7b06 100644 (file)
@@ -98,7 +98,7 @@ elf64_sparc_slurp_one_reloc_table (bfd *abfd, asection *asect,
       else
        relent->address = rela.r_offset - asect->vma;
 
-      if (ELF64_R_SYM (rela.r_info) == 0)
+      if (ELF64_R_SYM (rela.r_info) == STN_UNDEF)
        relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
       else
        {
index f7c89263eeab373f72918a5830e8cc6586a1127c..0cd11830bd2f0851d621b57f6d2c34785e9cd6b6 100644 (file)
@@ -1466,7 +1466,7 @@ elf_slurp_reloc_table_from_section (bfd *abfd,
       else
        relent->address = rela.r_offset - asect->vma;
 
-      if (ELF_R_SYM (rela.r_info) == 0)
+      if (ELF_R_SYM (rela.r_info) == STN_UNDEF)
        relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr;
       else if (ELF_R_SYM (rela.r_info) > symcount)
        {
index bdd69660a59fa040ce2afc656ae4fe50717dfe8a..f4d65991fe55775974a4dcbcb86281d4bafe0c9c 100644 (file)
@@ -2170,7 +2170,7 @@ elf_link_read_relocs_from_section (bfd *abfd,
              return FALSE;
            }
        }
-      else if (r_symndx != 0)
+      else if (r_symndx != STN_UNDEF)
        {
          (*_bfd_error_handler)
            (_("%B: non-zero symbol index (0x%lx) for offset 0x%lx in section `%A'"
@@ -9500,7 +9500,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
                     discarded section.  */
                  if ((sec = *ps) != NULL && elf_discarded_section (sec))
                    {
-                     BFD_ASSERT (r_symndx != 0);
+                     BFD_ASSERT (r_symndx != STN_UNDEF);
                      if (action_discarded & COMPLAIN)
                        (*finfo->info->callbacks->einfo)
                          (_("%X`%s' referenced in section `%A' of %B: "
@@ -9667,7 +9667,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
                      /* I suppose the backend ought to fill in the
                         section of any STT_SECTION symbol against a
                         processor specific section.  */
-                     r_symndx = 0;
+                     r_symndx = STN_UNDEF;
                      if (bfd_is_abs_section (sec))
                        ;
                      else if (sec == NULL || sec->owner == NULL)
@@ -9696,7 +9696,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
                          if (!bfd_is_abs_section (osec))
                            {
                              r_symndx = osec->target_index;
-                             if (r_symndx == 0)
+                             if (r_symndx == STN_UNDEF)
                                {
                                  struct elf_link_hash_table *htab;
                                  asection *oi;
@@ -9714,7 +9714,7 @@ elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd)
                                    }
                                }
 
-                             BFD_ASSERT (r_symndx != 0);
+                             BFD_ASSERT (r_symndx != STN_UNDEF);
                            }
                        }
 
@@ -11471,7 +11471,7 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_info *info, asection *sec,
   struct elf_link_hash_entry *h;
 
   r_symndx = cookie->rel->r_info >> cookie->r_sym_shift;
-  if (r_symndx == 0)
+  if (r_symndx == STN_UNDEF)
     return NULL;
 
   if (r_symndx >= cookie->locsymcount
index c8588b97511f93600fb06da8387995269277aa39..d78090983863065a6409b8c7ceb855e0111290a0 100644 (file)
@@ -4695,7 +4695,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
        case R_IA64_DIR64LSB:
          /* Install a dynamic relocation for this reloc.  */
          if ((dynamic_symbol_p || info->shared)
-             && r_symndx != 0
+             && r_symndx != STN_UNDEF
              && (input_section->flags & SEC_ALLOC) != 0)
            {
              unsigned int dyn_r_type;
@@ -4924,7 +4924,7 @@ elfNN_ia64_relocate_section (bfd *output_bfd,
        case R_IA64_PCREL64MSB:
        case R_IA64_PCREL64LSB:
          /* Install a dynamic relocation for this reloc.  */
-         if (dynamic_symbol_p && r_symndx != 0)
+         if (dynamic_symbol_p && r_symndx != STN_UNDEF)
            {
              BFD_ASSERT (srel != NULL);
 
index 1ee9289ff83d5f22d5425340ea3e6b6a9d679a24..a32a61371b947eb396cf6ce8d80507d9193fdf1b 100644 (file)
@@ -5282,7 +5282,7 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
               && h->root.def_dynamic
               && !h->root.def_regular
               && !h->has_static_relocs))
-         && r_symndx != 0
+         && r_symndx != STN_UNDEF
          && (h == NULL
              || h->root.root.type != bfd_link_hash_undefweak
              || ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT)
@@ -7752,7 +7752,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
        case R_MIPS_TLS_LDM:
          if (r_type == R_MIPS_TLS_LDM)
            {
-             r_symndx = 0;
+             r_symndx = STN_UNDEF;
              h = NULL;
            }
          /* Fall through */
@@ -7778,7 +7778,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
              }
            else
              {
-               BFD_ASSERT (flag == GOT_TLS_LDM || r_symndx != 0);
+               BFD_ASSERT (flag == GOT_TLS_LDM || r_symndx != STN_UNDEF);
 
                if (!mips_elf_record_local_got_symbol (abfd, r_symndx,
                                                       rel->r_addend,
@@ -7918,7 +7918,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
            case R_MIPS_HIGHEST:
              /* Don't refuse a high part relocation if it's against
                 no symbol (e.g. part of a compound relocation).  */
-             if (r_symndx == 0)
+             if (r_symndx == STN_UNDEF)
                break;
 
              /* R_MIPS_HI16 against _gp_disp is used for $gp setup,
This page took 0.066663 seconds and 4 git commands to generate.