Fix PE ports confusing -c command line switch with --compact-implib
Nick Clifton
nickc@redhat.com
Tue Dec 17 02:54:00 GMT 2002
Hi Guys,
I am applying the patch below to fix a problem with PE targeted
ports. They confuse the -c command line switch (to select MRI script
parsing) with the --compact-implib command line switch, due to a
"feature" of the getopt package.
The solution is to have the --compact-implib switch present twice in
the list of the available switches, so that getopt() thinks that the
switch cannot be abbreviated. With this patch applied the PE ports
pass the ld-scripts/MRI test.
Cheers
Nick
2002-12-17 Nick Clifton <nickc@redhat.com>
* emultempl/pe.em (longopts): Duplicate entry for --compact-implib
so that it is not confused with -c.
Index: ld/emultempl/pe.em
===================================================================
RCS file: /cvs/src/src/ld/emultempl/pe.em,v
retrieving revision 1.71
diff -c -3 -p -w -r1.71 pe.em
*** ld/emultempl/pe.em 16 Dec 2002 18:02:16 -0000 1.71
--- ld/emultempl/pe.em 17 Dec 2002 09:58:25 -0000
*************** static struct option longopts[] = {
*** 260,265 ****
--- 260,268 ----
{"disable-stdcall-fixup", no_argument, NULL, OPTION_DISABLE_STDCALL_FIXUP},
{"out-implib", required_argument, NULL, OPTION_IMPLIB_FILENAME},
{"warn-duplicate-exports", no_argument, NULL, OPTION_WARN_DUPLICATE_EXPORTS},
+ /* getopt() allows abbreviations, so we do this to stop it from
+ treating -c as an abbreviation for these --compat-implib. */
+ {"compat-implib", no_argument, NULL, OPTION_IMP_COMPAT},
{"compat-implib", no_argument, NULL, OPTION_IMP_COMPAT},
{"enable-auto-image-base", no_argument, NULL, OPTION_ENABLE_AUTO_IMAGE_BASE},
{"disable-auto-image-base", no_argument, NULL, OPTION_DISABLE_AUTO_IMAGE_BASE},
More information about the Binutils
mailing list