diff --git a/ld/ldlang.c b/ld/ldlang.c
index 54d1af62ebe..f2b2a9bf356 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -5506,7 +5506,7 @@ size_input_section
 			     "the linker-created stubs section `%pA'.\n"),
 			   i->output_section, i);
 
-		  if (i->rawsize && i->rawsize != i->size)
+		  if (i->flags & SEC_RELOC && i->rawsize && i->rawsize != i->size)
 		    einfo (_("%F%P: Relaxation not supported with "
 			     "--enable-non-contiguous-regions (section `%pA' "
 			     "would overflow `%pA' after it changed size).\n"),
@@ -8094,8 +8094,9 @@ lang_propagate_lma_regions (void)
 }
 
 static void
-warn_non_contiguous_discards (void)
+lang_check_non_contiguous_discards (void)
 {
+  unsigned long discard = 0;
   LANG_FOR_EACH_INPUT_STATEMENT (file)
     {
       if ((file->the_bfd->flags & (BFD_LINKER_CREATED | DYNAMIC)) != 0
@@ -8104,11 +8105,16 @@ warn_non_contiguous_discards (void)
 
       for (asection *s = file->the_bfd->sections; s != NULL; s = s->next)
 	if (s->output_section == NULL
-	    && (s->flags & SEC_LINKER_CREATED) == 0)
-	  einfo (_("%P: warning: --enable-non-contiguous-regions "
+	    && (s->flags & SEC_LINKER_CREATED) == 0) {
+	  einfo (_("%P: error: --enable-non-contiguous-regions "
 		   "discards section `%pA' from `%pB'\n"),
 		 s, file->the_bfd);
+	  discard += s->size;
+	}
     }
+  if (discard > 0)
+    einfo ("%F%P: error: Total discarded sections size is %lu bytes\n",
+	   discard);
 }
 
 static void
@@ -8436,6 +8442,10 @@ lang_process (void)
   /* Size up the sections.  */
   lang_size_sections (NULL, !RELAXATION_ENABLED);
 
+  /* Check if has no discarded sections.  */
+  if (link_info.non_contiguous_regions)
+    lang_check_non_contiguous_discards ();
+
   /* See if anything special should be done now we know how big
      everything is.  This is where relaxation is done.  */
   ldemul_after_allocation ();
@@ -8459,10 +8469,6 @@ lang_process (void)
   if (command_line.check_section_addresses)
     lang_check_section_addresses ();
 
-  if (link_info.non_contiguous_regions
-      && link_info.non_contiguous_regions_warnings)
-    warn_non_contiguous_discards ();
-
   /* Check any required symbols are known.  */
   ldlang_check_require_defined_symbols ();
 
diff --git a/ld/testsuite/ld-arm/non-contiguous-arm.d b/ld/testsuite/ld-arm/non-contiguous-arm.d
index 3479778991e..98140e4dd01 100644
--- a/ld/testsuite/ld-arm/non-contiguous-arm.d
+++ b/ld/testsuite/ld-arm/non-contiguous-arm.d
@@ -1,4 +1,4 @@
 #name: non-contiguous-arm
 #source: non-contiguous-arm.s
 #ld: --enable-non-contiguous-regions -T non-contiguous-arm.ld
-# error: .*Could not assign .?\.code\.4.? to an output section. Retry without --enable-non-contiguous-regions\.
+#error_output: non-contiguous-arm.err
diff --git a/ld/testsuite/ld-arm/non-contiguous-arm7.err b/ld/testsuite/ld-arm/non-contiguous-arm7.err
index 7b3a3d8c3c9..14cef67e0df 100644
--- a/ld/testsuite/ld-arm/non-contiguous-arm7.err
+++ b/ld/testsuite/ld-arm/non-contiguous-arm7.err
@@ -1,5 +1,4 @@
 .* may change behaviour for section .?\.bss.? from .*
 .* may change behaviour for section .?\.bss\.MY_BUF.? from .*
 .* discards section .?\.bss\.MY_BUF.? from .*
-.* unresolvable R_ARM_ABS32 relocation against symbol .?MY_BUF.?
-.* final link failed
+.* Total discarded sections size is [0-9]+ bytes
diff --git a/ld/testsuite/ld-powerpc/non-contiguous-merged-sections.d b/ld/testsuite/ld-powerpc/non-contiguous-merged-sections.d
new file mode 100644
index 00000000000..e01b5151085
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/non-contiguous-merged-sections.d
@@ -0,0 +1,9 @@
+#name: non-contiguous-merged-sections
+#source: non-contiguous-merged-sections.s
+#ld: --enable-non-contiguous-regions -T non-contiguous-merged-sections.ld
+#readelf: -l --wide
+
+#...
+ +LOAD +0x[0-9a-f]+ +0x[0-9a-f]+ +0x[0-9a-f]+ 0x00012 0x00012 .*
+#...
+ +00 +\.rodata_ram2
diff --git a/ld/testsuite/ld-powerpc/non-contiguous-merged-sections.ld b/ld/testsuite/ld-powerpc/non-contiguous-merged-sections.ld
new file mode 100644
index 00000000000..79c4ae89cb8
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/non-contiguous-merged-sections.ld
@@ -0,0 +1,18 @@
+MEMORY
+{
+  RAM1 (xrw)   : ORIGIN = 0x10000000,   LENGTH = 4b
+  RAM2 (xrw)   : ORIGIN = 0x20000000,   LENGTH = 1K
+}
+
+SECTIONS
+{
+  .rodata_ram1 :
+  {
+    *(.rodata) *(.rodata*);
+  } >RAM1
+
+  .rodata_ram2 :
+  {
+    *(.rodata) *(.rodata*);
+  } >RAM2
+}
diff --git a/ld/testsuite/ld-powerpc/non-contiguous-merged-sections.s b/ld/testsuite/ld-powerpc/non-contiguous-merged-sections.s
new file mode 100644
index 00000000000..49832b3b514
--- /dev/null
+++ b/ld/testsuite/ld-powerpc/non-contiguous-merged-sections.s
@@ -0,0 +1,7 @@
+	.file	"<artificial>"
+	.section	.rodata.str1.8,"aMS",@progbits,1
+.LC0:
+	.string	"string_1"
+	.section	.rodata.str2.8,"aMS",@progbits,1
+.LC1:
+	.string	"string_2"
diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp
index 9989f5a329d..fc42118d862 100644
--- a/ld/testsuite/ld-powerpc/powerpc.exp
+++ b/ld/testsuite/ld-powerpc/powerpc.exp
@@ -519,6 +519,7 @@ run_dump_test "ppc476-shared"
 run_dump_test "ppc476-shared2"
 
 run_dump_test "non-contiguous-powerpc"
+run_dump_test "non-contiguous-merged-sections"
 
 run_dump_test "tprel32"
 run_dump_test "tprelbad"
