From 2352ec647df1bb77f6353927234818632a35ce24 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 3 Jan 2025 17:10:56 +0900 Subject: [PATCH] Fix a range extension thunk creation issue Previously, we failed to create range extension thunks if we have a very large input section. --- src/thunks.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thunks.cc b/src/thunks.cc index 28a65246c4..cb8f341520 100644 --- a/src/thunks.cc +++ b/src/thunks.cc @@ -164,7 +164,7 @@ void OutputSection::create_range_extension_thunks(Context &ctx) { c++; // Move A forward so that A is reachable from C. - i64 c_offset = (c == m.size()) ? offset : m[c]->offset; + i64 c_offset = (c == d) ? offset : m[c]->offset; while (a < b && m[a]->offset + branch_distance < c_offset) a++;