diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-05-23 17:02:34 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-05-23 17:02:34 -0400 |
commit | fd952815307f0f272bf49fd364a7fd2f9992bc42 (patch) | |
tree | 63ff7b6ae504237d0e40804224d621ce35eb2108 /arch | |
parent | b2d668da9307c4c163dd603d2bb3cadb10f9fd37 (diff) |
x86-32, relocs: Whitelist more symbols for ld bug workaround
As noted in checkin:
a3e854d95 x86, relocs: Workaround for binutils 2.22.52.0.1 section bug
ld version 2.22.52.0.[12] can incorrectly promote relative symbols to
absolute, if the output section they appear in is otherwise empty.
Since checkin:
6520fe55 x86, realmode: 16-bit real-mode code support for relocs tool
we actually check for this and error out rather than silently creating
a kernel which will malfunction if relocated.
Ingo found a configuration in which __start_builtin_fw triggered the
warning.
Go through the linker script sources and look for more symbols that
could plausibly get bogusly promoted to absolute, and add them to the
whitelist.
In general, if the following error triggers:
Invalid absolute R_386_32 relocation: <symbol>
... then we should verify that <symbol> is really meant to be
relocated, and add it and any related symbols manually to the S_REL
regexp.
Please note that 6520fe55 does not introduce the error, only the check
for the error -- without 6520fe55 this version of ld will simply
produce a corrupt kernel if CONFIG_RELOCATABLE is set on x86-32.
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: <stable@vger.kernel.org> v3.4
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/tools/relocs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c index b43cfcd9bf40..b8f7c65fc40c 100644 --- a/arch/x86/tools/relocs.c +++ b/arch/x86/tools/relocs.c | |||
@@ -60,6 +60,17 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = { | |||
60 | "__x86_cpu_dev_(start|end)|" | 60 | "__x86_cpu_dev_(start|end)|" |
61 | "(__parainstructions|__alt_instructions)(|_end)|" | 61 | "(__parainstructions|__alt_instructions)(|_end)|" |
62 | "(__iommu_table|__apicdrivers|__smp_locks)(|_end)|" | 62 | "(__iommu_table|__apicdrivers|__smp_locks)(|_end)|" |
63 | "__(start|end)_pci_.*|" | ||
64 | "__(start|end)_builtin_fw|" | ||
65 | "__(start|stop)___ksymtab(|_gpl|_unused|_unused_gpl|_gpl_future)|" | ||
66 | "__(start|stop)___kcrctab(|_gpl|_unused|_unused_gpl|_gpl_future)|" | ||
67 | "__(start|stop)___param|" | ||
68 | "__(start|stop)___modver|" | ||
69 | "__(start|stop)___bug_table|" | ||
70 | "__tracedata_(start|end)|" | ||
71 | "__(start|stop)_notes|" | ||
72 | "__end_rodata|" | ||
73 | "__initramfs_start|" | ||
63 | "_end)$" | 74 | "_end)$" |
64 | }; | 75 | }; |
65 | 76 | ||