This is the mail archive of the binutils@sourceware.org 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]

elfcore_write_note


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


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