#include "ldgram.h"
#include "ldexp.h"
#include "ldlang.h"
-#include "ldemul.h"
#include "ldlex.h"
#include "ldfile.h"
+#include "ldemul.h"
#include "ldctor.h"
/* Somewhere above, sys/stat.h got included . . . . */
config.build_constructors = true;
config.dynamic_link = false;
config.has_shared = false;
+ config.split_by_reloc = (unsigned) -1;
+ config.split_by_file = (bfd_size_type) -1;
command_line.force_common_definition = false;
command_line.interpreter = NULL;
command_line.rpath = NULL;
and _fini symbols. We are compatible. */
link_info.init_function = "_init";
link_info.fini_function = "_fini";
+ link_info.new_dtags = false;
+ link_info.flags = (bfd_vma) 0;
+ link_info.flags_1 = (bfd_vma) 0;
ldfile_add_arch ("");
/* Print error messages for any missing symbols, for any warning
symbols, and possibly multiple definitions */
- /* Look for a text section and switch the readonly attribute in it. */
- {
- asection * found = bfd_get_section_by_name (output_bfd, ".text");
+ if (! link_info.relocateable)
+ {
+ /* Look for a text section and switch the readonly attribute in it. */
+ asection * found = bfd_get_section_by_name (output_bfd, ".text");
- if (found != (asection *) NULL)
- {
- if (config.text_read_only)
- found->flags |= SEC_READONLY;
- else
- found->flags &= ~SEC_READONLY;
- }
- }
+ if (found != (asection *) NULL)
+ {
+ if (config.text_read_only)
+ found->flags |= SEC_READONLY;
+ else
+ found->flags &= ~SEC_READONLY;
+ }
+ }
if (link_info.relocateable)
output_bfd->flags &= ~EXEC_P;
{
/* We could have \foo\bar, or /foo\bar. */
char *bslash = strrchr (program_name, '\\');
- if (bslash > end)
+ if (end == NULL || (bslash != NULL && bslash > end))
end = bslash;
}
#endif