aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1995-05-12 18:55:06 +0000
committerSteve Chamberlain <sac@cygnus>1995-05-12 18:55:06 +0000
commit3f38a017be911b803f3a06d86dc77db6ccecc9f0 (patch)
tree8bfc5c87d9ec292e6916a376506d6a28b5f3a243 /ld/ldlang.c
parent48b2d07e4c59bbbaacf6face47e2eafac2271092 (diff)
downloadgdb-3f38a017be911b803f3a06d86dc77db6ccecc9f0.zip
gdb-3f38a017be911b803f3a06d86dc77db6ccecc9f0.tar.gz
gdb-3f38a017be911b803f3a06d86dc77db6ccecc9f0.tar.bz2
Fri May 12 11:03:55 1995 Steve Chamberlain <sac@slash.cygnus.com>
Tom Griest <griest@cs.yale.edu> Initial support for PE executables (eg NT, win32) * Makefile.in (configure.in, ei386pe): Add support. * ldmain.c (main): Initialize PE argument info. * ldwrite.c (print_file_stuff): Don't print out .drectve and .debug section info. * lexsup.c (set_subsystem, set_stack_heap, OPTION_HEAP, OPTION_SUBSYSTEM, parse_argsm set_subsystem, set_stack_heap): Handle new arguments. * config/i386-pe.mt, emultempl/i386pe.em, scripttempl/i386pe.sc: New files
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index f7847d3..3c9350d 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -2752,6 +2752,21 @@ lang_section_start (name, address)
called by ENTRY in a linker script. Command line arguments take
precedence. */
+/* WINDOWS_NT. When an entry point has been specified, we will also force
+ this symbol to be defined by calling ldlang_add_undef (equivalent to
+ having switch -u entry_name on the command line). The reason we do
+ this is so that the user doesn't have to because they would have to use
+ the -u switch if they were specifying an entry point other than
+ _mainCRTStartup. Specifically, if creating a windows application, entry
+ point _WinMainCRTStartup must be specified.
+ What I have found for non console applications (entry not _mainCRTStartup)
+ is that the .obj that contains mainCRTStartup is brought in since it is
+ the first encountered in libc.lib and it has other symbols in it which will
+ be pulled in by the link process. To avoid this, adding -u with the entry
+ point name specified forces the correct .obj to be used. We can avoid
+ making the user do this by always adding the entry point name as an
+ undefined symbol. */
+
void
lang_add_entry (name, cmdline)
CONST char *name;
@@ -2766,6 +2781,14 @@ lang_add_entry (name, cmdline)
entry_symbol = name;
from_cmdline = cmdline;
}
+#ifdef 0 /* WINDOWS_NT */
+ /* don't do this yet. It seems to work (the executables run), but the
+ image created is very different from what I was getting before indicating
+ that something else is being pulled in. When everything else is working,
+ then try to put this back in to see if it will do the right thing for
+ other more complicated applications */
+ ldlang_add_undef (name);
+#endif
}
void