[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/594] ld refuses to put data into PT_NOTE segment
From: |
nickc at redhat dot com |
Subject: |
[Bug ld/594] ld refuses to put data into PT_NOTE segment |
Date: |
7 Feb 2005 17:54:46 -0000 |
------- Additional Comments From nickc at redhat dot com 2005-02-07 17:54
-------
Subject: Re: ld refuses to put data into PT_NOTE segment
Hi Paul,
Please could you try out the attached small patch and see if this
fixed things for you.
Cheers
Nick
Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.264
diff -c -3 -p -r1.264 elf.c
*** bfd/elf.c 6 Feb 2005 23:21:44 -0000 1.264
--- bfd/elf.c 7 Feb 2005 17:53:16 -0000
*************** assign_file_positions_for_segments (bfd
*** 4163,4168 ****
--- 4163,4169 ----
/* The section VMA must equal the file position
modulo the page size. */
bfd_size_type page = align;
+
if ((abfd->flags & D_PAGED) != 0)
page = bed->maxpagesize;
adjust = vma_page_aligned_bias (sec->vma,
*************** assign_file_positions_for_segments (bfd
*** 4222,4227 ****
--- 4223,4234 ----
p->p_filesz += sec->size;
p->p_memsz += sec->size;
}
+ /* PR ld/594: Sections in note segments which are not loaded
+ contribute to the file size but not the in-memory size. */
+ else if (p->p_type == PT_NOTE
+ && (flags & SEC_HAS_CONTENTS) != 0)
+ p->p_filesz += sec->size;
+
/* .tbss is special. It doesn't contribute to p_memsz of
normal segments. */
else if ((flags & SEC_THREAD_LOCAL) == 0
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=594
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/594] ld refuses to put data into PT_NOTE segment,
nickc at redhat dot com <=