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 */
|
2006-02-02 22:31:16 +08:00
|
|
|
#include <asm/asm-offsets.h>
|
2012-07-19 15:11:14 +08:00
|
|
|
#include <asm/thread_info.h>
|
2012-08-15 02:08:01 +08:00
|
|
|
|
2012-12-28 22:15:25 +08:00
|
|
|
#define PAGE_SIZE _PAGE_SIZE
|
|
|
|
|
2012-08-15 02:08:01 +08:00
|
|
|
/*
|
|
|
|
* Put .bss..swapper_pg_dir as the first thing in .bss. This will
|
|
|
|
* ensure that it has .bss alignment (64K).
|
|
|
|
*/
|
|
|
|
#define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
|
|
|
|
2006-04-05 16:45:45 +08:00
|
|
|
#undef mips
|
2005-04-17 06:20:36 +08:00
|
|
|
#define mips mips
|
|
|
|
OUTPUT_ARCH(mips)
|
|
|
|
ENTRY(kernel_entry)
|
2007-10-15 05:49:01 +08:00
|
|
|
PHDRS {
|
|
|
|
text PT_LOAD FLAGS(7); /* RWX */
|
2015-10-30 06:54:48 +08:00
|
|
|
#ifndef CONFIG_CAVIUM_OCTEON_SOC
|
2007-10-15 05:49:01 +08:00
|
|
|
note PT_NOTE FLAGS(4); /* R__ */
|
2015-10-30 06:54:48 +08:00
|
|
|
#endif /* CAVIUM_OCTEON_SOC */
|
2007-10-15 05:49:01 +08:00
|
|
|
}
|
2009-09-20 18:28:22 +08:00
|
|
|
|
2009-09-25 03:44:24 +08:00
|
|
|
#ifdef CONFIG_32BIT
|
|
|
|
#ifdef CONFIG_CPU_LITTLE_ENDIAN
|
2013-01-22 19:59:30 +08:00
|
|
|
jiffies = jiffies_64;
|
2009-09-25 03:44:24 +08:00
|
|
|
#else
|
2013-01-22 19:59:30 +08:00
|
|
|
jiffies = jiffies_64 + 4;
|
2009-09-25 03:44:24 +08:00
|
|
|
#endif
|
|
|
|
#else
|
2013-01-22 19:59:30 +08:00
|
|
|
jiffies = jiffies_64;
|
2009-09-25 03:44:24 +08:00
|
|
|
#endif
|
2007-09-16 05:35:53 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_BOOT_ELF64
|
2007-09-16 05:35:53 +08:00
|
|
|
/* Read-only sections, merged into text segment: */
|
|
|
|
/* . = 0xc000000000000000; */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-09-16 05:35:53 +08:00
|
|
|
/* This is the value for an Origin kernel, taken from an IRIX kernel. */
|
|
|
|
/* . = 0xc00000000001c000; */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-09-16 05:35:53 +08:00
|
|
|
/* Set the vaddr for the text segment to a value
|
|
|
|
* >= 0xa800 0000 0001 9000 if no symmon is going to configured
|
|
|
|
* >= 0xa800 0000 0030 0000 otherwise
|
|
|
|
*/
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-09-16 05:35:53 +08:00
|
|
|
/* . = 0xa800000000300000; */
|
|
|
|
. = 0xffffffff80300000;
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif
|
2009-09-20 18:28:22 +08:00
|
|
|
. = VMLINUX_LOAD_ADDRESS;
|
2007-09-16 05:35:53 +08:00
|
|
|
/* read-only */
|
|
|
|
_text = .; /* Text and read-only data */
|
|
|
|
.text : {
|
|
|
|
TEXT_TEXT
|
|
|
|
SCHED_TEXT
|
2016-10-08 08:02:55 +08:00
|
|
|
CPUIDLE_TEXT
|
2007-09-16 05:35:53 +08:00
|
|
|
LOCK_TEXT
|
2007-10-15 05:50:05 +08:00
|
|
|
KPROBES_TEXT
|
2009-11-20 20:34:33 +08:00
|
|
|
IRQENTRY_TEXT
|
2016-03-26 05:22:05 +08:00
|
|
|
SOFTIRQENTRY_TEXT
|
2008-08-05 22:45:14 +08:00
|
|
|
*(.text.*)
|
2007-09-16 05:35:53 +08:00
|
|
|
*(.fixup)
|
|
|
|
*(.gnu.warning)
|
2007-10-15 05:49:01 +08:00
|
|
|
} :text = 0
|
2007-09-16 05:35:53 +08:00
|
|
|
_etext = .; /* End of text section */
|
|
|
|
|
2009-08-01 04:58:19 +08:00
|
|
|
EXCEPTION_TABLE(16)
|
2007-09-16 05:35:53 +08:00
|
|
|
|
|
|
|
/* Exception table for data bus errors */
|
|
|
|
__dbe_table : {
|
|
|
|
__start___dbe_table = .;
|
|
|
|
*(__dbe_table)
|
|
|
|
__stop___dbe_table = .;
|
|
|
|
}
|
2007-10-15 05:49:01 +08:00
|
|
|
|
2015-10-30 06:54:48 +08:00
|
|
|
#ifdef CONFIG_CAVIUM_OCTEON_SOC
|
|
|
|
#define NOTES_HEADER
|
|
|
|
#else /* CONFIG_CAVIUM_OCTEON_SOC */
|
|
|
|
#define NOTES_HEADER :note
|
|
|
|
#endif /* CONFIG_CAVIUM_OCTEON_SOC */
|
|
|
|
NOTES :text NOTES_HEADER
|
2007-10-15 05:49:01 +08:00
|
|
|
.dummy : { *(.dummy) } :text
|
|
|
|
|
2011-05-20 09:34:58 +08:00
|
|
|
_sdata = .; /* Start of data section */
|
2007-09-16 05:35:53 +08:00
|
|
|
RODATA
|
|
|
|
|
|
|
|
/* writeable */
|
|
|
|
.data : { /* Data */
|
2007-10-19 05:12:32 +08:00
|
|
|
. = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
|
2007-09-16 05:35:53 +08:00
|
|
|
|
2012-07-19 15:11:14 +08:00
|
|
|
INIT_TASK_DATA(THREAD_SIZE)
|
2009-08-01 04:58:19 +08:00
|
|
|
NOSAVE_DATA
|
|
|
|
CACHELINE_ALIGNED_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
|
2011-03-29 18:40:06 +08:00
|
|
|
READ_MOSTLY_DATA(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
|
2007-10-19 05:12:32 +08:00
|
|
|
DATA_DATA
|
|
|
|
CONSTRUCTORS
|
2007-09-16 05:35:53 +08:00
|
|
|
}
|
2017-03-30 23:49:27 +08:00
|
|
|
BUG_TABLE
|
2007-09-16 05:35:53 +08:00
|
|
|
_gp = . + 0x8000;
|
|
|
|
.lit8 : {
|
|
|
|
*(.lit8)
|
|
|
|
}
|
|
|
|
.lit4 : {
|
|
|
|
*(.lit4)
|
|
|
|
}
|
|
|
|
/* We want the small data sections together, so single-instruction offsets
|
|
|
|
can access them all, and initialized data all before uninitialized, so
|
|
|
|
we can shorten the on-disk segment size. */
|
|
|
|
.sdata : {
|
|
|
|
*(.sdata)
|
|
|
|
}
|
|
|
|
_edata = .; /* End of data section */
|
|
|
|
|
|
|
|
/* will be freed after init */
|
2009-08-01 04:58:18 +08:00
|
|
|
. = ALIGN(PAGE_SIZE); /* Init code and data */
|
2007-09-16 05:35:53 +08:00
|
|
|
__init_begin = .;
|
2009-08-01 04:58:19 +08:00
|
|
|
INIT_TEXT_SECTION(PAGE_SIZE)
|
|
|
|
INIT_DATA_SECTION(16)
|
2007-09-16 05:35:53 +08:00
|
|
|
|
2010-11-23 23:06:25 +08:00
|
|
|
. = ALIGN(4);
|
|
|
|
.mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) {
|
|
|
|
__mips_machines_start = .;
|
|
|
|
*(.mips.machines.init)
|
|
|
|
__mips_machines_end = .;
|
|
|
|
}
|
|
|
|
|
2007-09-16 05:35:53 +08:00
|
|
|
/* .exit.text is discarded at runtime, not link time, to deal with
|
|
|
|
* references from .rodata
|
|
|
|
*/
|
|
|
|
.exit.text : {
|
2008-01-20 21:15:03 +08:00
|
|
|
EXIT_TEXT
|
2007-09-16 05:35:53 +08:00
|
|
|
}
|
|
|
|
.exit.data : {
|
2008-01-20 21:15:03 +08:00
|
|
|
EXIT_DATA
|
2007-09-16 05:35:53 +08:00
|
|
|
}
|
2015-04-12 18:24:58 +08:00
|
|
|
#ifdef CONFIG_SMP
|
2011-03-25 01:50:09 +08:00
|
|
|
PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
|
2015-04-12 18:24:58 +08:00
|
|
|
#endif
|
2016-03-31 17:05:34 +08:00
|
|
|
|
|
|
|
#ifdef CONFIG_RELOCATABLE
|
|
|
|
. = ALIGN(4);
|
|
|
|
|
|
|
|
.data.reloc : {
|
|
|
|
_relocation_start = .;
|
|
|
|
/*
|
|
|
|
* Space for relocation table
|
|
|
|
* This needs to be filled so that the
|
|
|
|
* relocs tool can overwrite the content.
|
|
|
|
* An invalid value is left at the start of the
|
|
|
|
* section to abort relocation if the table
|
|
|
|
* has not been filled in.
|
|
|
|
*/
|
|
|
|
LONG(0xFFFFFFFF);
|
|
|
|
FILL(0);
|
|
|
|
. += CONFIG_RELOCATION_TABLE_SIZE - 4;
|
|
|
|
_relocation_end = .;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-04-12 18:24:58 +08:00
|
|
|
#ifdef CONFIG_MIPS_RAW_APPENDED_DTB
|
|
|
|
__appended_dtb = .;
|
|
|
|
/* leave space for appended DTB */
|
|
|
|
. += 0x100000;
|
2015-09-11 22:46:14 +08:00
|
|
|
#elif defined(CONFIG_MIPS_ELF_APPENDED_DTB)
|
|
|
|
.appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) {
|
|
|
|
*(.appended_dtb)
|
|
|
|
KEEP(*(.appended_dtb))
|
|
|
|
}
|
2015-04-12 18:24:58 +08:00
|
|
|
#endif
|
2012-08-15 02:08:01 +08:00
|
|
|
/*
|
|
|
|
* Align to 64K in attempt to eliminate holes before the
|
|
|
|
* .bss..swapper_pg_dir section at the start of .bss. This
|
|
|
|
* also satisfies PAGE_SIZE alignment as the largest page size
|
|
|
|
* allowed is 64K.
|
|
|
|
*/
|
|
|
|
. = ALIGN(0x10000);
|
2007-09-16 05:35:53 +08:00
|
|
|
__init_end = .;
|
|
|
|
/* freed after init ends here */
|
|
|
|
|
2012-08-15 02:08:01 +08:00
|
|
|
/*
|
|
|
|
* Force .bss to 64K alignment so that .bss..swapper_pg_dir
|
2013-01-22 19:59:30 +08:00
|
|
|
* gets that alignment. .sbss should be empty, so there will be
|
2012-08-15 02:08:01 +08:00
|
|
|
* no holes after __init_end. */
|
2016-11-07 19:52:19 +08:00
|
|
|
BSS_SECTION(0, 0x10000, 8)
|
2007-09-16 05:35:53 +08:00
|
|
|
|
|
|
|
_end = . ;
|
|
|
|
|
|
|
|
/* These mark the ABI of the kernel for debuggers. */
|
|
|
|
.mdebug.abi32 : {
|
|
|
|
KEEP(*(.mdebug.abi32))
|
|
|
|
}
|
|
|
|
.mdebug.abi64 : {
|
|
|
|
KEEP(*(.mdebug.abi64))
|
|
|
|
}
|
|
|
|
|
|
|
|
/* This is the MIPS specific mdebug section. */
|
|
|
|
.mdebug : {
|
|
|
|
*(.mdebug)
|
|
|
|
}
|
|
|
|
|
|
|
|
STABS_DEBUG
|
|
|
|
DWARF_DEBUG
|
|
|
|
|
|
|
|
/* These must appear regardless of . */
|
|
|
|
.gptab.sdata : {
|
|
|
|
*(.gptab.data)
|
|
|
|
*(.gptab.sdata)
|
|
|
|
}
|
|
|
|
.gptab.sbss : {
|
|
|
|
*(.gptab.bss)
|
|
|
|
*(.gptab.sbss)
|
|
|
|
}
|
linker script: unify usage of discard definition
Discarded sections in different archs share some commonality but have
considerable differences. This led to linker script for each arch
implementing its own /DISCARD/ definition, which makes maintaining
tedious and adding new entries error-prone.
This patch makes all linker scripts to move discard definitions to the
end of the linker script and use the common DISCARDS macro. As ld
uses the first matching section definition, archs can include default
discarded sections by including them earlier in the linker script.
ia64 is notable because it first throws away some ia64 specific
subsections and then include the rest of the sections into the final
image, so those sections must be discarded before the inclusion.
defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
alpha, sparc, sparc64 and s390. Michal Simek tested microblaze.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Tony Luck <tony.luck@intel.com>
2009-07-09 10:27:40 +08:00
|
|
|
|
|
|
|
/* Sections to be discarded */
|
|
|
|
DISCARDS
|
|
|
|
/DISCARD/ : {
|
|
|
|
/* ABI crap starts here */
|
2015-10-30 06:54:47 +08:00
|
|
|
*(.MIPS.abiflags)
|
linker script: unify usage of discard definition
Discarded sections in different archs share some commonality but have
considerable differences. This led to linker script for each arch
implementing its own /DISCARD/ definition, which makes maintaining
tedious and adding new entries error-prone.
This patch makes all linker scripts to move discard definitions to the
end of the linker script and use the common DISCARDS macro. As ld
uses the first matching section definition, archs can include default
discarded sections by including them earlier in the linker script.
ia64 is notable because it first throws away some ia64 specific
subsections and then include the rest of the sections into the final
image, so those sections must be discarded before the inclusion.
defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
alpha, sparc, sparc64 and s390. Michal Simek tested microblaze.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Tony Luck <tony.luck@intel.com>
2009-07-09 10:27:40 +08:00
|
|
|
*(.MIPS.options)
|
|
|
|
*(.options)
|
|
|
|
*(.pdr)
|
|
|
|
*(.reginfo)
|
2013-08-09 02:40:49 +08:00
|
|
|
*(.eh_frame)
|
linker script: unify usage of discard definition
Discarded sections in different archs share some commonality but have
considerable differences. This led to linker script for each arch
implementing its own /DISCARD/ definition, which makes maintaining
tedious and adding new entries error-prone.
This patch makes all linker scripts to move discard definitions to the
end of the linker script and use the common DISCARDS macro. As ld
uses the first matching section definition, archs can include default
discarded sections by including them earlier in the linker script.
ia64 is notable because it first throws away some ia64 specific
subsections and then include the rest of the sections into the final
image, so those sections must be discarded before the inclusion.
defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
alpha, sparc, sparc64 and s390. Michal Simek tested microblaze.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Tested-by: Michal Simek <monstr@monstr.eu>
Cc: linux-arch@vger.kernel.org
Cc: Michal Simek <monstr@monstr.eu>
Cc: microblaze-uclinux@itee.uq.edu.au
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Tony Luck <tony.luck@intel.com>
2009-07-09 10:27:40 +08:00
|
|
|
}
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|