+#ifdef __GNUC__
+#define GET_SCNHDR_NLNNO(ABFD, LOC) \
+ ({ \
+ int nlnno; \
+ char * ptr = (LOC); \
+ if (COFF2_P (ABFD)) \
+ nlnno = H_GET_32 (ABFD, ptr); \
+ else \
+ nlnno = H_GET_16 (ABFD, ptr - 2); \
+ nlnno; \
+ })
+#define PUT_SCNHDR_NLNNO(ABFD, VAL, LOC) \
+ do \
+ { \
+ char * ptr = (LOC); \
+ if (COFF2_P (ABFD)) \
+ H_PUT_32 (ABFD, VAL, ptr); \
+ else \
+ H_PUT_16 (ABFD, VAL, ptr - 2); \
+ } \
+ while (0)
+#define GET_SCNHDR_FLAGS(ABFD, LOC) \
+ ({ \
+ int flags; \
+ char * ptr = (LOC); \
+ if (COFF2_P (ABFD)) \
+ flags = H_GET_32 (ABFD, ptr); \
+ else \
+ flags = H_GET_16 (ABFD, ptr - 4); \
+ flags; \
+ })
+#define PUT_SCNHDR_FLAGS(ABFD, VAL, LOC) \
+ do \
+ { \
+ char * ptr = (LOC); \
+ if (COFF2_P (ABFD)) \
+ H_PUT_32 (ABFD, VAL, ptr); \
+ else \
+ H_PUT_16 (ABFD, VAL, ptr - 4); \
+ } \
+ while (0)
+#define GET_SCNHDR_PAGE(ABFD, LOC) \
+ ({ \
+ unsigned page; \
+ char * ptr = (LOC); \
+ if (COFF2_P (ABFD)) \
+ page = H_GET_16 (ABFD, ptr); \
+ else \
+ page = (unsigned) H_GET_8 (ABFD, ptr - 7); \
+ page; \
+ })
+/* On output, make sure that the "reserved" field is zero. */
+#define PUT_SCNHDR_PAGE(ABFD, VAL, LOC) \
+ do \
+ { \
+ char * ptr = (LOC); \
+ if (COFF2_P (ABFD)) \
+ H_PUT_16 (ABFD, VAL, ptr); \
+ else \
+ { \
+ H_PUT_8 (ABFD, VAL, ptr - 7); \
+ H_PUT_8 (ABFD, 0, ptr - 8); \
+ } \
+ } \
+ while (0)
+#else