This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: FIx elf_object_p (Re: bug in binutils 2.11.90.0.31 strip ?)


On Mon, Oct 15, 2001 at 09:40:27AM -0700, H . J . Lu wrote:
> On Mon, Oct 15, 2001 at 01:45:40AM -0700, Ryan Murray wrote:
> > On Mon, Oct 15, 2001 at 12:08:30AM -0700, H . J . Lu wrote:
> > > which is page aligned. I have no idea why it happens to you. If you
> > > can do
> > > 
> > > # tar cfz /tmp/libobjc.tar.gz libobjc/.libs
> > > 
> > > and send /tmp/libobjc.tar.gz to me, I will take a look.
> > 
> > Here it is...
> > 
> > Note that the Debian package builds the library twice, once with libgc support
> > and once without.
> 

I finally duplicate the problem. This patch seems to workd for me. I
don't think we should care about alignment for empty sections in this
case.


H.J.
----
2001-10-17  H.J. Lu <hjl@gnu.org>

	* elfcode.h (elf_object_p): Don't clear D_PAGED if the section
	is empty.

Index: elfcode.h
===================================================================
RCS file: /work/cvs/gnu/binutils/bfd/elfcode.h,v
retrieving revision 1.1.1.19
diff -u -p -r1.1.1.19 elfcode.h
--- elfcode.h	2001/10/15 18:08:11	1.1.1.19
+++ elfcode.h	2001/10/18 06:11:53
@@ -656,7 +656,8 @@ elf_object_p (abfd)
 
       /* If the section is loaded, but not page aligned, clear
          D_PAGED.  */
-      if ((i_shdrp[shindex].sh_flags & SHF_ALLOC) != 0
+      if (i_shdrp[shindex].sh_size != 0
+	  && (i_shdrp[shindex].sh_flags & SHF_ALLOC) != 0
 	  && i_shdrp[shindex].sh_type != SHT_NOBITS
 	  && (((i_shdrp[shindex].sh_addr - i_shdrp[shindex].sh_offset)
 	       % ebd->maxpagesize)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]