From 5dadbabb47c317f58a3b939d08e8e50745d92990 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Thu, 29 Aug 2019 17:15:46 +0200 Subject: radv/radeonsi: Don't count read-only data when reporting code size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We usually use these counts as a simple way to figure out if a change reduces the number of instructions or shrinks an instruction. However, since .rodata sections aren't executed, we shouldn't be counting their size for this analysis. Make the linker return the total executable size, and use it to report the more useful size in both drivers. Reviewed-by: Marek Olšák --- src/amd/common/ac_rtld.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/amd/common/ac_rtld.c') diff --git a/src/amd/common/ac_rtld.c b/src/amd/common/ac_rtld.c index a1bb51a8a88..7c35e72543d 100644 --- a/src/amd/common/ac_rtld.c +++ b/src/amd/common/ac_rtld.c @@ -271,6 +271,7 @@ bool ac_rtld_open(struct ac_rtld_binary *binary, uint64_t pasted_text_size = 0; uint64_t rx_align = 1; uint64_t rx_size = 0; + uint64_t exec_size = 0; #define report_if(cond) \ do { \ @@ -370,6 +371,8 @@ bool ac_rtld_open(struct ac_rtld_binary *binary, if (!strcmp(s->name, ".text")) s->is_pasted_text = true; + + exec_size += shdr->sh_size; } if (s->is_pasted_text) { @@ -438,6 +441,7 @@ bool ac_rtld_open(struct ac_rtld_binary *binary, } binary->rx_size += rx_size; + binary->exec_size = exec_size; if (i.info->chip_class >= GFX10) { /* In gfx10, the SQ fetches up to 3 cache lines of 16 dwords -- cgit v1.2.3