License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2005-04-17 06:20:36 +08:00
|
|
|
#
|
|
|
|
# linux/arch/arm/boot/compressed/Makefile
|
|
|
|
#
|
|
|
|
# create a compressed vmlinuz image from the original vmlinux
|
|
|
|
#
|
|
|
|
|
2011-01-11 11:01:08 +08:00
|
|
|
OBJS =
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
HEAD = head.o
|
2011-01-11 11:01:08 +08:00
|
|
|
OBJS += misc.o decompress.o
|
2013-03-14 15:48:06 +08:00
|
|
|
ifeq ($(CONFIG_DEBUG_UNCOMPRESS),y)
|
|
|
|
OBJS += debug.o
|
2020-09-04 16:07:41 +08:00
|
|
|
AFLAGS_head.o += -DDEBUG
|
2013-03-14 15:48:06 +08:00
|
|
|
endif
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2011-09-14 09:42:55 +08:00
|
|
|
# string library code (-Os is enforced to keep it much smaller)
|
|
|
|
OBJS += string.o
|
|
|
|
CFLAGS_string.o := -Os
|
|
|
|
|
2012-02-11 10:07:07 +08:00
|
|
|
ifeq ($(CONFIG_ARM_VIRT_EXT),y)
|
|
|
|
OBJS += hyp-stub.o
|
|
|
|
endif
|
|
|
|
|
2014-09-19 03:39:15 +08:00
|
|
|
GCOV_PROFILE := n
|
2020-10-26 06:50:09 +08:00
|
|
|
KASAN_SANITIZE := n
|
2014-09-19 03:39:15 +08:00
|
|
|
|
2018-06-15 06:27:44 +08:00
|
|
|
# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
|
|
|
|
KCOV_INSTRUMENT := n
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#
|
|
|
|
# Architecture dependencies
|
|
|
|
#
|
|
|
|
ifeq ($(CONFIG_ARCH_ACORN),y)
|
2007-06-04 01:54:42 +08:00
|
|
|
OBJS += ll_char_wr.o font.o
|
2005-04-17 06:20:36 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARCH_SA1100),y)
|
|
|
|
OBJS += head-sa1100.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_CPU_XSCALE),y)
|
|
|
|
OBJS += head-xscale.o
|
|
|
|
endif
|
|
|
|
|
2010-06-23 09:27:32 +08:00
|
|
|
ifeq ($(CONFIG_PXA_SHARPSL_DETECT_MACH_ID),y)
|
2005-04-17 06:20:36 +08:00
|
|
|
OBJS += head-sharpsl.o
|
|
|
|
endif
|
|
|
|
|
2009-05-30 21:00:18 +08:00
|
|
|
ifeq ($(CONFIG_CPU_ENDIAN_BE32),y)
|
2006-09-26 16:36:37 +08:00
|
|
|
ifeq ($(CONFIG_CPU_CP15),y)
|
2005-04-17 06:20:36 +08:00
|
|
|
OBJS += big-endian.o
|
2006-09-26 16:36:37 +08:00
|
|
|
else
|
|
|
|
# The endian should be set by h/w design.
|
|
|
|
endif
|
2005-04-17 06:20:36 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# We now have a PIC decompressor implementation. Decompressors running
|
|
|
|
# from RAM should not define ZTEXTADDR. Decompressors running directly
|
|
|
|
# from ROM or Flash must define ZTEXTADDR (preferably via the config)
|
|
|
|
# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
|
|
|
|
ifeq ($(CONFIG_ZBOOT_ROM),y)
|
|
|
|
ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT)
|
|
|
|
ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS)
|
|
|
|
else
|
|
|
|
ZTEXTADDR := 0
|
2011-04-22 09:45:08 +08:00
|
|
|
ZBSSADDR := ALIGN(8)
|
2005-04-17 06:20:36 +08:00
|
|
|
endif
|
|
|
|
|
2020-08-06 17:32:33 +08:00
|
|
|
MALLOC_SIZE := 65536
|
|
|
|
|
|
|
|
AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) -DMALLOC_SIZE=$(MALLOC_SIZE)
|
2014-06-17 22:00:54 +08:00
|
|
|
CPPFLAGS_vmlinux.lds := -DTEXT_START="$(ZTEXTADDR)" -DBSS_START="$(ZBSSADDR)"
|
2018-04-03 19:02:28 +08:00
|
|
|
CPPFLAGS_vmlinux.lds += -DTEXT_OFFSET="$(TEXT_OFFSET)"
|
2020-08-06 17:32:33 +08:00
|
|
|
CPPFLAGS_vmlinux.lds += -DMALLOC_SIZE="$(MALLOC_SIZE)"
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-02-22 20:32:58 +08:00
|
|
|
compress-$(CONFIG_KERNEL_GZIP) = gzip
|
kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}
GZIP-compressed files end with 4 byte data that represents the size
of the original input. The decompressors (the self-extracting kernel)
exploit it to know the vmlinux size beforehand. To mimic the GZIP's
trailer, Kbuild provides cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}.
Unfortunately these macros are used everywhere despite the appended
size data is only useful for the decompressors.
There is no guarantee that such hand-crafted trailers are safely ignored.
In fact, the kernel refuses compressed initramdfs with the garbage data.
That is why usr/Makefile overrides size_append to make it no-op.
To limit the use of such broken compressed files, this commit renames
the existing macros as follows:
cmd_bzip2 --> cmd_bzip2_with_size
cmd_lzma --> cmd_lzma_with_size
cmd_lzo --> cmd_lzo_with_size
cmd_lz4 --> cmd_lz4_with_size
cmd_xzkern --> cmd_xzkern_with_size
cmd_zstd22 --> cmd_zstd22_with_size
To keep the decompressors working, I updated the following Makefiles
accordingly:
arch/arm/boot/compressed/Makefile
arch/h8300/boot/compressed/Makefile
arch/mips/boot/compressed/Makefile
arch/parisc/boot/compressed/Makefile
arch/s390/boot/compressed/Makefile
arch/sh/boot/compressed/Makefile
arch/x86/boot/compressed/Makefile
I reused the current macro names for the normal usecases; they produce
the compressed data in the proper format.
I did not touch the following:
arch/arc/boot/Makefile
arch/arm64/boot/Makefile
arch/csky/boot/Makefile
arch/mips/boot/Makefile
arch/riscv/boot/Makefile
arch/sh/boot/Makefile
kernel/Makefile
This means those Makefiles will stop appending the size data.
I dropped the 'override size_append' hack from usr/Makefile.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <n.schier@avm.de>
2022-01-10 02:15:27 +08:00
|
|
|
compress-$(CONFIG_KERNEL_LZO) = lzo_with_size
|
|
|
|
compress-$(CONFIG_KERNEL_LZMA) = lzma_with_size
|
|
|
|
compress-$(CONFIG_KERNEL_XZ) = xzkern_with_size
|
|
|
|
compress-$(CONFIG_KERNEL_LZ4) = lz4_with_size
|
2010-01-09 06:42:43 +08:00
|
|
|
|
ARM: 8969/1: decompressor: simplify libfdt builds
Copying source files during the build time may not end up with
as clean code as expected.
lib/fdt*.c simply wrap scripts/dtc/libfdt/fdt*.c, and it works
nicely. Let's follow this approach for the arm decompressor, too.
Add four wrappers, arch/arm/boot/compressed/fdt*.c and remove
the Makefile messes. Another nice thing is we no longer need to
maintain the own libfdt_env.h because the decompressor can include
<linux/libfdt_env.h>.
There is a subtle problem when generated files are turned into
check-in files.
When you are doing a rebuild of an existing object tree with O=
option, there exists stale "shipped" copies that the old Makefile
implementation created. The build system ends up with compiling the
stale generated files because Make searches for prerequisites in the
current directory, i.e. $(objtree) first, and then the directory
listed in VPATH, i.e. $(srctree).
To mend this issue, I added the following code:
ifdef building_out_of_srctree
$(shell rm -f $(addprefix $(obj)/, fdt_rw.c fdt_ro.c fdt_wip.c fdt.c))
endif
This will need to stay for a while because "git bisect" crossing this
commit, otherwise, would result in a build error.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2020-04-22 21:08:53 +08:00
|
|
|
libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o
|
2011-09-14 10:37:07 +08:00
|
|
|
|
|
|
|
ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
|
2021-08-10 02:07:30 +08:00
|
|
|
CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
|
|
|
|
CFLAGS_atags_to_fdt.o += -Wframe-larger-than=1280
|
2011-09-14 10:37:07 +08:00
|
|
|
OBJS += $(libfdt_objs) atags_to_fdt.o
|
|
|
|
endif
|
2021-01-04 21:00:52 +08:00
|
|
|
ifeq ($(CONFIG_USE_OF),y)
|
|
|
|
OBJS += $(libfdt_objs) fdt_check_mem_start.o
|
|
|
|
endif
|
2011-09-14 10:37:07 +08:00
|
|
|
|
2022-03-31 16:47:09 +08:00
|
|
|
OBJS += lib1funcs.o ashldi3.o bswapsdi2.o
|
|
|
|
|
2016-02-22 20:32:24 +08:00
|
|
|
targets := vmlinux vmlinux.lds piggy_data piggy.o \
|
2016-02-22 20:30:37 +08:00
|
|
|
head.o $(OBJS)
|
2008-05-31 16:53:50 +08:00
|
|
|
|
2015-05-26 22:39:36 +08:00
|
|
|
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
|
|
|
|
|
ARM: 8961/2: Fix Kbuild issue caused by per-task stack protector GCC plugin
When using plugins, GCC requires that the -fplugin= options precedes
any of its plugin arguments appearing on the command line as well.
This is usually not a concern, but as it turns out, this requirement
is causing some issues with ARM's per-task stack protector plugin
and Kbuild's implementation of $(cc-option).
When the per-task stack protector plugin is enabled, and we tweak
the implementation of cc-option not to pipe the stderr output of
GCC to /dev/null, the following output is generated when GCC is
executed in the context of cc-option:
cc1: error: plugin arm_ssp_per_task_plugin should be specified before \
-fplugin-arg-arm_ssp_per_task_plugin-tso=1 in the command line
cc1: error: plugin arm_ssp_per_task_plugin should be specified before \
-fplugin-arg-arm_ssp_per_task_plugin-offset=24 in the command line
These errors will cause any option passed to cc-option to be treated
as unsupported, which is obviously incorrect.
The cause of this issue is the fact that the -fplugin= argument is
added to GCC_PLUGINS_CFLAGS, whereas the arguments above are added
to KBUILD_CFLAGS, and the contents of the former get filtered out of
the latter before being passed to the GCC running the cc-option test,
and so the -fplugin= option does not appear at all on the GCC command
line.
Adding the arguments to GCC_PLUGINS_CFLAGS instead of KBUILD_CFLAGS
would be the correct approach here, if it weren't for the fact that we
are using $(eval) to defer the moment that they are added until after
asm-offsets.h is generated, which is after the point where the contents
of GCC_PLUGINS_CFLAGS are added to KBUILD_CFLAGS. So instead, we have
to add our plugin arguments to both.
For similar reasons, we cannot append DISABLE_ARM_SSP_PER_TASK_PLUGIN
to KBUILD_CFLAGS, as it will be passed to GCC when executing in the
context of cc-option, whereas the other plugin arguments will have
been filtered out, resulting in a similar error and false negative
result as above. So add it to ccflags-y instead.
Fixes: 189af4657186da08 ("ARM: smp: add support for per-task stack canaries")
Reported-by: Merlijn Wajer <merlijn@wizzup.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2020-02-18 16:15:34 +08:00
|
|
|
ccflags-y := -fpic $(call cc-option,-mno-single-pic-base,) -fno-builtin \
|
2021-10-26 16:23:31 +08:00
|
|
|
-I$(srctree)/scripts/dtc/libfdt -fno-stack-protector \
|
ARM: 8961/2: Fix Kbuild issue caused by per-task stack protector GCC plugin
When using plugins, GCC requires that the -fplugin= options precedes
any of its plugin arguments appearing on the command line as well.
This is usually not a concern, but as it turns out, this requirement
is causing some issues with ARM's per-task stack protector plugin
and Kbuild's implementation of $(cc-option).
When the per-task stack protector plugin is enabled, and we tweak
the implementation of cc-option not to pipe the stderr output of
GCC to /dev/null, the following output is generated when GCC is
executed in the context of cc-option:
cc1: error: plugin arm_ssp_per_task_plugin should be specified before \
-fplugin-arg-arm_ssp_per_task_plugin-tso=1 in the command line
cc1: error: plugin arm_ssp_per_task_plugin should be specified before \
-fplugin-arg-arm_ssp_per_task_plugin-offset=24 in the command line
These errors will cause any option passed to cc-option to be treated
as unsupported, which is obviously incorrect.
The cause of this issue is the fact that the -fplugin= argument is
added to GCC_PLUGINS_CFLAGS, whereas the arguments above are added
to KBUILD_CFLAGS, and the contents of the former get filtered out of
the latter before being passed to the GCC running the cc-option test,
and so the -fplugin= option does not appear at all on the GCC command
line.
Adding the arguments to GCC_PLUGINS_CFLAGS instead of KBUILD_CFLAGS
would be the correct approach here, if it weren't for the fact that we
are using $(eval) to defer the moment that they are added until after
asm-offsets.h is generated, which is after the point where the contents
of GCC_PLUGINS_CFLAGS are added to KBUILD_CFLAGS. So instead, we have
to add our plugin arguments to both.
For similar reasons, we cannot append DISABLE_ARM_SSP_PER_TASK_PLUGIN
to KBUILD_CFLAGS, as it will be passed to GCC when executing in the
context of cc-option, whereas the other plugin arguments will have
been filtered out, resulting in a similar error and false negative
result as above. So add it to ccflags-y instead.
Fixes: 189af4657186da08 ("ARM: smp: add support for per-task stack canaries")
Reported-by: Merlijn Wajer <merlijn@wizzup.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Acked-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2020-02-18 16:15:34 +08:00
|
|
|
-I$(obj) $(DISABLE_ARM_SSP_PER_TASK_PLUGIN)
|
2020-07-07 17:21:16 +08:00
|
|
|
ccflags-remove-$(CONFIG_FUNCTION_TRACER) += -pg
|
2013-06-01 05:50:47 +08:00
|
|
|
asflags-y := -DZIMAGE
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2011-06-12 13:07:33 +08:00
|
|
|
# Supply kernel BSS size to the decompressor via a linker symbol.
|
2019-11-19 23:39:42 +08:00
|
|
|
KBSS_SZ = $(shell echo $$(($$($(NM) $(obj)/../../../../vmlinux | \
|
2021-02-06 02:23:00 +08:00
|
|
|
sed -n -e 's/^\([^ ]*\) [ABD] __bss_start$$/-0x\1/p' \
|
|
|
|
-e 's/^\([^ ]*\) [ABD] __bss_stop$$/+0x\1/p') )) )
|
2011-06-12 13:07:33 +08:00
|
|
|
LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ)
|
2010-09-10 05:39:41 +08:00
|
|
|
# Supply ZRELADDR to the decompressor via a linker symbol.
|
|
|
|
ifneq ($(CONFIG_AUTO_ZRELADDR),y)
|
2011-02-21 11:57:38 +08:00
|
|
|
LDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR)
|
2010-09-10 05:39:41 +08:00
|
|
|
endif
|
2009-05-30 21:00:18 +08:00
|
|
|
ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
|
|
|
|
LDFLAGS_vmlinux += --be8
|
|
|
|
endif
|
2010-01-09 06:42:43 +08:00
|
|
|
# Report unresolved symbol references
|
|
|
|
LDFLAGS_vmlinux += --no-undefined
|
|
|
|
# Delete all temporary local symbols
|
|
|
|
LDFLAGS_vmlinux += -X
|
2020-09-02 10:53:45 +08:00
|
|
|
# Report orphan sections
|
2020-11-20 04:46:56 +08:00
|
|
|
ifdef CONFIG_LD_ORPHAN_WARN
|
|
|
|
LDFLAGS_vmlinux += --orphan-handling=warn
|
|
|
|
endif
|
2010-01-09 06:42:43 +08:00
|
|
|
# Next argument is a linker script
|
|
|
|
LDFLAGS_vmlinux += -T
|
|
|
|
|
2011-04-28 02:54:39 +08:00
|
|
|
# We need to prevent any GOTOFF relocs being used with references
|
|
|
|
# to symbols in the .bss section since we cannot relocate them
|
|
|
|
# independently from the rest at run time. This can be achieved by
|
|
|
|
# ensuring that no private .bss symbols exist, as global symbols
|
|
|
|
# always have a GOT entry which is what we need.
|
|
|
|
# The .data section is already discarded by the linker script so no need
|
|
|
|
# to bother about it here.
|
|
|
|
check_for_bad_syms = \
|
2019-11-19 23:39:42 +08:00
|
|
|
bad_syms=$$($(NM) $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \
|
2011-04-28 02:54:39 +08:00
|
|
|
[ -z "$$bad_syms" ] || \
|
|
|
|
( echo "following symbols must have non local/private scope:" >&2; \
|
2018-12-31 16:24:08 +08:00
|
|
|
echo "$$bad_syms" >&2; false )
|
2011-04-28 02:54:39 +08:00
|
|
|
|
2011-08-17 21:22:11 +08:00
|
|
|
check_for_multiple_zreladdr = \
|
2011-10-04 21:33:34 +08:00
|
|
|
if [ $(words $(ZRELADDR)) -gt 1 -a "$(CONFIG_AUTO_ZRELADDR)" = "" ]; then \
|
2011-08-17 21:22:11 +08:00
|
|
|
echo 'multiple zreladdrs: $(ZRELADDR)'; \
|
|
|
|
echo 'This needs CONFIG_AUTO_ZRELADDR to be set'; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
|
2015-09-24 11:17:54 +08:00
|
|
|
efi-obj-$(CONFIG_EFI_STUB) := $(objtree)/drivers/firmware/efi/libstub/lib.a
|
|
|
|
|
2016-02-22 20:32:24 +08:00
|
|
|
$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
|
2021-10-31 01:52:58 +08:00
|
|
|
$(addprefix $(obj)/, $(OBJS)) \
|
|
|
|
$(efi-obj-y) FORCE
|
2011-08-17 21:22:11 +08:00
|
|
|
@$(check_for_multiple_zreladdr)
|
2005-04-17 06:20:36 +08:00
|
|
|
$(call if_changed,ld)
|
2011-04-28 02:54:39 +08:00
|
|
|
@$(check_for_bad_syms)
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-02-22 20:32:24 +08:00
|
|
|
$(obj)/piggy_data: $(obj)/../Image FORCE
|
2016-02-22 20:32:58 +08:00
|
|
|
$(call if_changed,$(compress-y))
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-02-22 20:32:24 +08:00
|
|
|
$(obj)/piggy.o: $(obj)/piggy_data
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-06-04 01:54:42 +08:00
|
|
|
CFLAGS_font.o := -Dstatic=
|
2016-02-19 18:04:45 +08:00
|
|
|
AFLAGS_hyp-stub.o := -Wa,-march=armv7-a
|