mirror of
https://github.com/rui314/mold.git
synced 2024-09-22 02:20:51 +03:00
wip
This commit is contained in:
parent
9be4f63b90
commit
b98b792c50
@ -434,8 +434,7 @@ void InputSection::scan_relocations() {
|
||||
}
|
||||
case R_X86_64_PC8:
|
||||
case R_X86_64_PC16:
|
||||
case R_X86_64_PC32:
|
||||
case R_X86_64_PC64: {
|
||||
case R_X86_64_PC32: {
|
||||
std::function<void()> table[][4] = {
|
||||
// Absolute Local Imported data Imported code
|
||||
{ none, none, copyrel, plt }, // PDE
|
||||
@ -447,6 +446,18 @@ void InputSection::scan_relocations() {
|
||||
table[output_type][get_sym_type(sym)]();
|
||||
break;
|
||||
}
|
||||
case R_X86_64_PC64: {
|
||||
std::function<void()> table[][4] = {
|
||||
// Absolute Local Imported data Imported code
|
||||
{ none, none, copyrel, plt }, // PDE
|
||||
{ baserel, none, copyrel, plt }, // PIE
|
||||
{ baserel, none, error, error }, // DSO
|
||||
};
|
||||
|
||||
rel_types[i] = R_PC;
|
||||
table[output_type][get_sym_type(sym)]();
|
||||
break;
|
||||
}
|
||||
case R_X86_64_GOT32:
|
||||
sym.flags |= NEEDS_GOT;
|
||||
rel_types[i] = R_GOT;
|
||||
|
4
main.cc
4
main.cc
@ -675,8 +675,8 @@ static void fix_synthetic_symbols(std::span<OutputChunk *> chunks) {
|
||||
// __start_ and __stop_ symbols
|
||||
for (OutputChunk *chunk : chunks) {
|
||||
if (is_c_identifier(chunk->name)) {
|
||||
start(Symbol::intern("__start_" + std::string(chunk->name)), chunk);
|
||||
stop(Symbol::intern("__stop_" + std::string(chunk->name)), chunk);
|
||||
start(Symbol::intern_alloc("__start_" + std::string(chunk->name)), chunk);
|
||||
stop(Symbol::intern_alloc("__stop_" + std::string(chunk->name)), chunk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user