This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: A typo in elfNN_ia64_choose_gp?
On Wed, Sep 10, 2003 at 11:44:43AM -0700, Richard Henderson wrote:
> On Wed, Sep 10, 2003 at 11:18:02AM -0700, H. J. Lu wrote:
> > [ 2] .note.ABI-tag NOTE 40000000000001e0 000001e0
> > 0000000000000020 0000000000000000 A 0 0 4
>
> And thirty-two bytes buys you what, exactly?
>
> You were the one concerned about the 0x2000_0000_0000_0000
> split between text and data in executables. I agreed that
> it would be a good idea to handle this properly. Why are
> you wasting my time with the freaking abi tag?
>
>
Like this?
H.J.
2003-09-10 H.J. Lu <hongjiu.lu@intel.com>
* elfxx-ia64.c (elfNN_ia64_choose_gp): Also skip non-program
sections and text sections for executables 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 12:00:35.000000000 -0700
@@ -3607,8 +3607,15 @@ 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. Also skip text
+ sections if we aren't creating shared library. */
+ if ((hdr->sh_type != SHT_PROGBITS && hdr->sh_type != SHT_NOBITS)
+ || (!info->shared && (hdr->sh_flags & SHF_EXECINSTR) != 0)
+ || (os->flags & SEC_ALLOC) == 0)
continue;
lo = os->vma;
@@ -4784,9 +4791,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 }