From f30f08a49930d415e80ca33e90053e33163efc29 Mon Sep 17 00:00:00 2001 From: dje Date: Thu, 7 Feb 2013 02:53:13 +0000 Subject: [PATCH] 2013-02-07 Michael Haubenwallner * collect2.c (main): Set aix64_flag for -G and -bsvr4 too, disable if -bnortl. Convert to strcmp and strncmp. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@195837 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/collect2.c | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 148aa675c8a..9634c059c2e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-02-07 Michael Haubenwallner + + * collect2.c (main): Set aix64_flag for -G and -bsvr4 too, disable + if -bnortl. Convert to strcmp and strncmp. + 2013-02-07 Alan Modra PR target/54009 diff --git a/gcc/collect2.c b/gcc/collect2.c index 0db908f2636..99dd41dc1c5 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -1022,20 +1022,20 @@ main (int argc, char **argv) selected_linker = USE_GOLD_LD; #ifdef COLLECT_EXPORT_LIST - /* since -brtl, -bexport, -b64 are not position dependent - also check for them here */ - if ((argv[i][0] == '-') && (argv[i][1] == 'b')) - { - arg = argv[i]; - /* We want to disable automatic exports on AIX when user - explicitly puts an export list in command line */ - if (arg[2] == 'E' || strncmp (&arg[2], "export", 6) == 0) - export_flag = 1; - else if (arg[2] == '6' && arg[3] == '4') - aix64_flag = 1; - else if (arg[2] == 'r' && arg[3] == 't' && arg[4] == 'l') - aixrtl_flag = 1; - } + /* These flags are position independent, although their order + is important - subsequent flags override earlier ones. */ + else if (strcmp (argv[i], "-b64") == 0) + aix64_flag = 1; + /* -bexport:filename always needs the :filename */ + else if (strncmp (argv[i], "-bE:", 4) == 0 + || strncmp (argv[i], "-bexport:", 9) == 0) + export_flag = 1; + else if (strcmp (argv[i], "-brtl") == 0 + || strcmp (argv[i], "-bsvr4") == 0 + || strcmp (argv[i], "-G") == 0) + aixrtl_flag = 1; + else if (strcmp (argv[i], "-bnortl") == 0) + aixrtl_flag = 0; #endif } vflag = debug; -- 2.11.4.GIT