OpenCloudOS-Kernel/arch/ia64/kernel
Roland McGrath 0b0bf7a3cc [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-31 13:28:43 -07:00
..
cpufreq Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Makefile [PATCH] vDSO hash-style fix 2006-07-31 13:28:43 -07:00
acpi-ext.c Pull acpi_os_free into release branch 2006-07-01 17:19:08 -04:00
acpi-processor.c [ACPI] IA64 ZX1 buildfix for _PDC patch 2005-12-05 17:24:45 -05:00
acpi.c Pull acpi_os_free into release branch 2006-07-01 17:19:08 -04:00
asm-offsets.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
audit.c [PATCH] audit syscall classes 2006-07-01 07:44:10 -04:00
brl_emu.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cyclone.c [IA64] don't report !sn2 or !summit hardware as an error 2006-03-07 15:26:49 -08:00
efi.c [PATCH] make valid_mmap_phys_addr_range() take a pfn 2006-07-10 13:24:25 -07:00
efi_stub.S [IA64] make efi_stub.S fit in 80 cols 2006-06-21 14:35:28 -07:00
entry.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
entry.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
fsys.S [IA64] cleanup in fsys.S 2006-02-28 08:53:32 -08:00
gate-data.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gate.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
gate.lds.S [PATCH] vDSO hash-style fix 2006-07-31 13:28:43 -07:00
head.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ia64_ksyms.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
init_task.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
iosapic.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
irq.c [PATCH] genirq: cleanup: remove irq_descp() 2006-06-29 10:26:22 -07:00
irq_ia64.c [PATCH] irq-flags: IA64: Use the new IRQF_ constants 2006-07-02 13:58:47 -07:00
irq_lsapic.c [PATCH] genirq: add ->retrigger() irq op to consolidate hw_irq_resend() 2006-06-29 10:26:23 -07:00
ivt.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
jprobes.S [IA64] prevent accidental modification of args in jprobe handler 2006-01-13 14:45:21 -08:00
kprobes.c [PATCH] IA64: kprobe invalidate icache of jump buffer 2006-07-31 13:28:38 -07:00
machvec.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mca.c [PATCH] sched: cleanup, remove task_t, convert to struct task_struct 2006-07-03 15:27:11 -07:00
mca_asm.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mca_drv.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mca_drv.h [IA64] MCA recovery: kernel context recovery table 2006-03-24 09:49:52 -08:00
mca_drv_asm.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
minstate.h Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
module.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
numa.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
pal.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
palinfo.c [PATCH] cpu hotplug: use hotplug version of registration in late inits 2006-07-31 13:28:39 -07:00
patch.c [IA64] add init declaration - gate page functions 2006-03-22 16:54:38 -08:00
perfmon.c [PATCH] irq-flags: IA64: Use the new IRQF_ constants 2006-07-02 13:58:47 -07:00
perfmon_default_smpl.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
perfmon_generic.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
perfmon_itanium.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
perfmon_mckinley.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
perfmon_montecito.h [IA64] Perfmon for Montecito 2006-01-16 10:31:44 -08:00
process.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
ptrace.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
sal.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
salinfo.c [PATCH] cpu hotplug: use hotplug version of cpu notifier in appropriate places 2006-06-27 17:32:41 -07:00
semaphore.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
setup.c [PATCH] tty: Remove include of screen_info.h from tty.h 2006-07-10 13:24:16 -07:00
sigframe.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
signal.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
smp.c [IA64] wider use of for_each_cpu_mask() in arch/ia64 2005-10-25 15:10:08 -07:00
smpboot.c [PATCH] sched: cleanup, remove task_t, convert to struct task_struct 2006-07-03 15:27:11 -07:00
sys_ia64.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
time.c [PATCH] irq-flags: IA64: Use the new IRQF_ constants 2006-07-02 13:58:47 -07:00
topology.c [PATCH] cpu hotplug: use hotplug version of registration in late inits 2006-07-31 13:28:39 -07:00
traps.c [PATCH] panic_on_oops: remove ssleep() 2006-07-31 13:28:39 -07:00
unaligned.c [IA64] sysctl option to silence unaligned trap warnings 2006-02-28 09:42:23 -08:00
uncached.c [PATCH] change gen_pool allocator to not touch managed memory 2006-06-23 07:42:49 -07:00
unwind.c [IA64] MCA/INIT: remove obsolete unwind code 2005-09-11 14:09:34 -07:00
unwind_decoder.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
unwind_i.h Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vmlinux.lds.S Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00