From owner-freebsd-current Wed Apr 3 22:17:19 2002 Delivered-To: freebsd-current@freebsd.org Received: from msgbas1.cos.agilent.com (msgbas1x.cos.agilent.com [192.25.240.36]) by hub.freebsd.org (Postfix) with ESMTP id B7A3D37B41E; Wed, 3 Apr 2002 22:17:03 -0800 (PST) Received: from msgrel1.cos.agilent.com (msgrel1.cos.agilent.com [130.29.152.77]) by msgbas1.cos.agilent.com (Postfix) with ESMTP id 35330BAC5; Wed, 3 Apr 2002 23:17:03 -0700 (MST) Received: from mina.soco.agilent.com (mina.soco.agilent.com [141.121.54.157]) by msgrel1.cos.agilent.com (Postfix) with ESMTP id 92FB61E7; Wed, 3 Apr 2002 23:17:02 -0700 (MST) Received: from mina.soco.agilent.com (darrylo@localhost [127.0.0.1]) by mina.soco.agilent.com (8.9.3 (PHNE_22672)/8.9.3 SMKit7.1.1_Agilent) with ESMTP id WAA13202; Wed, 3 Apr 2002 22:16:57 -0800 (PST) Message-Id: <200204040616.WAA13202@mina.soco.agilent.com> To: Darryl Okahata Cc: Mark Murray , Miguel Mendez , current@FreeBSD.ORG, ports@FreeBSD.ORG Subject: Re: rtld messing up? Reply-To: Darryl Okahata In-Reply-To: Your message of "Wed, 03 Apr 2002 11:01:50 PST." <200204031901.LAA12554@mina.soco.agilent.com> Mime-Version: 1.0 (generated by tm-edit 1.7) Content-Type: multipart/mixed; boundary="Multipart_Wed_Apr__3_22:16:55_2002-1" Content-Transfer-Encoding: 7bit Date: Wed, 03 Apr 2002 22:16:56 -0800 From: Darryl Okahata Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --Multipart_Wed_Apr__3_22:16:55_2002-1 Content-Type: text/plain; charset=US-ASCII [ cc'd to ports (re: ports/34661). The problem here is that "gcl", in ports/lang, is not building due to a core dump. This "patch" might fix it. ] I wrote: > > PR ports/34661 :-) > Using 4-STABLE (sorry, I'm not using -current), I took a quick stab > at the problem (having dealt with XEmacs undump issues in a past life), > but I haven't gotten anywhere, yet: Well, the problem appears to be that undump() isn't properly adjusting the ELF section headers. The bug also seems to exist in XEmacs (and probably GNU Emacs as well), but it's only triggered if a small section (less than 32 bytes in size) exists before the BSS section. Hacky, ugly, not-for-public-consumption kludgy patch attached. Apply in the "o" subdirectory. Line numbers will be off, but the patch should apply fine otherwise. Due to non-functioning makefile dependencies, you'll have to manually delete "o/unixsave.o" (or do a "make clean") after applying this patch. I'm not sure if the patch is 100% correct, but it should be close. I probably won't have any more time to clean up the patch (e.g., eliminate the code duplication and debugging code), and so it would be nice if someone else could do that and submit it. -- Darryl Okahata darrylo@soco.agilent.com DISCLAIMER: this message is the author's personal opinion and does not constitute the support, opinion, or policy of Agilent Technologies, or of the little green men that have been following him all day. --Multipart_Wed_Apr__3_22:16:55_2002-1 Content-Type: text/plain; type=patch; charset=US-ASCII Content-Disposition: attachment; filename="gcl.diffs" Content-Transfer-Encoding: quoted-printable *** unexelf.c.orig Thu Mar 22 14:54:58 2001 --- unexelf.c Wed Apr 3 21:48:40 2002 *************** *** 935,944 **** >=3D OLD_SECTION_H (old_bss_index-1).sh_offset) NEW_SECTION_H (nn).sh_offset +=3D new_data2_size; #else if (round_up (NEW_SECTION_H (nn).sh_offset, OLD_SECTION_H (old_bss_index).sh_addralign) ! >=3D new_data2_offset) NEW_SECTION_H (nn).sh_offset +=3D new_data2_size; #endif /* Any section that was originally placed after the section header table should now be off by the size of one section --- 948,972 ---- >=3D OLD_SECTION_H (old_bss_index-1).sh_offset) NEW_SECTION_H (nn).sh_offset +=3D new_data2_size; #else + # if 1 + if (round_up (NEW_SECTION_H (nn).sh_offset, + OLD_SECTION_H (nn).sh_addralign > 0 ? OLD_SECTION_H (nn).sh_addralig= n : 1) =3D=3D new_data2_offset && OLD_SECTION_H(nn).sh_size > 0 || + round_up (NEW_SECTION_H (nn).sh_offset, + OLD_SECTION_H (nn).sh_addralign > 0 ? OLD_SECTION_H (nn).sh_addralig= n : 1) + > new_data2_offset) { + # else if (round_up (NEW_SECTION_H (nn).sh_offset, OLD_SECTION_H (old_bss_index).sh_addralign) ! >=3D new_data2_offset) { ! # endif ! # ifdef DEBUG ! fprintf(stderr, ! "Rounding up section %d, old: 0x%08x, new: 0x%08x\n", ! nn, NEW_SECTION_H (nn).sh_offset, ! NEW_SECTION_H (nn).sh_offset + new_data2_size); ! # endif NEW_SECTION_H (nn).sh_offset +=3D new_data2_size; + } #endif /* Any section that was originally placed after the section header table should now be off by the size of one section --Multipart_Wed_Apr__3_22:16:55_2002-1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message