Skip to content

Commit 15255eb

Browse files
committedOct 13, 2022
Only pass --global-base to the linker if its set to a non-default value
Otherwise rely on the linker default value of 1024. This change is in preparation of using `--stack-first` in debug builds. When `--stack-first` is passed to the linker `--global-base` is ignored (it should really be an error do this). I also avoid needless passing redundant arguments to the linker.
1 parent 264b61d commit 15255eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎tools/building.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def lld_flags_for_executable(external_symbols):
225225
cmd.append('--max-memory=%d' % settings.INITIAL_MEMORY)
226226
elif settings.MAXIMUM_MEMORY != -1:
227227
cmd.append('--max-memory=%d' % settings.MAXIMUM_MEMORY)
228-
if not settings.RELOCATABLE:
228+
if settings.GLOBAL_BASE != 1024 and not settings.RELOCATABLE:
229229
cmd.append('--global-base=%s' % settings.GLOBAL_BASE)
230230

231231
return cmd

0 commit comments

Comments
 (0)
Failed to load comments.