Skip to content

Commit

Permalink
oprofile, arm/sh: Fix oprofile_arch_exit() linkage issue
Browse files Browse the repository at this point in the history
This change fixes a linking problem, which happens if oprofile
is selected to be compiled as built-in:

  `oprofile_arch_exit' referenced in section `.init.text' of
  arch/arm/oprofile/built-in.o: defined in discarded section
  `.exit.text' of arch/arm/oprofile/built-in.o

The problem is appeared after commit 87121ca, which
introduced oprofile_arch_exit() calls from __init function. Note
that the aforementioned commit has been backported to stable
branches, and the problem is known to be reproduced at least
with 3.0.13 and 3.1.5 kernels.

Signed-off-by: Vladimir Zapolskiy <[email protected]>
Signed-off-by: Robert Richter <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: oprofile-list <[email protected]>
Cc: <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
Vladimir Zapolskiy authored and Ingo Molnar committed Dec 23, 2011
1 parent b9e26df commit 55205c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arch/arm/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
return oprofile_perf_init(ops);
}

void __exit oprofile_arch_exit(void)
void oprofile_arch_exit(void)
{
oprofile_perf_exit();
}
4 changes: 2 additions & 2 deletions arch/sh/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
return oprofile_perf_init(ops);
}

void __exit oprofile_arch_exit(void)
void oprofile_arch_exit(void)
{
oprofile_perf_exit();
kfree(sh_pmu_op_name);
Expand All @@ -60,5 +60,5 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
ops->backtrace = sh_backtrace;
return -ENODEV;
}
void __exit oprofile_arch_exit(void) {}
void oprofile_arch_exit(void) {}
#endif /* CONFIG_HW_PERF_EVENTS */

0 comments on commit 55205c9

Please sign in to comment.