* 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 0e6e23a..0685b60 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 2ab94f6..ff654a6 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 65a9d10..d60c5e8 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 93a7d67..36a8553 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 3109bbb..bfe74f0 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 8b1a1cd..7a88a9c 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;