1
1
mirror of https://github.com/rui314/mold.git synced 2024-12-27 10:23:41 +03:00
This commit is contained in:
Rui Ueyama 2021-04-01 21:38:10 +09:00
parent 7bbafa0790
commit ac49222f79
2 changed files with 11 additions and 5 deletions

12
mold.h
View File

@ -156,10 +156,16 @@ enum {
template <typename E>
struct EhReloc {
EhReloc(Symbol<E> &sym, u8 type, u32 offset, i64 addend)
: sym(sym), type(type), offset(offset), addend(addend) {
assert(this->offset == offset);
assert(this->addend == addend);
}
Symbol<E> &sym;
u32 type;
u32 offset;
i64 addend;
u32 type : 8;
u32 offset : 24;
i32 addend;
};
template <typename E>

View File

@ -323,9 +323,9 @@ void ObjectFile<E>::read_ehframe(Context<E> &ctx, InputSection<E> &isec) {
<< ": FDE with non-local relocations is not supported";
Symbol<E> &sym = *this->symbols[rels[0].r_sym];
eh_rels.push_back(EhReloc<E>{sym, rels[0].r_type,
eh_rels.push_back(EhReloc<E>(sym, rels[0].r_type,
(u32)(rels[0].r_offset - begin_offset),
isec.get_addend(rels[0])});
isec.get_addend(rels[0])));
rels = rels.subspan(1);
}