[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[committed] Only apply die limits in regular mode



Hi,

In off_htab_add_die we have:
...
      if (low_mem
         || op_multifile
         || estimated_nr_dies >= low_mem_die_limit
         || estimated_nr_dies >= max_die_limit)
       initial_size = default_initial_size;
...

Die limits are only supposed to apply in regular mode, but the formulation
allows the limits to apply in read_multifile and finalize_multifile mode as
well.

I don't think this can trigger a difference in behaviour in finalize_multifile
mode, but it might in read_multifile mode.

Fix this by only testing die limits in regular mode.

Committed to trunk.

Thanks,
- Tom

Only apply die limits in regular mode

2019-11-25  Tom de Vries  <tdevries@suse.de>

	* dwz.c (off_htab_add_die): Only test die limits in regular mode.

---
 dwz.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dwz.c b/dwz.c
index c8e43b7..5aab860 100644
--- a/dwz.c
+++ b/dwz.c
@@ -1284,8 +1284,9 @@ off_htab_add_die (dw_cu_ref cu, dw_die_ref die)
       size_t initial_size;
       if (low_mem
 	  || op_multifile
-	  || estimated_nr_dies >= low_mem_die_limit
-	  || estimated_nr_dies >= max_die_limit)
+	  || (multifile_mode == 0
+	      && (estimated_nr_dies >= low_mem_die_limit
+		  || estimated_nr_dies >= max_die_limit)))
 	initial_size = default_initial_size;
       else
 	{