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]

[z80][committed] store alignment requirement in section header section


Hi,

I have committed the patch below, which uses some bits of the flag field in the 
section header of a z80-coff section to store the alignment. This is needed to 
make z80 ld maintain alignment specified in assembly files.
Older z80-coff files will have the minimal alignment.

Arnold Metselaar

include/coff/ChangeLog:
	* z80.h: Store alignment requirement in section header, to allow
	ld to preserve alignment. Some code was copied from ti.h. 

Index: include/coff/z80.h
===================================================================
RCS file: /cvs/src/src/include/coff/z80.h,v
retrieving revision 1.1
diff -u -p -r1.1 z80.h
--- include/coff/z80.h  25 Oct 2005 17:40:19 -0000      1.1
+++ include/coff/z80.h  17 Oct 2009 18:02:44 -0000
@@ -30,6 +30,15 @@
 /* Type of cpu is stored in flags.  */
 #define F_MACHMASK 0xF000

+/* Z80 COFF encodes the section alignment in the section header flags */
+#define COFF_ALIGN_IN_SECTION_HEADER 1
+#define COFF_ALIGN_IN_S_FLAGS 1
+#define F_ALGNMASK 0x0F00
+/* requires a power-of-two argument */
+#define COFF_ENCODE_ALIGNMENT(S,X) ((S).s_flags |= (((unsigned)(X)&0xF)<<8))
+/* result is a power of two */
+#define COFF_DECODE_ALIGNMENT(X) (((X)>>8)&0xF)
+
 #define        Z80MAGIC   0x805A

 #define Z80BADMAG(x) (((x).f_magic != Z80MAGIC))


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