On 09/28/2010 03:09 AM, Kai Tietz wrote:
> * config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Output
> addition zero for padding of secrel32 requested for 8 bytes.
>
> I will apply this today, if there aren't any objections.
I've committed the following instead, which I think is a bit tidier.
r~
* config/i386/cygming.h (ASM_OUTPUT_DWARF_OFFSET): Output 8 bytes
when 8 bytes are requested.
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 3fee731..ed6b459 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -96,11 +96,25 @@ along with GCC; see the file COPYING3. If not see
won't allow it. */
#define ASM_OUTPUT_DWARF_OFFSET(FILE, SIZE, LABEL, SECTION) \
do { \
- if (SIZE != 4 && (!TARGET_64BIT || SIZE != 8)) \
- abort (); \
- \
- fputs ("\t.secrel32\t", FILE); \
- assemble_name (FILE, LABEL); \
+ switch (SIZE) \
+ { \
+ case 4: \
+ fputs ("\t.secrel32\t", FILE); \
+ assemble_name (FILE, LABEL); \
+ break; \
+ case 8: \
+ /* This is a hack. There is no 64-bit section relative \
+ relocation. However, the COFF format also does not \
+ support 64-bit file offsets; 64-bit applications are \
+ limited to 32-bits of code+data in any one module. \
+ Fake the 64-bit offset by zero-extending it. */ \
+ fputs ("\t.secrel32\t", FILE); \
+ assemble_name (FILE, LABEL); \
+ fputs ("\n\t.long\t0", FILE); \
+ break; \
+ default: \
+ gcc_unreachable (); \
+ } \
} while (0)
#endif