don't clobber it when not relaxing.
* ld.h (ld_config_type): Remove traditional_format field.
* ldmain.c (main): Use link_info.traditional_format rather than
config.traditional_format.
* ldlang.c (ldlang_open_output): Likewise.
* lexsup.c (parse_args): Likewise.
* emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Likewise.
* mpw-eppcmac.c (gldppcmacos_parse_args): Likewise.
Mon Apr 22 12:07:32 1996 Ian Lance Taylor <ian@cygnus.com>
+ * ldlang.c (lang_size_sections): If _cooked_size is not 0, then
+ don't clobber it when not relaxing.
+
+ * ld.h (ld_config_type): Remove traditional_format field.
+ * ldmain.c (main): Use link_info.traditional_format rather than
+ config.traditional_format.
+ * ldlang.c (ldlang_open_output): Likewise.
+ * lexsup.c (parse_args): Likewise.
+ * emultempl/aix.em (gld${EMULATION_NAME}_parse_args): Likewise.
+ * mpw-eppcmac.c (gldppcmacos_parse_args): Likewise.
+
* ldlang.c (wild_doit): Discard debugging sections if we are
stripping debugging information.
/* ld.h -
- Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 1994, 1995 Free Software Foundation, Inc.
This file is part of GLD, the Gnu Linker.
#ifndef LD_H
#define LD_H
+/* Look in this environment name for the linker to pretend to be */
+#define EMULATION_ENVIRON "LDEMULATION"
+/* If in there look for the strings: */
+
+/* Look in this variable for a target format */
+#define TARGET_ENVIRON "GNUTARGET"
+
+/* Input sections which are put in a section of this name are actually
+ discarded. */
+#define DISCARD_SECTION_NAME "/DISCARD/"
+
/* Extra information we hold on sections */
typedef struct user_section_struct
{
/* Runtime library search path from the -rpath argument. */
char *rpath;
+ /* Link time runtime library search path from the -rpath-link
+ argument. */
+ char *rpath_link;
+
/* Big or little endian as set on command line. */
enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian;
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;
+ /* If true, build constructors. */
boolean build_constructors;
+ /* If true, warn about any constructors. */
+ boolean warn_constructors;
+
/* If true, warn about merging common symbols with others. */
boolean warn_common;
/* If true, only warn once about a particular undefined symbol. */
boolean warn_once;
+ /* If true, warn if multiple global-pointers are needed (Alpha
+ only). */
+ boolean warn_multiple_gp;
+
boolean sort_common;
boolean text_read_only;
extern boolean had_script;
extern boolean force_make_executable;
+/* Non-zero if we are processing a --defsym from the command line. */
+extern int parsing_defsym;
+
extern int yyparse PARAMS ((void));
#endif
output_bfd->flags |= WP_TEXT;
else
output_bfd->flags &= ~WP_TEXT;
- if (config.traditional_format)
+ if (link_info.traditional_format)
output_bfd->flags |= BFD_TRADITIONAL_FORMAT;
else
output_bfd->flags &= ~BFD_TRADITIONAL_FORMAT;
i = (*prev)->input_section.section;
if (! relax)
- i->_cooked_size = i->_raw_size;
+ {
+ if (i->_cooked_size == 0)
+ i->_cooked_size = i->_raw_size;
+ }
else
{
boolean again;
/* Initialize the data about options. */
trace_files = trace_file_tries = version_printed = false;
whole_archive = false;
- config.traditional_format = false;
config.build_constructors = true;
config.dynamic_link = false;
command_line.force_common_definition = false;
link_info.shared = false;
link_info.symbolic = false;
link_info.static_link = false;
+ link_info.traditional_format = false;
link_info.strip = strip_none;
link_info.discard = discard_none;
link_info.lprefix_len = 1;
asection *nsec;
bfd_vma nval;
{
+ /* If either section has the output_section field set to
+ bfd_abs_section_ptr, it means that the section is being
+ discarded, and this is not really a multiple definition at all.
+ FIXME: It would be cleaner to somehow ignore symbols defined in
+ sections which are being discarded. */
+ if ((osec->output_section != NULL
+ && bfd_is_abs_section (osec->output_section))
+ || (nsec->output_section != NULL
+ && bfd_is_abs_section (nsec->output_section)))
+ return true;
+
einfo ("%X%C: multiple definition of `%T'\n",
nbfd, nsec, nval, name);
if (obfd != (bfd *) NULL)
'E', NULL, "Export all dynamic symbols", TWO_DASHES },
{ {NULL, optional_argument, NULL, '\0'},
'F', "[FORMAT]", "Ignored", ONE_DASH },
+ { {NULL, no_argument, NULL, '\0'},
+ 'g', NULL, "Ignored", ONE_DASH },
{ {"gpsize", required_argument, NULL, 'G'},
'G', "SIZE", "Small data size (if no size, same as --shared)",
TWO_DASHES },
- { {NULL, no_argument, NULL, '\0'},
- 'g', NULL, "Ignored", ONE_DASH },
{ {"soname", required_argument, NULL, OPTION_SONAME},
'h', "FILENAME", "Set internal name of shared library", ONE_DASH },
{ {"library", required_argument, NULL, 'l'},
'\0', "KEYWORD", "Ignored for SunOS compatibility", ONE_DASH },
{ {"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED},
'\0', NULL, "Link against shared libraries", ONE_DASH },
- { {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
- '\0', NULL, NULL, ONE_DASH },
{ {"dy", no_argument, NULL, OPTION_CALL_SHARED},
'\0', NULL, NULL, ONE_DASH },
+ { {"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
+ '\0', NULL, NULL, ONE_DASH },
{ {"Bstatic", no_argument, NULL, OPTION_NON_SHARED},
'\0', NULL, "Do not link against shared libraries", ONE_DASH },
{ {"dn", no_argument, NULL, OPTION_NON_SHARED},
set_section_start (".text", optarg);
break;
case OPTION_TRADITIONAL_FORMAT:
- config.traditional_format = true;
+ link_info.traditional_format = true;
break;
case OPTION_UR:
link_info.relocateable = true;
break;
case OPTION_NOSTRCMPCT:
- config.traditional_format = true;
+ link_info.traditional_format = true;
break;
case OPTION_PD:
break;
case OPTION_STRCMPCT:
- config.traditional_format = false;
+ link_info.traditional_format = false;
break;
case OPTION_UNIX: