aboutsummaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gas/write.c b/gas/write.c
index 949ae92..e3570ac 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -1526,6 +1526,11 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED)
break;
}
+ /* PR binutils/18087: If compression didn't make
+ the section smaller, just keep it uncompressed. */
+ if (compressed_size > sec->size)
+ return;
+
/* Replace the uncompressed frag list with the compressed frag list. */
seginfo->frchainP->frch_root = first_newf;
seginfo->frchainP->frch_last = last_newf;