Skip to content

Commit

Permalink
[POWER10] Emit dynamic relocation for ifunc
Browse files Browse the repository at this point in the history
Previously, we didn't emit a dynamic relocation for a statically-
initialized function pointer pointing to an ifunc on POWER10, e.g.

  int fn() __attribute__((ifunc("resolve_fn")));
  void *ptr = fn;

Fixes #1142
  • Loading branch information
rui314 committed Nov 6, 2023
1 parent e11d64b commit 31c3b53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion elf/input-sections.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static Action get_absrel_action(Context<E> &ctx, Symbol<E> &sym) {
template <typename E>
static Action get_dyn_absrel_action(Context<E> &ctx, Symbol<E> &sym) {
if (sym.is_ifunc())
return ctx.arg.pic ? IFUNC_DYNREL : NONE;
return sym.is_pde_ifunc(ctx) ? NONE : IFUNC_DYNREL;

// This is a decision table for absolute relocations for the pointer
// size data (e.g. R_X86_64_64). Unlike the absrel_table, we can emit
Expand Down

0 comments on commit 31c3b53

Please sign in to comment.