* ld.h (args_type): Make check_section_addresses a char.
ldlang.c (lang_process): Don't consider relocatable flag when
checking for overlap.
* ldmain.c (main): Default check_section_addresses to -1. Check it
for relocatable links.
* ld.texinfo (--check-sections): Update documentation.
+2009-01-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * lexsup.c (parse_args): Set check_section_addresses to 1 or 0.
+ * ld.h (args_type): Make check_section_addresses a char.
+ ldlang.c (lang_process): Don't consider relocatable flag when
+ checking for overlap.
+ * ldmain.c (main): Default check_section_addresses to -1. Check it
+ for relocatable links.
+ * ld.texinfo (--check-sections): Update documentation.
+
2009-01-26 Kai Tietz <kai.tietz@onevision.com>
* pe-dll.c (tmp_seq2): New static variable.
search. */
bfd_boolean warn_search_mismatch;
-
- /* If TRUE (the default) check section addresses, once compute,
- fpor overlaps. */
- bfd_boolean check_section_addresses;
+ /* If non-zero check section addresses, once computed,
+ for overlaps. Relocatable links only check when this is > 0. */
+ signed char check_section_addresses;
/* If TRUE allow the linking of input files in an unknown architecture
assuming that the user knows what they are doing. This was the old
suitable error messages. The linker does know about, and does make
allowances for sections in overlays. The default behaviour can be
restored by using the command line switch @option{--check-sections}.
+Section overlap is not usually checked for relocatable links. You can
+force checking in that case by using the @option{--check-sections}
+option.
@cindex cross reference table
@kindex --cref
command_line.warn_mismatch = TRUE;
command_line.warn_search_mismatch = TRUE;
- command_line.check_section_addresses = TRUE;
+ command_line.check_section_addresses = -1;
/* We initialize DEMANGLING based on the environment variable
COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
if (link_info.relocatable)
{
+ if (command_line.check_section_addresses < 0)
+ command_line.check_section_addresses = 0;
if (command_line.relax)
einfo (_("%P%F: --relax and -r may not be used together\n"));
if (link_info.shared)
config.split_by_file = 1;
break;
case OPTION_CHECK_SECTIONS:
- command_line.check_section_addresses = TRUE;
+ command_line.check_section_addresses = 1;
break;
case OPTION_NO_CHECK_SECTIONS:
- command_line.check_section_addresses = FALSE;
+ command_line.check_section_addresses = 0;
break;
case OPTION_ACCEPT_UNKNOWN_INPUT_ARCH:
command_line.accept_unknown_input_arch = TRUE;