Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Mar 18, 2021
1 parent 5d04393 commit bbb0192
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion input_sections.cc
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ void InputSection::apply_reloc_alloc(u8 *base) {
case R_DTPOFF:
write(S + A - out::tls_begin);
break;
case R_DTPOFF_RELAX:
write(S + A - out::tls_end);
break;
case R_TPOFF:
write(S + A - out::tls_end);
break;
Expand Down Expand Up @@ -687,7 +690,7 @@ void InputSection::scan_relocations() {
Fatal() << *this << ": DTPOFF reloc refers external symbol " << sym;

if (config.relax && !config.shared)
rel_types[i] = R_TPOFF;
rel_types[i] = R_DTPOFF_RELAX;
else
rel_types[i] = R_DTPOFF;
break;
Expand Down
1 change: 1 addition & 0 deletions mold.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ enum RelType : u16 {
R_TLSLD,
R_TLSLD_RELAX_LE,
R_DTPOFF,
R_DTPOFF_RELAX,
R_TPOFF,
R_GOTTPOFF,
R_GOTTPOFF_RELAX,
Expand Down

0 comments on commit bbb0192

Please sign in to comment.