Mesa (master): ac/rtld: report better error messages for LDS overallocation

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 20 00:31:12 UTC 2019


Module: Mesa
Branch: master
Commit: 21dd8814169e81f3dd398d17311b688f83b653c4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=21dd8814169e81f3dd398d17311b688f83b653c4

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Thu May 23 15:17:51 2019 +0200

ac/rtld: report better error messages for LDS overallocation

Tested-by: Dieter Nützel <Dieter at nuetzel-hh.de>

---

 src/amd/common/ac_rtld.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/amd/common/ac_rtld.c b/src/amd/common/ac_rtld.c
index 18f198f8af2..57d6b0151b4 100644
--- a/src/amd/common/ac_rtld.c
+++ b/src/amd/common/ac_rtld.c
@@ -290,7 +290,12 @@ bool ac_rtld_open(struct ac_rtld_binary *binary,
 	uint64_t shared_lds_size = 0;
 	if (!layout_symbols(binary->lds_symbols.data, i.num_shared_lds_symbols, &shared_lds_size))
 		goto fail;
-	report_if(shared_lds_size > max_lds_size);
+
+	if (shared_lds_size > max_lds_size) {
+		fprintf(stderr, "ac_rtld error(1): too much LDS (used = %u, max = %u)\n",
+			(unsigned)shared_lds_size, max_lds_size);
+		goto fail;
+	}
 	binary->lds_size = shared_lds_size;
 
 	/* First pass over all parts: open ELFs, pre-determine the placement of
@@ -391,7 +396,11 @@ bool ac_rtld_open(struct ac_rtld_binary *binary,
 		lds_end->part_idx = ~0u;
 	}
 
-	report_elf_if(binary->lds_size > max_lds_size);
+	if (binary->lds_size > max_lds_size) {
+		fprintf(stderr, "ac_rtld error(2): too much LDS (used = %u, max = %u)\n",
+			(unsigned)binary->lds_size, max_lds_size);
+		goto fail;
+	}
 
 	/* Second pass: Adjust offsets of non-pasted text sections. */
 	binary->rx_size = pasted_text_size;




More information about the mesa-commit mailing list