Skip to contentSkip to conversation

2.6.20-rc6-mm1: linker error with arch_setup_additional_pages

DISCUSSION Parag Warudkar 3 participants 4 messages Jan 28, 2007 – Jan 29, 2007

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines

CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_IA32_EMULATION is not set

Hm Ok. That's explainable. You don't have CONFIG_IA32_EMULATION set and arch_setup_additional pages is only defined/exported in syscall32.c which won't be built in your case. (It should go away if you set CONFIG_IA32_EMULATION).

Andi - Is arch_setup_additional_pages required for x86_64 without IA32? If so what should it call (like it calls syscall32_setup_pages in IA32 case)? If it is not needed I guess we can make it a no-op in case IA32_EMULATION=n?

linux/interp.h -
#ifdef CONFIG_X86_64 && !defined CONFIG_IA32_EMULATION static inline int arch_setup_additional_pages(struct linux_binprm *bprm,
int executable_stack)

{
       return 0;
}

Perhaps we need an arch-specific override for interp.h?

Parag

#1 lore raw
Quoted 9 lines · Parag Warudkar
Quoted 3 lines

CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
# CONFIG_IA32_EMULATION is not set

Hm Ok. That's explainable. You don't have CONFIG_IA32_EMULATION set and arch_setup_additional pages is only defined/exported in syscall32.c which won't be built in your case. (It should go away if you set CONFIG_IA32_EMULATION).

I think the easy and correct fix for this situation is defining CONFIG_ARCH_HAS_SETUP_ADDITIONAL_PAGES on x86_64 only if IA32_EMULATION is defined. (Because x86_64 proper doesn't seem to require arch_setup_additional_pages() only IA32 emulation requires it.)

The patch below should fix it. (Please use attachment - less chance of whitespace issues. Sorry no control over mail client atm)

--- linux-2.6.20-rc6-mm1/arch/x86_64/Kconfig.orig 2007-01-28
17:32:09.000000000 -0500
+++ linux-2.6.20-rc6-mm1/arch/x86_64/Kconfig 2007-01-28 17:32:48.000000000 -0500
@@ -405,7 +405,7 @@
config ARCH_HAS_SETUP_ADDITIONAL_PAGES
bool
default y
- depends on X86_64
+ depends on X86_64 && IA32_EMULATION

config OUT_OF_LINE_PFN_TO_PAGE
def_bool y

arch/x86_64/Kconfig renamed from arch/x86_64/Kconfig.orig +1 -1
@@ -405,7 +405,7 @@
 config ARCH_HAS_SETUP_ADDITIONAL_PAGES
 	bool
 	default y
-	depends on X86_64
+	depends on X86_64 && IA32_EMULATION
 
 config OUT_OF_LINE_PFN_TO_PAGE
 	def_bool y
#2 lore raw
Quoted 9 lines

I think the easy and correct fix for this situation is defining CONFIG_ARCH_HAS_SETUP_ADDITIONAL_PAGES on x86_64 only if IA32_EMULATION is defined. (Because x86_64 proper doesn't seem to require arch_setup_additional_pages() only IA32 emulation requires it.)

The patch below should fix it. (Please use attachment - less chance of whitespace issues. Sorry no control over mail client atm)

A more elegant solution would be to do away with the CONFIG and switch to a weak function in the caller.

-Andi

#3 lore raw
Quoted 7 lines · On Mon, 29 Jan 2007 03:51:54 +0100 Andi Kleen <[email protected]> wrote:
Quoted 7 lines

I think the easy and correct fix for this situation is defining CONFIG_ARCH_HAS_SETUP_ADDITIONAL_PAGES on x86_64 only if IA32_EMULATION is defined. (Because x86_64 proper doesn't seem to require arch_setup_additional_pages() only IA32 emulation requires it.)

Quoted 6 lines
Quoted 2 lines

The patch below should fix it. (Please use attachment - less chance of whitespace issues. Sorry no control over mail client atm)

A more elegant solution would be to do away with the CONFIG and switch to a weak function in the caller.

Now why didn't I think of that?