This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Pack Elf_External_Note
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: binutils at sources dot redhat dot com
- Date: Thu, 29 Jan 2004 10:49:39 -0500
- Subject: Pack Elf_External_Note
Something I mentioned four months ago. Alan fixed the only place in BFD
that I know of which assumed the size of this structure, but the extra
packed attribute is a guard against future problems.
OK?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
2004-01-29 Daniel Jacobowitz <drow@mvista.com>
* elf/external.h (Elf_External_Note): Add packed attribute.
Index: external.h
===================================================================
RCS file: /cvs/src/src/include/elf/external.h,v
retrieving revision 1.5
diff -u -p -r1.5 external.h
--- external.h 21 May 2003 00:55:15 -0000 1.5
+++ external.h 29 Jan 2004 15:47:49 -0000
@@ -154,7 +154,11 @@ typedef struct {
unsigned char descsz[4]; /* Size of the note descriptor */
unsigned char type[4]; /* Interpretation of the descriptor */
char name[1]; /* Start of the name+desc data */
-} Elf_External_Note;
+}
+#ifdef __GNUC__
+ __attribute__ ((packed))
+#endif
+ Elf_External_Note;
/* Relocation Entries */
typedef struct {