Skip to content

Commit fa953ad

Browse files
goldelicomasahir0y
authored andcommitted
x86/tools/relocs: Fix non-POSIX regexp
Trying to run a cross-compiled x86 relocs tool on a BSD based HOSTCC leads to errors like VOFFSET arch/x86/boot/compressed/../voffset.h - due to: vmlinux CC arch/x86/boot/compressed/misc.o - due to: arch/x86/boot/compressed/../voffset.h OBJCOPY arch/x86/boot/compressed/vmlinux.bin - due to: vmlinux RELOCS arch/x86/boot/compressed/vmlinux.relocs - due to: vmlinux empty (sub)expressionarch/x86/boot/compressed/Makefile:118: recipe for target 'arch/x86/boot/compressed/vmlinux.relocs' failed make[3]: *** [arch/x86/boot/compressed/vmlinux.relocs] Error 1 It turns out that relocs.c uses patterns like "something(|_end)" This is not valid syntax or gives undefined results according to POSIX 9.5.3 ERE Grammar https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html It seems to be silently accepted by the Linux regexp() implementation while a BSD host complains. Such patterns can be replaced by a transformation like "(|p1|p2)" -> "(p1|p2)?" Fixes: fd95281 ("x86-32, relocs: Whitelist more symbols for ld bug workaround") Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent c500bee commit fa953ad

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

arch/x86/tools/relocs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ static const char * const sym_regex_kernel[S_NSYMTYPES] = {
5757
[S_REL] =
5858
"^(__init_(begin|end)|"
5959
"__x86_cpu_dev_(start|end)|"
60-
"(__parainstructions|__alt_instructions)(|_end)|"
61-
"(__iommu_table|__apicdrivers|__smp_locks)(|_end)|"
60+
"(__parainstructions|__alt_instructions)(_end)?|"
61+
"(__iommu_table|__apicdrivers|__smp_locks)(_end)?|"
6262
"__(start|end)_pci_.*|"
6363
"__(start|end)_builtin_fw|"
64-
"__(start|stop)___ksymtab(|_gpl)|"
65-
"__(start|stop)___kcrctab(|_gpl)|"
64+
"__(start|stop)___ksymtab(_gpl)?|"
65+
"__(start|stop)___kcrctab(_gpl)?|"
6666
"__(start|stop)___param|"
6767
"__(start|stop)___modver|"
6868
"__(start|stop)___bug_table|"

0 commit comments

Comments
 (0)