Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so Workaround for binutils 2.11 behavior.



details:   https://anonhg.NetBSD.org/src/rev/9bd2e249d21b
branches:  trunk
changeset: 513834:9bd2e249d21b
user:      eeh <eeh%NetBSD.org@localhost>
date:      Tue Aug 14 20:17:25 2001 +0000

description:
Workaround for binutils 2.11 behavior.

diffstat:

 libexec/ld.elf_so/reloc.c |  25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diffs (39 lines):

diff -r e33af3d3d38c -r 9bd2e249d21b libexec/ld.elf_so/reloc.c
--- a/libexec/ld.elf_so/reloc.c Tue Aug 14 20:16:38 2001 +0000
+++ b/libexec/ld.elf_so/reloc.c Tue Aug 14 20:17:25 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: reloc.c,v 1.40 2001/07/16 05:40:53 matt Exp $   */
+/*     $NetBSD: reloc.c,v 1.41 2001/08/14 20:17:25 eeh Exp $    */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -594,6 +594,29 @@
                rela = &ourrela;
        } else {
                rela = (const Elf_Rela *)((caddr_t) obj->pltrela + reloff);
+#ifdef __sparc64__
+               if (ELF_R_TYPE(obj->pltrela->r_info) == R_TYPE(JMP_SLOT)) {
+                       /*
+                        * XXXX
+                        *
+                        * The first for PLT entries are reserved.  There
+                        * is some disagreement whether they should have
+                        * associated relocation entries.  Both the SPARC
+                        * 32-bit and 64-bit ELF specifications say that
+                        * they should have relocation entries, but the 
+                        * 32-bit SPARC binutils do not generate them,
+                        * and now the 64-bit SPARC binutils have stopped
+                        * generating them too.
+                        * 
+                        * So, to provide binary compatibility, we will
+                        * check the first entry, if it is reserved it
+                        * should not be of the type JMP_SLOT.  If it
+                        * is JMP_SLOT, then the 4 reserved entries were
+                        * not generated and our index is 4 entries too far.
+                        */
+                       rela -= 4;
+               }
+#endif
        }
 
        if (_rtld_relocate_plt_object(obj, rela, &addr, true, true) < 0)



Home | Main Index | Thread Index | Old Index