Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Apr 2002 22:16:56 -0800
From:      Darryl Okahata <darrylo@soco.agilent.com>
To:        Darryl Okahata <darrylo@soco.agilent.com>
Cc:        Mark Murray <mark@grondar.za>, Miguel Mendez <flynn@energyhq.homeip.net>, current@FreeBSD.ORG, ports@FreeBSD.ORG
Subject:   Re: rtld messing up?
Message-ID:  <200204040616.WAA13202@mina.soco.agilent.com>
In-Reply-To: Your message of "Wed, 03 Apr 2002 11:01:50 PST." <200204031901.LAA12554@mina.soco.agilent.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204040616.WAA13202>