This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Patch: HP-UX specific IA64 vector.
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Steve Ellcey <sje at cup dot hp dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 19 Dec 2001 12:42:37 +1030
- Subject: Re: Patch: HP-UX specific IA64 vector.
- References: <200112181849.KAA12661@hpsje.cup.hp.com>
On Tue, Dec 18, 2001 at 10:49:36AM -0800, Steve Ellcey wrote:
>
> 2001-12-11 Steve Ellcey <sje@cup.hp.com>
>
> * config.bfd (bfd_elf32_ia64_hpux_big_vec, bfd_elf64_ia64_hpux_big_vec):
> New Vectors for ia64*-*-hpux* target.
> * targets.c: Ditto.
> * configure.in: Ditto.
> * configure: Regenerate
> * elfxx-ia64.c: Replace use of alloca with bfd_malloc.
> Set hp-ux specific values for IA64 HP-UX vector.
> (elfNN_hpux_post_process_headers): New function.
I'm about to commit this, with a tweak here:
> @@ -1104,11 +1106,15 @@ elfNN_ia64_final_write_processing (abfd,
> {
> /* .gnu.linkonce.ia64unw.FOO -> .gnu.linkonce.t.FOO */
> size_t len2 = sizeof (".gnu.linkonce.t.") - 1;
> - char *once_name = alloca (len2 + strlen (sname) - len + 1);
> + char *once_name = bfd_malloc (len2 + strlen (sname) - len + 1);
>
> - memcpy (once_name, ".gnu.linkonce.t.", len2);
> - strcpy (once_name + len2, sname + len);
> - text_sect = bfd_get_section_by_name (abfd, once_name);
> + if (once_name != NULL)
> + {
> + memcpy (once_name, ".gnu.linkonce.t.", len2);
> + strcpy (once_name + len2, sname + len);
> + text_sect = bfd_get_section_by_name (abfd, once_name);
> + free (once_name);
> + }
adding..
else
/* Should only happen if we run out of memory, in
which case we're probably toast anyway. Try to
cope by finding the section the slow way. */
for (text_sect = abfd->sections;
text_sect != NULL;
text_sect = text_sect->next)
{
if (strncmp (bfd_section_name (abfd, text_sect),
".gnu.linkonce.t.", len2) == 0
&& strcmp (bfd_section_name (abfd, text_sect) + len2,
sname + len) == 0)
break;
}