elfcore_write_note

Alan Modra amodra@bigpond.net.au
Mon Oct 30 14:58:00 GMT 2006


This makes elfcore_write_note agree with elfcore_read_notes regarding
the alignment of note fields.  We don't comply with the current draft
gabi, see http://sourceware.org/ml/binutils/2003-09/msg00300.html, and
the pad was wrong anyway.

	* elf.c (elfcore_write_note): Pad to 4-byte boundary.

Index: bfd/elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.362
diff -u -p -r1.362 elf.c
--- bfd/elf.c	27 Oct 2006 04:15:50 -0000	1.362
+++ bfd/elf.c	29 Oct 2006 23:24:53 -0000
@@ -8120,7 +8120,7 @@ elfcore_write_note (bfd  *abfd,
 
       namesz = strlen (name) + 1;
       bed = get_elf_backend_data (abfd);
-      pad = -namesz & ((1 << bed->s->log_file_align) - 1);
+      pad = -namesz & 3;
     }
 
   newspace = 12 + namesz + pad + size;

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list