Skip to content

Commit

Permalink
powerpc: Fix lwsync feature fixup vs. modules on 64-bit
Browse files Browse the repository at this point in the history
Anton's commit enabling the use of the lwsync fixup mechanism on 64-bit
breaks modules. The lwsync fixup section uses .long instead of the
FTR_ENTRY_OFFSET macro used by other fixups sections, and thus will
generate 32-bit relocations that our module loader cannot resolve.

This changes it to use the same type as other feature sections.

Note however that we might want to consider using 32-bit for all the
feature fixup offsets and add support for R_PPC_REL32 to module_64.c
instead as that would reduce the size of the kernel image. I'll leave
that as an exercise for the reader for now...

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Benjamin Herrenschmidt committed Feb 26, 2010
1 parent 874f2f9 commit 3d98ffb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/include/asm/feature-fixups.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ label##2: \
.pushsection sect,"a"; \
.align 2; \
label##3: \
.long label##1b-label##3b; \
FTR_ENTRY_OFFSET label##1b-label##3b; \
.popsection;

#endif /* __ASM_POWERPC_FEATURE_FIXUPS_H */
3 changes: 2 additions & 1 deletion arch/powerpc/lib/feature-fixups.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)

void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end)
{
int *start, *end, *dest;
long *start, *end;
unsigned int *dest;

if (!(value & CPU_FTR_LWSYNC))
return ;
Expand Down

0 comments on commit 3d98ffb

Please sign in to comment.