]> git.baikalelectronics.ru Git - kernel.git/commit
x86-32, relocs: Whitelist more symbols for ld bug workaround
authorH. Peter Anvin <hpa@zytor.com>
Wed, 23 May 2012 21:02:34 +0000 (14:02 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Wed, 23 May 2012 21:02:34 +0000 (14:02 -0700)
commitc3fc800928f697bf5ffc422c790ef6134e1cc701
tree63ff7b6ae504237d0e40804224d621ce35eb2108
parentb059b7015ff7cf08e0fb337ea94f4c36b53d3909
x86-32, relocs: Whitelist more symbols for ld bug workaround

As noted in checkin:

8579eeacc 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:

7a815d8c 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 7a815d8c does not introduce the error, only the check
for the error -- without 7a815d8c 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
arch/x86/tools/relocs.c