Article View: comp.sys.ibm.pc.rt
Article #217Patch for /usr/src/bin/ld.c
From: brunner
Date: Tue, 08 Aug 1989 23:02
Date: Tue, 08 Aug 1989 23:02
98 lines
3382 bytes
3382 bytes
Subject: Fix for ld(1) stabs relocation error
Index: /usr/src/bin/ld.c
Description:
correct relocation error on stabs for functions
Fix:
Apply the following patch
*** ld.c Tue Aug 8 14:16:03 1989
--- ld.c.fix Tue Aug 8 14:16:17 1989
***************
*** 1,5 ****
/*
! * P_R_P_Q_# (C) COPYRIGHT IBM CORPORATION 1988
* LICENSED MATERIALS - PROPERTY OF IBM
* REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
*/
--- 1,5 ----
/*
! * P_R_P_Q_# (C) COPYRIGHT IBM CORPORATION 1988,1989
* LICENSED MATERIALS - PROPERTY OF IBM
* REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
*/
***************
*** 9,15 ****
* specifies the terms and conditions for redistribution.
*/
#ifndef lint
! static char rcsid[] = "$Header: ld.c,v 12.0 88/11/09 16:36:26 root dec88 $";
#endif
/* $Source: /site/src/bin/RCS/ld.c,v $ */
--- 9,15 ----
* specifies the terms and conditions for redistribution.
*/
#ifndef lint
! static char rcsid[] = "$Header: ld.c,v 12.1 89/04/06 12:41:54 james Exp $";
#endif
/* $Source: /site/src/bin/RCS/ld.c,v $ */
***************
*** 1738,1745 ****
cursym.n_un.n_name = curstr + cursym.n_un.n_strx;
}
/* inline expansion of symreloc() */
- switch (cursym.n_type & 017) {
case N_TEXT:
case N_EXT+N_TEXT:
cursym.n_value += ctrel;
--- 1738,1754 ----
cursym.n_un.n_name = curstr + cursym.n_un.n_strx;
}
/* inline expansion of symreloc() */
+ #ifndef ibm370
+ /* In the RT linkage, function addresses are in data, not text.
+ * The following kluge on n_type relocates function stabs into data
+ * rather than text. 0x24 would have been N_FUN had we included stabs.h.
+ */
+ switch ((cursym.n_type == 0x24) ? N_DATA : cursym.n_type & 0x0f) {
+ #endif ibm370
+ #ifdef ibm370
+ switch (cursym.n_type & 0x0f) {
+ #endif ibm370
case N_TEXT:
case N_EXT+N_TEXT:
cursym.n_value += ctrel;
***************
*** 2543,2551 ****
symreloc()
{
! if(funding) return;
! switch (cursym.n_type & 017) {
!
case N_TEXT:
case N_EXT+N_TEXT:
cursym.n_value += ctrel;
--- 2552,2568 ----
symreloc()
{
! if(funding) return;
! #ifndef ibm370
! /* In the RT linkage, function addresses are in data, not text.
! * The following kluge on n_type relocates function stabs into data
! * rather that text. 0x24 would have been N_FUN had we included stabs.h.
! */
! switch ((cursym.n_type == 0x24) ? N_DATA : cursym.n_type & 0x0f) {
! #endif ibm370
! #ifdef ibm370
! switch (cursym.n_type & 0x0f) {
! #endif ibm370
case N_TEXT:
case N_EXT+N_TEXT:
cursym.n_value += ctrel;
Technical Details
Message-ID:
<1676@ibmpa.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!pacbell!ames!bionet!csd4.milw.wisc.edu!cs.utexas.edu!uunet!ibmpa!bullhead!brunnerShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!att!pacbell!ames!bionet!csd4.milw.wisc.edu!cs.utexas.edu!uunet!ibmpa!bullhead!brunner From: brunner@bullhead.uucp Newsgroups: comp.sys.ibm.pc.rt Subject: Patch for /usr/src/bin/ld.c Summary: fixes relocation error Keywords: V1.10 Message-ID: <1676@ibmpa.UUCP> Date: 8 Aug 89 23:02:17 GMT Sender: news@ibmpa.UUCP Reply-To: brunner@ibmsupt.UUCP (Eric Brunner) Organization: IBM AWD Palo Alto Lines: 98