tools/nolibc: export environ as a weak symbol on mips
authorWilly Tarreau <w@1wt.eu>
Tue, 10 Jan 2023 07:24:22 +0000 (08:24 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Tue, 10 Jan 2023 21:33:56 +0000 (13:33 -0800)
commit8f7fafebd1da984c427d53b614e48ebecb456824
tree5e5e4cec52333b867f82f4b6b598d74306a5237a
parenta6f29a2c41f3d283e78e00dc8974e6efacaccf37
tools/nolibc: export environ as a weak symbol on mips

The environ is retrieved from the _start code and is easy to store at
this moment. Let's declare the variable weak and store the value into
it. By not being static it will be visible to all units. By being weak,
if some programs already declared it, they will continue to be able to
use it. This was tested with mips24kc (BE) both with environ inherited
from _start and extracted from envp.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/include/nolibc/arch-mips.h