Open xen0n opened 9 months ago
The 256GiB text section and 4GiB data access range allowed by the
medium
code model should be enough for the foreseeable future
Still 4GiB text section because when you take a function pointer it's still pcalau12i + addi.d. My mistake writing the NEWS for Binutils.
The 256GiB text section and 4GiB data access range allowed by the
medium
code model should be enough for the foreseeable futureStill 4GiB text section because when you take a function pointer it's still pcalau12i + addi.d. My mistake writing the NEWS for Binutils.
Oh heck, asymmetry. (And it's not your fault because that sentence is most likely written by me and you merely took my suggestion...)
Alternatively we could also implement range extension thunks for LoongArch, that should hopefully allow linking of existing object code. This is orthogonal to the medium code model support though.
Large apps, such as Chromium, and potentially in-house services that are written in C++ and/or Rust and featuring huge polymorphic business logic, are going to have text sections larger than 256MiB, that the current default code model of
normal
cannot handle.We could ask such devs to manually add
-mcmodel=medium
or evenextreme
to their projects, but the problem is: users rarely are aware of their own software's growth, and arguably they shouldn't care, and (IMO) it's definitely not the users' fault if their project suddenly fails to link just because one more feature is added that pushed the text section size over the tipping point.Instead, I'd like to propose that we allow and implement the relaxation of
call36
tobl
, then effectively merge thenormal
andmedium
code models:normal
an alias ofmedium
,medium
for popular toolchain projects,This way, small programs' performance should stay the same thanks to relaxation, and larger programs should get transparently supported. And all of this without any user intervention. The 256GiB text section and 4GiB data access range allowed by the
medium
code model should be enough for the foreseeable future; theextreme
code model should be required only for advanced use cases and/or supercomputing.