mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 20:28:28 +08:00
* lexsup.c (parse_args): Let -G either set the small data size or
be equivalent to --shared, depending on the next argument. Accept and ignore -z for Solaris compatibility. PR 7118.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
Mon Jul 3 14:39:22 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
|
* lexsup.c (parse_args): Let -G either set the small data size or
|
||||||
|
be equivalent to --shared, depending on the next argument. Accept
|
||||||
|
and ignore -z for Solaris compatibility.
|
||||||
|
|
||||||
Sun Jul 2 17:52:34 1995 Ian Lance Taylor <ian@cygnus.com>
|
Sun Jul 2 17:52:34 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
* lexsup.c (parse_args): Cast fopen result to PTR before storing
|
* lexsup.c (parse_args): Cast fopen result to PTR before storing
|
||||||
|
26
ld/lexsup.c
26
ld/lexsup.c
@ -21,6 +21,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||||||
#include "sysdep.h"
|
#include "sysdep.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
#include "bfdlink.h"
|
#include "bfdlink.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -55,6 +56,7 @@ parse_args (argc, argv)
|
|||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
int ingroup = 0;
|
int ingroup = 0;
|
||||||
|
|
||||||
/* Starting the short option string with '-' is for programs that
|
/* Starting the short option string with '-' is for programs that
|
||||||
@ -63,7 +65,7 @@ parse_args (argc, argv)
|
|||||||
as if it were the argument of an option with character code 1. */
|
as if it were the argument of an option with character code 1. */
|
||||||
|
|
||||||
const char *shortopts =
|
const char *shortopts =
|
||||||
"-a:A:B::b:c:de:F::G:giL:l:Mm:NnO:o:R:rSsT:tu:VvXxY:y:()";
|
"-a:A:B::b:c:de:F::G:giL:l:Mm:NnO:o:R:rSsT:tu:VvXxY:y:z:()";
|
||||||
|
|
||||||
/* 150 isn't special; it's just an arbitrary non-ASCII char value. */
|
/* 150 isn't special; it's just an arbitrary non-ASCII char value. */
|
||||||
|
|
||||||
@ -159,6 +161,23 @@ parse_args (argc, argv)
|
|||||||
{NULL, no_argument, NULL, 0}
|
{NULL, no_argument, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* The -G option is ambiguous on different platforms. Sometimes it
|
||||||
|
specifies the largest data size to put into the small data
|
||||||
|
section. Sometimes it is equivalent to --shared. Unfortunately,
|
||||||
|
the first form takes an argument, while the second does not.
|
||||||
|
|
||||||
|
We need to permit the --shared form because on some platforms,
|
||||||
|
such as Solaris, gcc -shared will pass -G to the linker.
|
||||||
|
|
||||||
|
To permit either usage, we look through the argument list. If we
|
||||||
|
find -G not followed by a number, we change it into --shared.
|
||||||
|
This will work for most normal cases. */
|
||||||
|
for (i = 1; i < argc; i++)
|
||||||
|
if (strcmp (argv[i], "-G") == 0
|
||||||
|
&& (i + 1 >= argc
|
||||||
|
|| ! isdigit (argv[i + 1][0])))
|
||||||
|
argv[i] = (char *) "--shared";
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
/* getopt_long_only is like getopt_long, but '-' as well as '--' can
|
/* getopt_long_only is like getopt_long, but '-' as well as '--' can
|
||||||
@ -452,6 +471,11 @@ parse_args (argc, argv)
|
|||||||
case 'y':
|
case 'y':
|
||||||
add_ysym (optarg);
|
add_ysym (optarg);
|
||||||
break;
|
break;
|
||||||
|
case 'z':
|
||||||
|
/* We accept and ignore this option for Solaris
|
||||||
|
compatibility. Actually, on Solaris, optarg is not
|
||||||
|
ignored. Someday we should handle it correctly. FIXME. */
|
||||||
|
break;
|
||||||
case OPTION_SPLIT_BY_RELOC:
|
case OPTION_SPLIT_BY_RELOC:
|
||||||
config.split_by_reloc = atoi (optarg);
|
config.split_by_reloc = atoi (optarg);
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user