1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-28 19:04:27 +03:00

temporary

This commit is contained in:
Rui Ueyama 2021-01-13 21:57:12 +09:00
parent 2776a6bf5b
commit cfb3416e68
2 changed files with 15 additions and 11 deletions

View File

@ -178,16 +178,18 @@ void InputSection::copy_buf() {
break; break;
case R_ABS: case R_ABS:
write(S + A); write(S + A);
break;
case R_ABS_DYN:
if (is_readonly)
recompile_error();
if (config.pie && sym.is_relative()) { write(S + A);
if (is_readonly)
recompile_error(); memset(dynrel, 0, sizeof(*dynrel));
memset(dynrel, 0, sizeof(*dynrel)); dynrel->r_offset = P;
dynrel->r_offset = P; dynrel->r_type = R_X86_64_RELATIVE;
dynrel->r_type = R_X86_64_RELATIVE; dynrel->r_addend = S + A;
dynrel->r_addend = S + A; dynrel++;
dynrel++;
}
break; break;
case R_DYN: case R_DYN:
if (is_readonly) if (is_readonly)
@ -298,10 +300,11 @@ void InputSection::scan_relocations() {
rel_types[i] = R_DYN; rel_types[i] = R_DYN;
sym.flags |= NEEDS_DYNSYM; sym.flags |= NEEDS_DYNSYM;
file->num_dynrel++; file->num_dynrel++;
} else if (sym.is_relative()) {
rel_types[i] = R_ABS_DYN;
file->num_dynrel++;
} else { } else {
rel_types[i] = R_ABS; rel_types[i] = R_ABS;
if (sym.is_relative())
file->num_dynrel++;
} }
} else { } else {
rel_types[i] = R_ABS; rel_types[i] = R_ABS;

1
mold.h
View File

@ -280,6 +280,7 @@ protected:
enum RelType : u8 { enum RelType : u8 {
R_NONE, R_NONE,
R_ABS, R_ABS,
R_ABS_DYN,
R_DYN, R_DYN,
R_PC, R_PC,
R_GOT, R_GOT,