diff options
author | Ian Lance Taylor <ian@airs.com> | 1996-10-09 03:27:41 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1996-10-09 03:27:41 +0000 |
commit | d0d63887aa047c4c6601102b7a5dabf1c1ae9c14 (patch) | |
tree | e0ace5bdb8ce55da543b9cce233bb3ce273b94aa | |
parent | 99283e87795668b28a6d089bf59ecc87470900c9 (diff) | |
download | binutils-d0d63887aa047c4c6601102b7a5dabf1c1ae9c14.zip binutils-d0d63887aa047c4c6601102b7a5dabf1c1ae9c14.tar.gz binutils-d0d63887aa047c4c6601102b7a5dabf1c1ae9c14.tar.bz2 |
* emultempl/pe.em (set_pe_subsystem): When setting the subsystem
to windows, set the entry point.
-rw-r--r-- | ld/ChangeLog | 3 | ||||
-rw-r--r-- | ld/emultempl/pe.em | 23 |
2 files changed, 26 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index b916086..d0cd9cc 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,8 @@ Tue Oct 8 12:07:13 1996 Ian Lance Taylor <ian@cygnus.com> + * emultempl/pe.em (set_pe_subsystem): When setting the subsystem + to windows, set the entry point. + * Makefile.in (ldlex.c): Don't pass any options to $(LEX). Mon Oct 7 17:29:05 1996 Ian Lance Taylor <ian@cygnus.com> diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index 1f83102..838a010 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -192,6 +192,29 @@ set_pe_subsystem () if (!strcmp (optarg, v[i].name)) { set_pe_name ("__subsystem__", v[i].value); + + /* If the subsystem is windows, we use a different entry + point. We also register the entry point as an undefined + symbol. 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. */ + if (v[i].value == 2) + { + lang_add_entry ("_WinMainCRTStartup", 1); + ldlang_add_undef ("_WinMainCRTStartup"); + } + return; } } |