* ld.h (ld_config_type): Add new field traditional_format.
authorIan Lance Taylor <ian@airs.com>
Wed, 15 Jun 1994 06:01:45 +0000 (06:01 +0000)
committerIan Lance Taylor <ian@airs.com>
Wed, 15 Jun 1994 06:01:45 +0000 (06:01 +0000)
* lexsup.c (parse_args): Add traditional_format to longopts, and
handle it.
* ldmain.c (main): Initialize config.traditional_format to false.
* ldlang.c (ldlang_open_output): Set BFD_TRADITIONAL_FORMAT in BFD
flags of output_bfd according to config.traditional_format.
* ld.texinfo: Document -traditional-format.

ld/ChangeLog
ld/ld.h
ld/ld.texinfo
ld/ldlang.c
ld/ldmain.c
ld/lexsup.c

index 0e6e23acccb4bb68be9c814f9d958f6d7f46d7d7..0685b60998920012f33808408fc5504fbb7f3ec9 100644 (file)
@@ -1,3 +1,13 @@
+Wed Jun 15 01:54:54 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
+
+       * ld.h (ld_config_type): Add new field traditional_format.
+       * lexsup.c (parse_args): Add traditional_format to longopts, and
+       handle it.
+       * ldmain.c (main): Initialize config.traditional_format to false.
+       * ldlang.c (ldlang_open_output): Set BFD_TRADITIONAL_FORMAT in BFD
+       flags of output_bfd according to config.traditional_format.
+       * ld.texinfo: Document -traditional-format.
+
 Tue Jun 14 23:10:07 1994  Ian Lance Taylor  (ian@tweedledumb.cygnus.com)
 
        * ldctor.c (ldctor_add_entry): Add entries to a set in the order
diff --git a/ld/ld.h b/ld/ld.h
index 2ab94f60a6df2c5157dd4829e456078a7d7e9139..ff654a650a13df2af1fc412973d5bd28bacc35b3 100644 (file)
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -61,6 +61,9 @@ typedef struct
   boolean magic_demand_paged;
   boolean make_executable;
 
+  /* If true, request BFD to use the traditional format.  */
+  boolean traditional_format;
+
   /* If true, doing a dynamic link.  */
   boolean dynamic_link;
 
index 65a9d1065ac866dd3381db3173da6f68a332ae53..d60c5e87532ace571b1458445ca026a6ddb5dbc9 100644 (file)
@@ -179,7 +179,8 @@ ld [ -o @var{output} ]  @var{objfile}@dots{}
   [ -r | -Ur ]  [ -S ]  [ -s ]  [ -sort-common ] [ -stats ]
   [ -T @var{commandfile} ]
   [ -Ttext @var{org} ]  [ -Tdata @var{org} ]
-  [ -Tbss @var{org} ]  [ -t ]  [ -u @var{symbol}]  [-V]  [-v]  [ -version ]
+  [ -Tbss @var{org} ]  [ -t ] [ -traditional-format ]
+  [ -u @var{symbol}]  [-V]  [-v]  [ -version ]
   [ -warn-common ]  [ -y @var{symbol} ]  [ -X ]  [-x ]
 @end smallexample
 
@@ -597,6 +598,21 @@ preceding @samp{-L} options.  Multiple @samp{-T} options accumulate.
 @item -t 
 Print the names of the input files as @code{ld} processes them.
 
+@kindex -traditional-format
+@cindex traditional format
+@item -traditional-format
+For some targets, the output of @code{ld} is different in some ways from
+the output of some existing linker.  This switch requests @code{ld} to
+use the traditional format instead.
+
+@cindex dbx
+For example, on SunOS, @code{ld} combines duplicate entries in the
+symbol string table.  This can reduce the size of an output file with
+full debugging information by over 30 percent.  Unfortunately, the SunOS
+@code{dbx} program can not read the resulting program (@code{gdb} has no
+trouble).  The @samp{-traditional-format} switch tells @code{ld} to not
+combine duplicate entries.
+
 @item -u @var{symbol}
 @kindex -u @var{symbol}
 @cindex undefined symbol
index 93a7d673799c5c4c1d3e08367cd2581f2297f669..36a85534b0cd3e7755f26186a6736f403a340318 100644 (file)
@@ -889,6 +889,10 @@ ldlang_open_output (statement)
        output_bfd->flags |= WP_TEXT;
       else
        output_bfd->flags &= ~WP_TEXT;
+      if (config.traditional_format)
+       output_bfd->flags |= BFD_TRADITIONAL_FORMAT;
+      else
+       output_bfd->flags &= ~BFD_TRADITIONAL_FORMAT;
       break;
 
     case lang_target_statement_enum:
index 3109bbbe59b8fa76f62ef33d7afd9ed1e71483af..bfe74f049f1b15e73eee3575d77b447813a4d32b 100644 (file)
@@ -158,6 +158,7 @@ main (argc, argv)
 
   /* Initialize the data about options.  */
   trace_files = trace_file_tries = version_printed = false;
+  config.traditional_format = false;
   config.build_constructors = true;
   config.dynamic_link = false;
   command_line.force_common_definition = false;
index 8b1a1cd1459c65bd5cecef4e5e1e521174b14e30..7a88a9c0e696b68625a5af7bc04b769b04cb69bd 100644 (file)
@@ -99,11 +99,13 @@ parse_args (argc, argv)
     {"Tdata", required_argument, NULL, OPTION_TDATA},
 #define OPTION_TTEXT 167
     {"Ttext", required_argument, NULL, OPTION_TTEXT},
-#define OPTION_UR 168
+#define OPTION_TRADITIONAL_FORMAT 168
+    {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT},
+#define OPTION_UR 169
     {"Ur", no_argument, NULL, OPTION_UR},
-#define OPTION_VERSION 169
+#define OPTION_VERSION 170
     {"version", no_argument, NULL, OPTION_VERSION},
-#define OPTION_WARN_COMMON 170
+#define OPTION_WARN_COMMON 171
     {"warn-common", no_argument, NULL, OPTION_WARN_COMMON},
     {NULL, no_argument, NULL, 0}
   };
@@ -279,6 +281,9 @@ parse_args (argc, argv)
        case OPTION_TTEXT:
          set_section_start (".text", optarg);
          break;
+       case OPTION_TRADITIONAL_FORMAT:
+         config.traditional_format = true;
+         break;
        case OPTION_UR:
          link_info.relocateable = true;
          config.build_constructors = true;
This page took 0.037671 seconds and 4 git commands to generate.