X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf64-sparc.c;h=dc393b30295205289bee87f2cc080c7b8ca6482f;hb=d1778b88f8d8444f15ecf2dbbbf680c5659efb53;hp=77fc7e269f3042c0d587bf290db58fe26feab0eb;hpb=069f40e56f8ac85845312a4366afff828b026b7a;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf64-sparc.c b/bfd/elf64-sparc.c index 77fc7e269f..dc393b3029 100644 --- a/bfd/elf64-sparc.c +++ b/bfd/elf64-sparc.c @@ -1,5 +1,5 @@ /* SPARC-specific support for 64-bit ELF - Copyright (C) 1993, 95, 96, 97, 98, 99, 2000, 2001 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -2709,6 +2709,13 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) + == 0) + sym->st_value = 0; } }