# HG changeset patch # User Richard M. Stallman # Date 806100153 0 # Node ID 462dd843fd8ccca5d3c7ad069b10418e09d511f5 # Parent 73ac42b9be24f5bd039543a3ba9bac89dee5aa81 (unexec): If not SUNOS4_SHARED_LIBRARIES or if apparently not dynamically linked, just clear rel and erel. diff -r 73ac42b9be24 -r 462dd843fd8c src/unexsunos4.c --- a/src/unexsunos4.c Tue Jul 18 19:16:16 1995 +0000 +++ b/src/unexsunos4.c Tue Jul 18 20:42:33 1995 +0000 @@ -215,10 +215,14 @@ unsigned long daddr = N_DATADDR (ohdr); unsigned long rel, erel; #ifdef SUNOS4 +#ifdef SUNOS4_SHARED_LIBRARIES extern struct link_dynamic _DYNAMIC; /* SunOS4.x's ld_rel is relative to N_TXTADDR. */ - if (_DYNAMIC.ld_version < 2) + if (!ohdr.a_dynamic) + /* This was statically linked. */ + rel = erel = 0; + else if (_DYNAMIC.ld_version < 2) { rel = _DYNAMIC.ld_un.ld_1->ld_rel + N_TXTADDR (ohdr); erel = _DYNAMIC.ld_un.ld_1->ld_hash + N_TXTADDR (ohdr); @@ -228,6 +232,9 @@ rel = _DYNAMIC.ld_un.ld_2->ld_rel + N_TXTADDR (ohdr); erel = _DYNAMIC.ld_un.ld_2->ld_hash + N_TXTADDR (ohdr); } +#else /* not SUNOS4_SHARED_LIBRARIES */ + rel = erel = 0; +#endif /* not SUNOS4_SHARED_LIBRARIES */ #ifdef sparc #define REL_INFO_TYPE struct reloc_info_sparc #else