H.J's x86 fix for "nm -l" on shared libraries, applied to ppc too.
authorAlan Modra <amodra@gmail.com>
Thu, 20 Apr 2000 05:37:05 +0000 (05:37 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 20 Apr 2000 05:37:05 +0000 (05:37 +0000)
bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf32-ppc.c

index dfea4b851af51908fe7831e62a27bc2fdbf6fe43..9c1c3197a285b1ffc5a45b255f8b4535748ea88b 100644 (file)
@@ -1,3 +1,9 @@
+2000-04-20  H.J. Lu  <hjl@gnu.org>
+
+       * elf32-i386.c (elf_i386_relocate_section): Restrict 1998-12-10
+       patch to symbols defined by a shared object.
+       * elf32-ppc.c (ppc_elf_relocate_section): Similarly.
+
 2000-04-19  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
 
        K&R compiler fixes.
index 90efba8dc9bc824f2e0397f6eb3bb4fedf225d12..e4dbf9da0964a53328b142455dc4610b82c53eba 100644 (file)
@@ -1291,7 +1291,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section,
                             sections against symbols defined externally
                             in shared libraries.  We can't do anything
                             with them here.  */
-                         || (input_section->flags & SEC_DEBUGGING) != 0)))
+                         || ((input_section->flags & SEC_DEBUGGING) != 0
+                             && (h->elf_link_hash_flags
+                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0))))
                {
                  /* In these cases, we don't need the relocation
                      value.  We check specially because in some
index 242cfb730ab5f12fe792969c1f49ff10b5bf7958..db5b268424881368494e3eff24399805d3cb7dd4 100644 (file)
@@ -3043,7 +3043,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section,
                              It's here to avoid a crash when
                              generating a shared library with DWARF
                              debugging information.  */
-                         || (input_section->flags & SEC_DEBUGGING) != 0)
+                         || ((input_section->flags & SEC_DEBUGGING) != 0
+                             && (h->elf_link_hash_flags
+                                 & ELF_LINK_HASH_DEF_DYNAMIC) != 0))
                      && (r_type == R_PPC_ADDR32
                          || r_type == R_PPC_ADDR24
                          || r_type == R_PPC_ADDR16