This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[committed] fix ia64 vms .note generation
- From: Tristan Gingold <gingold at adacore dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Tue, 19 Jan 2010 10:14:32 +0100
- Subject: [committed] fix ia64 vms .note generation
Hi,
contrary to the generic ELF ABI, on ia64 VMS the .note header is 24 bytes long. I am committing this
patch to fix the gas generated note section.
Tristan.
gas/
2010-01-18 Tristan Gingold <gingold@adacore.com>
* config/tc-ia64.c (ia64_vms_note): Generate 24 bytes note headers.
*** config/tc-ia64.c 11 Dec 2009 13:42:10 -0000 1.211
--- config/tc-ia64.c 19 Jan 2010 09:12:29 -0000
***************
*** 11699,11705 ****
char *p;
asection *seg = now_seg;
subsegT subseg = now_subseg;
- Elf_Internal_Note i_note;
asection *secp = NULL;
char *bname;
char buf [256];
--- 11699,11704 ----
***************
*** 11712,11750 ****
secp,
SEC_HAS_CONTENTS | SEC_READONLY);
! /* Module header note. */
bname = xstrdup (lbasename (out_file_name));
if ((p = strrchr (bname, '.')))
*p = '\0';
!
! i_note.namesz = 8;
! i_note.descsz = 40 + strlen (bname);
! i_note.type = NT_VMS_MHD;
!
! p = frag_more (sizeof (i_note.namesz));
! number_to_chars_littleendian (p, i_note.namesz, 8);
!
! p = frag_more (sizeof (i_note.descsz));
! number_to_chars_littleendian (p, i_note.descsz, 8);
!
! p = frag_more (sizeof (i_note.type));
! number_to_chars_littleendian (p, i_note.type, 8);
p = frag_more (8);
strcpy (p, "IPF/VMS");
! get_vms_time (buf);
! p = frag_more (17);
! strcpy (p, buf);
!
! p = frag_more (17);
! strcpy (p, "24-FEB-2005 15:00");
!
! p = frag_more (strlen (bname) + 1);
strcpy (p, bname);
free (bname);
-
- p = frag_more (5);
strcpy (p, "V1.0");
frag_align (3, 0, 0);
--- 11711,11737 ----
secp,
SEC_HAS_CONTENTS | SEC_READONLY);
! /* Module header note (MHD). */
bname = xstrdup (lbasename (out_file_name));
if ((p = strrchr (bname, '.')))
*p = '\0';
!
! /* VMS note header is 24 bytes long. */
! p = frag_more (8 + 8 + 8);
! number_to_chars_littleendian (p + 0, 8, 8);
! number_to_chars_littleendian (p + 8, 40 + strlen (bname), 8);
! number_to_chars_littleendian (p + 16, NT_VMS_MHD, 8);
p = frag_more (8);
strcpy (p, "IPF/VMS");
! p = frag_more (17 + 17 + strlen (bname) + 1 + 5);
! get_vms_time (p);
! strcpy (p + 17, "24-FEB-2005 15:00");
! p += 17 + 17;
strcpy (p, bname);
+ p += strlen (bname) + 1;
free (bname);
strcpy (p, "V1.0");
frag_align (3, 0, 0);
***************
*** 11753,11770 ****
sprintf (buf, "GNU assembler version %s (%s) using BFD version %s",
VERSION, TARGET_ALIAS, BFD_VERSION_STRING);
! i_note.namesz = 8;
! i_note.descsz = 1 + strlen (buf);
! i_note.type = NT_VMS_LNM;
!
! p = frag_more (sizeof (i_note.namesz));
! number_to_chars_littleendian (p, i_note.namesz, 8);
!
! p = frag_more (sizeof (i_note.descsz));
! number_to_chars_littleendian (p, i_note.descsz, 8);
!
! p = frag_more (sizeof (i_note.type));
! number_to_chars_littleendian (p, i_note.type, 8);
p = frag_more (8);
strcpy (p, "IPF/VMS");
--- 11740,11749 ----
sprintf (buf, "GNU assembler version %s (%s) using BFD version %s",
VERSION, TARGET_ALIAS, BFD_VERSION_STRING);
! p = frag_more (8 + 8 + 8);
! number_to_chars_littleendian (p + 0, 8, 8);
! number_to_chars_littleendian (p + 8, strlen (buf) + 1, 8);
! number_to_chars_littleendian (p + 16, NT_VMS_LNM, 8);
p = frag_more (8);
strcpy (p, "IPF/VMS");