2005-04-16 18:20:36 -04:00
|
|
|
#
|
|
|
|
# Makefile for the linux kernel.
|
|
|
|
#
|
|
|
|
|
|
|
|
extra-y := head.o init_task.o vmlinux.lds
|
|
|
|
|
2007-10-11 05:12:33 -04:00
|
|
|
obj-y := process.o signal_32.o entry.o traps_32.o irq.o \
|
2007-10-11 05:12:29 -04:00
|
|
|
ptrace.o time.o ioport_32.o ldt.o setup_32.o i8259_32.o sys_i386_32.o \
|
2007-10-11 05:12:23 -04:00
|
|
|
pci-dma_32.o i386_ksyms.o i387.o bootflag.o e820_32.o\
|
2007-10-11 05:11:50 -04:00
|
|
|
quirks.o i8237.o topology.o alternative.o i8253_32.o tsc.o
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2006-07-03 03:24:39 -04:00
|
|
|
obj-$(CONFIG_STACKTRACE) += stacktrace.o
|
2005-04-16 18:20:36 -04:00
|
|
|
obj-y += cpu/
|
2006-03-08 20:57:25 -05:00
|
|
|
obj-y += acpi/
|
2005-04-16 18:20:36 -04:00
|
|
|
obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o
|
|
|
|
obj-$(CONFIG_MCA) += mca.o
|
|
|
|
obj-$(CONFIG_X86_MSR) += msr.o
|
|
|
|
obj-$(CONFIG_X86_CPUID) += cpuid.o
|
|
|
|
obj-$(CONFIG_MICROCODE) += microcode.o
|
|
|
|
obj-$(CONFIG_APM) += apm.o
|
2007-10-11 05:12:24 -04:00
|
|
|
obj-$(CONFIG_X86_SMP) += smp_32.o smpboot_32.o tsc_sync.o
|
2007-05-15 04:41:48 -04:00
|
|
|
obj-$(CONFIG_SMP) += smpcommon.o
|
2005-04-16 18:20:36 -04:00
|
|
|
obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
|
|
|
|
obj-$(CONFIG_X86_MPPARSE) += mpparse.o
|
2007-10-11 05:12:19 -04:00
|
|
|
obj-$(CONFIG_X86_LOCAL_APIC) += apic_32.o nmi_32.o
|
2007-10-11 05:11:49 -04:00
|
|
|
obj-$(CONFIG_X86_IO_APIC) += io_apic_32.o
|
2007-10-11 05:12:34 -04:00
|
|
|
obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o
|
2007-10-11 05:12:07 -04:00
|
|
|
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel_32.o crash_32.o
|
2006-01-09 23:51:50 -05:00
|
|
|
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
|
2005-04-16 18:20:36 -04:00
|
|
|
obj-$(CONFIG_X86_NUMAQ) += numaq.o
|
2007-10-11 05:12:31 -04:00
|
|
|
obj-$(CONFIG_X86_SUMMIT_NUMA) += summit_32.o
|
2005-04-16 18:20:36 -04:00
|
|
|
obj-$(CONFIG_KPROBES) += kprobes.o
|
2007-10-11 05:12:11 -04:00
|
|
|
obj-$(CONFIG_MODULES) += module_32.o
|
2007-10-11 05:12:21 -04:00
|
|
|
obj-y += sysenter_32.o vsyscall_32.o
|
2007-10-11 05:11:52 -04:00
|
|
|
obj-$(CONFIG_ACPI_SRAT) += srat_32.o
|
2007-10-11 05:12:09 -04:00
|
|
|
obj-$(CONFIG_EFI) += efi_32.o efi_stub_32.o
|
2006-01-08 04:05:24 -05:00
|
|
|
obj-$(CONFIG_DOUBLEFAULT) += doublefault.o
|
2007-10-11 05:12:05 -04:00
|
|
|
obj-$(CONFIG_VM86) += vm86_32.o
|
2005-04-16 18:20:36 -04:00
|
|
|
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
2007-10-11 05:12:20 -04:00
|
|
|
obj-$(CONFIG_HPET_TIMER) += hpet_32.o
|
2006-06-26 07:56:40 -04:00
|
|
|
obj-$(CONFIG_K8_NB) += k8.o
|
2007-10-11 05:12:26 -04:00
|
|
|
obj-$(CONFIG_MGEODE_LX) += geode_32.o
|
2006-12-06 20:14:08 -05:00
|
|
|
|
2007-10-11 05:11:57 -04:00
|
|
|
obj-$(CONFIG_VMI) += vmi_32.o vmiclock_32.o
|
2007-10-11 05:12:14 -04:00
|
|
|
obj-$(CONFIG_PARAVIRT) += paravirt_32.o
|
2007-02-13 07:26:26 -05:00
|
|
|
obj-y += pcspeaker.o
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
obj-$(CONFIG_SCx200) += scx200.o
|
|
|
|
|
2007-10-11 05:12:13 -04:00
|
|
|
# vsyscall_32.o contains the vsyscall DSO images as __initdata.
|
2005-04-16 18:20:36 -04:00
|
|
|
# We must build both images before we can assemble it.
|
|
|
|
# Note: kbuild does not track this dependency due to usage of .incbin
|
2007-10-11 05:12:30 -04:00
|
|
|
$(obj)/vsyscall_32.o: $(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter.so
|
2005-04-16 18:20:36 -04:00
|
|
|
targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so)
|
2007-10-11 05:12:02 -04:00
|
|
|
targets += vsyscall-note.o vsyscall_32.lds
|
2005-04-16 18:20:36 -04:00
|
|
|
|
|
|
|
# The DSO images are built using a special linker script.
|
|
|
|
quiet_cmd_syscall = SYSCALL $@
|
|
|
|
cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \
|
|
|
|
-Wl,-T,$(filter-out FORCE,$^) -o $@
|
|
|
|
|
2007-10-11 05:12:02 -04:00
|
|
|
export CPPFLAGS_vsyscall_32.lds += -P -C -U$(ARCH)
|
2005-04-16 18:20:36 -04:00
|
|
|
|
[PATCH] vDSO hash-style fix
The latest toolchains can produce a new ELF section in DSOs and
dynamically-linked executables. The new section ".gnu.hash" replaces
".hash", and allows for more efficient runtime symbol lookups by the
dynamic linker. The new ld option --hash-style={sysv|gnu|both} controls
whether to produce the old ".hash", the new ".gnu.hash", or both. In some
new systems such as Fedora Core 6, gcc by default passes --hash-style=gnu
to the linker, so that a standard invocation of "gcc -shared" results in
producing a DSO with only ".gnu.hash". The new ".gnu.hash" sections need
to be dealt with the same way as ".hash" sections in all respects; only the
dynamic linker cares about their contents. To work with older dynamic
linkers (i.e. preexisting releases of glibc), a binary must have the old
".hash" section. The --hash-style=both option produces binaries that a new
dynamic linker can use more efficiently, but an old dynamic linker can
still handle.
The new section runs afoul of the custom linker scripts used to build vDSO
images for the kernel. On ia64, the failure mode for this is a boot-time
panic because the vDSO's PT_IA_64_UNWIND segment winds up ill-formed.
This patch addresses the problem in two ways.
First, it mentions ".gnu.hash" in all the linker scripts alongside ".hash".
This produces correct vDSO images with --hash-style=sysv (or old tools),
with --hash-style=gnu, or with --hash-style=both.
Second, it passes the --hash-style=sysv option when building the vDSO
images, so that ".gnu.hash" is not actually produced. This is the most
conservative choice for compatibility with any old userland. There is some
concern that some ancient glibc builds (though not any known old production
system) might choke on --hash-style=both binaries. The optimizations
provided by the new style of hash section do not really matter for a DSO
with a tiny number of symbols, as the vDSO has. If someone wants to use
=gnu or =both for their vDSO builds and worry less about that
compatibility, just change the option and the linker script changes will
make any choice work fine.
Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Andi Kleen <ak@muc.de>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-30 06:04:06 -04:00
|
|
|
vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \
|
|
|
|
$(call ld-option, -Wl$(comma)--hash-style=sysv)
|
2005-04-16 18:20:36 -04:00
|
|
|
SYSCFLAGS_vsyscall-sysenter.so = $(vsyscall-flags)
|
2007-10-11 05:12:30 -04:00
|
|
|
SYSCFLAGS_vsyscall-int80_32.so = $(vsyscall-flags)
|
2005-04-16 18:20:36 -04:00
|
|
|
|
2007-10-11 05:12:30 -04:00
|
|
|
$(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter.so: \
|
2007-10-11 05:12:02 -04:00
|
|
|
$(obj)/vsyscall-%.so: $(src)/vsyscall_32.lds \
|
2005-04-16 18:24:48 -04:00
|
|
|
$(obj)/vsyscall-%.o $(obj)/vsyscall-note.o FORCE
|
2005-04-16 18:20:36 -04:00
|
|
|
$(call if_changed,syscall)
|
|
|
|
|
|
|
|
# We also create a special relocatable object that should mirror the symbol
|
|
|
|
# table and layout of the linked DSO. With ld -R we can then refer to
|
|
|
|
# these symbols in the kernel code rather than hand-coded addresses.
|
|
|
|
extra-y += vsyscall-syms.o
|
|
|
|
$(obj)/built-in.o: $(obj)/vsyscall-syms.o
|
|
|
|
$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o
|
|
|
|
|
|
|
|
SYSCFLAGS_vsyscall-syms.o = -r
|
2007-10-11 05:12:02 -04:00
|
|
|
$(obj)/vsyscall-syms.o: $(src)/vsyscall_32.lds \
|
2005-04-16 18:24:48 -04:00
|
|
|
$(obj)/vsyscall-sysenter.o $(obj)/vsyscall-note.o FORCE
|
2005-04-16 18:20:36 -04:00
|
|
|
$(call if_changed,syscall)
|
2006-06-26 07:56:40 -04:00
|
|
|
|
|
|
|
k8-y += ../../x86_64/kernel/k8.o
|
2006-09-26 04:52:34 -04:00
|
|
|
stacktrace-y += ../../x86_64/kernel/stacktrace.o
|
2006-06-26 07:56:40 -04:00
|
|
|
|