]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* lexsup.c (parse_args): Set check_section_addresses to 1 or 0.
authorNathan Sidwell <nathan@codesourcery.com>
Mon, 26 Jan 2009 15:23:39 +0000 (15:23 +0000)
committerNathan Sidwell <nathan@codesourcery.com>
Mon, 26 Jan 2009 15:23:39 +0000 (15:23 +0000)
* 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.

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

index cfaec2e5363b49fa875fe4ae3b873f80050d0864..92f27c6b79ef661319acd0b9aead5f9753ba3056 100644 (file)
@@ -1,3 +1,13 @@
+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.
diff --git a/ld/ld.h b/ld/ld.h
index 43a4ba211572faabb92d6a152eaf1c57c01a074e..3de92cd9efa5aa8e284dec1b3dd9e6fe5c12cef4 100644 (file)
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -167,10 +167,9 @@ typedef struct {
      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
index 35435053b3c52e5fb15b2419f27aca226186e826..1d909897c931509925e64ca48cac4c14cfdb4fc3 100644 (file)
@@ -1205,6 +1205,9 @@ perform this check, and if it finds any overlaps it will produce
 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
index 706058728403e78e99d9c0a5296f2c76595d9610..85b9c2b5b3eb0c8afd08953ce2bde3661b3f7213 100644 (file)
@@ -251,7 +251,7 @@ main (int argc, char **argv)
 
   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
@@ -292,6 +292,8 @@ main (int argc, char **argv)
 
   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)
index f9e6b1fcb463358b09e35b3a920b2fe8c4b3a82b..4dcfc3c65399b0bf5f63644c6235549be89cda00 100644 (file)
@@ -1411,10 +1411,10 @@ parse_args (unsigned argc, char **argv)
            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;