aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2003-05-09 16:12:07 +0000
committerNick Clifton <nickc@redhat.com>2003-05-09 16:12:07 +0000
commit661849791b8144064766d5c39bbc54ad2db7e030 (patch)
tree1d31b8d6d259b9e5b52350d1377419d9cf7c7eb4 /ld
parent4648dfcf5b6bdda114c06be26f586a81e0922ee2 (diff)
downloadgdb-661849791b8144064766d5c39bbc54ad2db7e030.zip
gdb-661849791b8144064766d5c39bbc54ad2db7e030.tar.gz
gdb-661849791b8144064766d5c39bbc54ad2db7e030.tar.bz2
Default to generating a fatal error message if a loadable section is not
allocated to a memory region when regions are defined.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog6
-rw-r--r--ld/ldlang.c24
2 files changed, 26 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 8f84256..0f1f539 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2003-05-02 Nick Clifton <nickc@redhat.com>
+
+ * ldlang.c (lang_size_sections_1): Default to generating a
+ fatal error message if a loadable section is not allocated
+ to a memory region when regions are defined.
+
2003-05-09 Alan Modra <amodra@bigpond.net.au>
* Makefile.am (em68hc11elf.c): Correct dependencies.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 8846917..fccab0d 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -3050,7 +3050,7 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax,
/* If a loadable section is using the default memory
region, and some non default memory regions were
- defined, issue a warning. */
+ defined, issue an error message. */
if ((bfd_get_section_flags (output_bfd, os->bfd_section)
& (SEC_ALLOC | SEC_LOAD)) != 0
&& (bfd_get_section_flags (output_bfd, os->bfd_section)
@@ -3062,9 +3062,25 @@ lang_size_sections_1 (s, output_section_statement, prev, fill, dot, relax,
&& (strcmp (lang_memory_region_list->name,
"*default*") != 0
|| lang_memory_region_list->next != NULL))
- einfo (_("%P: warning: no memory region specified for section `%s'\n"),
- bfd_get_section_name (output_bfd,
- os->bfd_section));
+ {
+ /* By default this is an error rather than just a
+ warning because if we allocate the section to the
+ default memory region we can end up creating an
+ excessivly large binary, or even seg faulting when
+ attmepting to perform a negative seek. See
+ http://sources.redhat.com/ml/binutils/2003-04/msg00423.html
+ for an example of this. This behaviour can be
+ overridden by the using the --no-check-sections
+ switch. */
+ if (command_line.check_section_addresses)
+ einfo (_("%P%F: error: no memory region specified for loadable section `%s'\n"),
+ bfd_get_section_name (output_bfd,
+ os->bfd_section));
+ else
+ einfo (_("%P: warning: no memory region specified for loadable section `%s'\n"),
+ bfd_get_section_name (output_bfd,
+ os->bfd_section));
+ }
dot = os->region->current;