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]
Other format: [Raw text]

Re: A typo in elfNN_ia64_choose_gp?


On Wed, Sep 10, 2003 at 12:16:52AM -0700, Richard Henderson wrote:
> On Tue, Sep 09, 2003 at 10:43:51PM -0700, H. J. Lu wrote:
> > How about this patch?
> 
> No.  Please do exactly watch something akin to min_data_vma.
> If, for some reason, I wish to take the code address of a 
> function, and it's in range, I should be able to.
> 

This patch only skips non-program sections.


H.J.
---
2003-09-10  H.J. Lu  <hongjiu.lu@intel.com>

	* elfxx-ia64.c (elfNN_ia64_choose_gp): Also skip non-program
	sections when choosing gp.

--- bfd/elfxx-ia64.c.gp	2003-09-08 14:19:42.000000000 -0700
+++ bfd/elfxx-ia64.c	2003-09-10 07:40:45.000000000 -0700
@@ -3607,8 +3607,13 @@ elfNN_ia64_choose_gp (abfd, info)
   for (os = abfd->sections; os ; os = os->next)
     {
       bfd_vma lo, hi;
+      Elf_Internal_Shdr *hdr;
 
-      if ((os->flags & SEC_ALLOC) == 0)
+      hdr = &elf_section_data (os)->this_hdr;
+
+      /* Skip non-program and non-alloc sections.  */
+      if (hdr->sh_type != SHT_PROGBITS
+	  || (hdr->sh_flags | SHF_ALLOC) == 0)
 	continue;
 
       lo = os->vma;
@@ -3620,7 +3625,7 @@ elfNN_ia64_choose_gp (abfd, info)
 	min_vma = lo;
       if (max_vma < hi)
 	max_vma = hi;
-      if (os->flags & SEC_SMALL_DATA)
+      if (hdr->sh_flags | SHF_IA_64_SHORT)
 	{
 	  if (min_short_vma > lo)
 	    min_short_vma = lo;


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