* elflink.h (elf_gc_common_finalize_got_offsets): For backends
authorRichard Henderson <rth@redhat.com>
Mon, 10 Aug 1998 22:35:02 +0000 (22:35 +0000)
committerRichard Henderson <rth@redhat.com>
Mon, 10 Aug 1998 22:35:02 +0000 (22:35 +0000)
        that use a .got.plt section start the got offset at zero.

bfd/ChangeLog
bfd/elflink.h

index 44c9b6fe1f6f4192173a54f155fc641112b6aa7d..d131eeea442e0e27904a38393ed1de169392263b 100644 (file)
@@ -1,3 +1,8 @@
+Mon Aug 10 15:31:39 1998  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+
+       * elflink.h (elf_gc_common_finalize_got_offsets): For backends
+       that use a .got.plt section start the got offset at zero.
+
 Mon Aug 10 17:31:21 1998  Ian Lance Taylor  <ian@cygnus.com>
 
        * ieee.c (ieee_write_processor): Correct the processor ID written
index 65b828cad751fd1af7ebe7a920174c58fdfee650..67493cbde11a0bbf7033798b6940ae7c58cda208 100644 (file)
@@ -5803,7 +5803,15 @@ elf_gc_common_finalize_got_offsets (abfd, info)
      struct bfd_link_info *info;
 {
   bfd *i;
-  bfd_vma gotoff = get_elf_backend_data (abfd)->got_header_size;
+  struct elf_backend_data *bed = get_elf_backend_data (abfd);
+  bfd_vma gotoff;
+
+  /* The GOT offset is relative to the .got section, but the GOT header is
+     put into the .got.plt section, if the backend uses it.  */
+  if (bed->want_got_plt)
+    gotoff = 0;
+  else
+    gotoff = bed->got_header_size;
 
   /* Do the local .got entries first.  */
   for (i = info->input_bfds; i; i = i->link_next)