mirror of
https://github.com/rui314/mold.git
synced 2024-12-27 10:23:41 +03:00
Add "-z nodlopen" and "-z nodelete"
This commit is contained in:
parent
8f80533628
commit
9a477418e3
@ -301,6 +301,10 @@ void parse_nonpositional_args(std::span<std::string_view> args,
|
||||
config.z_defs = true;
|
||||
} else if (read_z_flag(args, "nodefs")) {
|
||||
config.z_defs = false;
|
||||
} else if (read_z_flag(args, "nodlopen")) {
|
||||
config.z_dlopen = false;
|
||||
} else if (read_z_flag(args, "nodelete")) {
|
||||
config.z_delete = false;
|
||||
} else if (read_flag(args, "no-undefined")) {
|
||||
config.z_defs = true;
|
||||
} else if (read_flag(args, "fork")) {
|
||||
|
1
elf.h
1
elf.h
@ -171,6 +171,7 @@ static constexpr u32 DF_STATIC_TLS = 0x10;
|
||||
|
||||
static constexpr u32 DF_1_NOW = 0x00000001;
|
||||
static constexpr u32 DF_1_NODELETE = 0x00000008;
|
||||
static constexpr u32 DF_1_NOOPEN = 0x00000040;
|
||||
static constexpr u32 DF_1_PIE = 0x08000000;
|
||||
|
||||
static constexpr u32 NT_GNU_BUILD_ID = 3;
|
||||
|
2
mold.h
2
mold.h
@ -90,6 +90,8 @@ struct Config {
|
||||
bool strip_debug = false;
|
||||
bool trace = false;
|
||||
bool z_defs = false;
|
||||
bool z_delete = true;
|
||||
bool z_dlopen = true;
|
||||
bool z_execstack = false;
|
||||
bool z_now = false;
|
||||
bool z_relro = true;
|
||||
|
@ -381,6 +381,11 @@ static std::vector<u64> create_dynamic_section() {
|
||||
flags1 |= DF_1_NOW;
|
||||
}
|
||||
|
||||
if (!config.z_dlopen)
|
||||
flags1 |= DF_1_NOOPEN;
|
||||
if (!config.z_delete)
|
||||
flags1 |= DF_1_NODELETE;
|
||||
|
||||
if (out::df_static_tls)
|
||||
flags |= DF_STATIC_TLS;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user