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 09:57:11AM -0700, Richard Henderson wrote:
> On Wed, Sep 10, 2003 at 07:50:28AM -0700, H. J. Lu wrote:
> > 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.
> 
> Please read the above instructions.  Please follow them.
> 
> 

Is there a need for a program to access non-program sections via gp?



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.
	(elfNN_ia64_special_sections): Mark all sections started
	with ".sbss" or "".sdata" as SHF_IA_64_SHORT.

--- bfd/elfxx-ia64.c.gp	2003-09-08 14:19:42.000000000 -0700
+++ bfd/elfxx-ia64.c	2003-09-10 10:46:31.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_type != SHT_NOBITS)
+	  || (os->flags & SEC_ALLOC) == 0)
 	continue;
 
       lo = os->vma;
@@ -4784,9 +4789,9 @@ elfNN_ia64_reloc_type_class (rela)
 
 static struct bfd_elf_special_section const elfNN_ia64_special_sections[]=
 {
-  { ".sbss",		0,	NULL,	0,
+  { ".sbss",		5,	NULL,	0,
     SHT_NOBITS,		SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
-  { ".sdata",		0,	NULL,	0,
+  { ".sdata",		6,	NULL,	0,
     SHT_PROGBITS,	SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT },
   { NULL,		0,	NULL,	0,
     0,			0 }


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