aboutsummaryrefslogtreecommitdiff
path: root/bfd/compress.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-11-10 12:26:53 +0000
committerNick Clifton <nickc@redhat.com>2016-11-10 12:26:53 +0000
commita18590c38657a982f8d544f2f54f39ba9abe9fca (patch)
tree5aa0bbe70b03cf080a4c6e1c8bdf69c8c9a3d0e7 /bfd/compress.c
parentac33b731d214d79738ca04d27f7464d4482f6a01 (diff)
downloadgdb-a18590c38657a982f8d544f2f54f39ba9abe9fca.zip
gdb-a18590c38657a982f8d544f2f54f39ba9abe9fca.tar.gz
gdb-a18590c38657a982f8d544f2f54f39ba9abe9fca.tar.bz2
Provide a more helpful error message when the BFD library is unable to load an extremely large section.
PR target/20737 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Bind defined symbol locally in PIE.
Diffstat (limited to 'bfd/compress.c')
-rw-r--r--bfd/compress.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bfd/compress.c b/bfd/compress.c
index 0a96630..95e8c23 100644
--- a/bfd/compress.c
+++ b/bfd/compress.c
@@ -247,7 +247,15 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec, bfd_byte **ptr)
{
p = (bfd_byte *) bfd_malloc (sz);
if (p == NULL)
+ {
+ /* PR 20801: Provide a more helpful error message. */
+ if (bfd_get_error () == bfd_error_no_memory)
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("error: %B(%A) is too large (%#lx bytes)"),
+ abfd, sec, (long) sz);
return FALSE;
+ }
}
if (!bfd_get_section_contents (abfd, sec, p, 0, sz))