mirror of
https://github.com/rui314/mold.git
synced 2024-09-20 17:39:56 +03:00
Refactor
This commit is contained in:
parent
54f50a7cb4
commit
a1e0ca8a7f
@ -154,7 +154,7 @@ void InputSection<E>::apply_reloc_alloc(Context<E> &ctx, u8 *base) {
|
||||
|
||||
#define S sym.get_addr(ctx)
|
||||
#define A this->get_addend(rel)
|
||||
#define P (output_section->shdr.sh_addr + offset + rel.r_offset)
|
||||
#define P (get_addr() + rel.r_offset)
|
||||
#define T (sym.get_addr(ctx) & 1)
|
||||
#define G (sym.get_got_idx(ctx) * sizeof(Word<E>))
|
||||
#define GOT ctx.got->shdr.sh_addr
|
||||
|
@ -158,7 +158,7 @@ void InputSection<E>::apply_reloc_alloc(Context<E> &ctx, u8 *base) {
|
||||
|
||||
#define S sym.get_addr(ctx)
|
||||
#define A rel.r_addend
|
||||
#define P (output_section->shdr.sh_addr + offset + rel.r_offset)
|
||||
#define P (get_addr() + rel.r_offset)
|
||||
#define G (sym.get_got_idx(ctx) * sizeof(Word<E>))
|
||||
#define GOT ctx.got->shdr.sh_addr
|
||||
|
||||
|
@ -169,7 +169,7 @@ void InputSection<E>::apply_reloc_alloc(Context<E> &ctx, u8 *base) {
|
||||
|
||||
#define S sym.get_addr(ctx)
|
||||
#define A this->get_addend(rel)
|
||||
#define P (output_section->shdr.sh_addr + offset + rel.r_offset)
|
||||
#define P (get_addr() + rel.r_offset)
|
||||
#define G (sym.get_got_idx(ctx) * sizeof(Word<E>))
|
||||
#define GOT ctx.got->shdr.sh_addr
|
||||
|
||||
|
@ -195,7 +195,7 @@ void InputSection<E>::apply_reloc_alloc(Context<E> &ctx, u8 *base) {
|
||||
|
||||
#define S sym.get_addr(ctx)
|
||||
#define A rel.r_addend
|
||||
#define P (output_section->shdr.sh_addr + offset + rel.r_offset)
|
||||
#define P (get_addr() + rel.r_offset)
|
||||
#define G (sym.get_got_idx(ctx) * sizeof(Word<E>))
|
||||
#define GOT ctx.got->shdr.sh_addr
|
||||
|
||||
|
@ -172,7 +172,7 @@ void InputSection<E>::apply_reloc_alloc(Context<E> &ctx, u8 *base) {
|
||||
|
||||
#define S sym.get_addr(ctx)
|
||||
#define A rel.r_addend
|
||||
#define P (output_section->shdr.sh_addr + offset + rel.r_offset)
|
||||
#define P (get_addr() + rel.r_offset)
|
||||
#define G (sym.get_got_idx(ctx) * sizeof(Word<E>))
|
||||
#define GOT ctx.got->shdr.sh_addr
|
||||
|
||||
|
@ -230,7 +230,7 @@ void InputSection<E>::apply_reloc_alloc(Context<E> &ctx, u8 *base) {
|
||||
|
||||
#define S sym.get_addr(ctx)
|
||||
#define A rel.r_addend
|
||||
#define P (output_section->shdr.sh_addr + offset + rel.r_offset)
|
||||
#define P (get_addr() + rel.r_offset)
|
||||
#define G (sym.get_got_addr(ctx) - ctx.gotplt->shdr.sh_addr)
|
||||
#define GOT ctx.gotplt->shdr.sh_addr
|
||||
|
||||
|
@ -1861,6 +1861,7 @@ void CopyrelSection<E>::add_symbol(Context<E> &ctx, Symbol<E> *sym) {
|
||||
this->shdr.sh_size = align_to(this->shdr.sh_size, this->shdr.sh_addralign);
|
||||
sym->value = this->shdr.sh_size;
|
||||
sym->has_copyrel = true;
|
||||
|
||||
this->shdr.sh_size += sym->esym().st_size;
|
||||
symbols.push_back(sym);
|
||||
ctx.dynsym->add_symbol(ctx, sym);
|
||||
|
Loading…
Reference in New Issue
Block a user