+2004-05-07 Brian Ford <ford@vss.fsi.com>
+ DJ Delorie <dj@redhat.com>
+
+ * emultempl/pe.em (real_flags): New static.
+ (OPTION_LARGE_ADDRESS_AWARE): New define.
+ (gld${EMULATION_NAME}_add_options): Add --large-address-aware option.
+ (gld_${EMULATION_NAME}_list_options): Likewise.
+ (gld${EMULATION_NAME}_handle_option): Likewise.
+ (gld_${EMULATION_NAME}_after_open): Pass real_flags to PE private data.
+ * ld.texinfo: Document it.
+ * NEWS: Mention it.
+
2004-05-07 Brian Ford <ford@vss.fsi.com>
* NEWS: Mention DWARF 2 support for i386pe.
#include "ldctor.h"
#include "coff/internal.h"
+/* FIXME: See bfd/peXXigen.c for why we include an architecture specific
+ header in generic PE code. */
+#include "coff/i386.h"
+#include "coff/pe.h"
+
/* FIXME: This is a BFD internal header file, and we should not be
using it here. */
#include "../bfd/libcoff.h"
static struct internal_extra_pe_aouthdr pe;
static int dll;
+static flagword real_flags = 0;
static int support_old_code = 0;
static char * thumb_entry_symbol = NULL;
static lang_assignment_statement_type *image_base_statement = 0;
(OPTION_EXCLUDE_LIBS + 1)
#define OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC \
(OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC + 1)
+#define OPTION_LARGE_ADDRESS_AWARE \
+ (OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC + 1)
static void
gld${EMULATION_NAME}_add_options
{"enable-runtime-pseudo-reloc", no_argument, NULL, OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC},
{"disable-runtime-pseudo-reloc", no_argument, NULL, OPTION_DLL_DISABLE_RUNTIME_PSEUDO_RELOC},
#endif
+ {"large-address-aware", no_argument, NULL, OPTION_LARGE_ADDRESS_AWARE},
{NULL, no_argument, NULL, 0}
};
fprintf (file, _(" --enable-extra-pe-debug Enable verbose debug output when building\n\
or linking to DLLs (esp. auto-import)\n"));
#endif
+ fprintf (file, _(" --large-address-aware Executable supports virtual addresses\n\
+ greater than 2 gigabytes\n"));
}
pe_dll_extra_pe_debug = 1;
break;
#endif
+ case OPTION_LARGE_ADDRESS_AWARE:
+ real_flags |= IMAGE_FILE_LARGE_ADDRESS_AWARE;
+ break;
}
return TRUE;
}
pe_data (output_bfd)->pe_opthdr = pe;
pe_data (output_bfd)->dll = init[DLLOFF].value;
+ pe_data (output_bfd)->real_flags |= real_flags;
#ifdef DLL_SUPPORT
if (pe_enable_stdcall_fixup) /* -1=warn or 1=disable */
symbols before they are exported.
[This option is specific to the i386 PE targeted port of the linker]
+@kindex --large-address-aware
+@item --large-address-aware
+If given, the appropriate bit in the ``Charateristics'' field of the COFF
+header is set to indicate that this executable supports virtual addresses
+greater than 2 gigabytes. This should be used in conjuction with the /3GB
+or /USERVA=@var{value} megabytes switch in the ``[operating systems]''
+section of the BOOT.INI. Otherwise, this bit has no effect.
+[This option is specific to PE targeted ports of the linker]
+
@kindex --major-image-version
@item --major-image-version @var{value}
Sets the major number of the ``image version''. Defaults to 1.