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 14:07:57 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2005-04-16 22:20:36 +00:00
|
|
|
/* Kernel link layout for various "sections"
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999-2003 Matthew Wilcox <willy at parisc-linux.org>
|
|
|
|
* Copyright (C) 2000-2003 Paul Bame <bame at parisc-linux.org>
|
|
|
|
* Copyright (C) 2000 John Marvin <jsm at parisc-linux.org>
|
|
|
|
* Copyright (C) 2000 Michael Ang <mang with subcarrier.org>
|
|
|
|
* Copyright (C) 2002 Randolph Chung <tausq with parisc-linux.org>
|
|
|
|
* Copyright (C) 2003 James Bottomley <jejb with parisc-linux.org>
|
2013-11-30 21:07:51 +00:00
|
|
|
* Copyright (C) 2006-2013 Helge Deller <deller@gmx.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Put page table entries (swapper_pg_dir) as the first thing in .bss. This
|
|
|
|
* will ensure that it has .bss alignment (PAGE_SIZE).
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
2013-11-30 21:07:51 +00:00
|
|
|
#define BSS_FIRST_SECTIONS *(.data..vm0.pmd) \
|
|
|
|
*(.data..vm0.pgd) \
|
|
|
|
*(.data..vm0.pte)
|
|
|
|
|
parisc: add dynamic ftrace
This patch implements dynamic ftrace for PA-RISC. The required mcount
call sequences can get pretty long, so instead of patching the
whole call sequence out of the functions, we are using
-fpatchable-function-entry from gcc. This puts a configurable amount of
NOPS before/at the start of the function. Taking do_sys_open() as example,
which would look like this when the call is patched out:
1036b248: 08 00 02 40 nop
1036b24c: 08 00 02 40 nop
1036b250: 08 00 02 40 nop
1036b254: 08 00 02 40 nop
1036b258 <do_sys_open>:
1036b258: 08 00 02 40 nop
1036b25c: 08 03 02 41 copy r3,r1
1036b260: 6b c2 3f d9 stw rp,-14(sp)
1036b264: 08 1e 02 43 copy sp,r3
1036b268: 6f c1 01 00 stw,ma r1,80(sp)
When ftrace gets enabled for this function the kernel will patch these
NOPs to:
1036b248: 10 19 57 20 <address of ftrace>
1036b24c: 6f c1 00 80 stw,ma r1,40(sp)
1036b250: 48 21 3f d1 ldw -18(r1),r1
1036b254: e8 20 c0 02 bv,n r0(r1)
1036b258 <do_sys_open>:
1036b258: e8 3f 1f df b,l,n .-c,r1
1036b25c: 08 03 02 41 copy r3,r1
1036b260: 6b c2 3f d9 stw rp,-14(sp)
1036b264: 08 1e 02 43 copy sp,r3
1036b268: 6f c1 01 00 stw,ma r1,80(sp)
So the first NOP in do_sys_open() will be patched to jump backwards into
some minimal trampoline code which pushes a stackframe, saves r1 which
holds the return address, loads the address of the real ftrace function,
and branches to that location. For 64 Bit things are getting a bit more
complicated (and longer) because we must make sure that the address of
ftrace location is 8 byte aligned, and the offset passed to ldd for
fetching the address is 8 byte aligned as well.
Note that gcc has a bug which misplaces the function label, and needs a
patch to make dynamic ftrace work. See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90751 for details.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
2019-06-05 20:32:22 +00:00
|
|
|
#define CC_USING_PATCHABLE_FUNCTION_ENTRY
|
2019-10-29 21:13:45 +00:00
|
|
|
#define RO_EXCEPTION_TABLE_ALIGN 8
|
parisc: add dynamic ftrace
This patch implements dynamic ftrace for PA-RISC. The required mcount
call sequences can get pretty long, so instead of patching the
whole call sequence out of the functions, we are using
-fpatchable-function-entry from gcc. This puts a configurable amount of
NOPS before/at the start of the function. Taking do_sys_open() as example,
which would look like this when the call is patched out:
1036b248: 08 00 02 40 nop
1036b24c: 08 00 02 40 nop
1036b250: 08 00 02 40 nop
1036b254: 08 00 02 40 nop
1036b258 <do_sys_open>:
1036b258: 08 00 02 40 nop
1036b25c: 08 03 02 41 copy r3,r1
1036b260: 6b c2 3f d9 stw rp,-14(sp)
1036b264: 08 1e 02 43 copy sp,r3
1036b268: 6f c1 01 00 stw,ma r1,80(sp)
When ftrace gets enabled for this function the kernel will patch these
NOPs to:
1036b248: 10 19 57 20 <address of ftrace>
1036b24c: 6f c1 00 80 stw,ma r1,40(sp)
1036b250: 48 21 3f d1 ldw -18(r1),r1
1036b254: e8 20 c0 02 bv,n r0(r1)
1036b258 <do_sys_open>:
1036b258: e8 3f 1f df b,l,n .-c,r1
1036b25c: 08 03 02 41 copy r3,r1
1036b260: 6b c2 3f d9 stw rp,-14(sp)
1036b264: 08 1e 02 43 copy sp,r3
1036b268: 6f c1 01 00 stw,ma r1,80(sp)
So the first NOP in do_sys_open() will be patched to jump backwards into
some minimal trampoline code which pushes a stackframe, saves r1 which
holds the return address, loads the address of the real ftrace function,
and branches to that location. For 64 Bit things are getting a bit more
complicated (and longer) because we must make sure that the address of
ftrace location is 8 byte aligned, and the offset passed to ldd for
fetching the address is 8 byte aligned as well.
Note that gcc has a bug which misplaces the function label, and needs a
patch to make dynamic ftrace work. See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90751 for details.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
2019-06-05 20:32:22 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <asm-generic/vmlinux.lds.h>
|
2013-11-30 21:07:51 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/* needed for the processor specific cache alignment size */
|
|
|
|
#include <asm/cache.h>
|
|
|
|
#include <asm/page.h>
|
2006-04-20 20:40:23 +00:00
|
|
|
#include <asm/asm-offsets.h>
|
2009-09-27 22:39:47 +00:00
|
|
|
#include <asm/thread_info.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* ld script to make hppa Linux kernel */
|
|
|
|
#ifndef CONFIG_64BIT
|
|
|
|
OUTPUT_FORMAT("elf32-hppa-linux")
|
|
|
|
OUTPUT_ARCH(hppa)
|
|
|
|
#else
|
|
|
|
OUTPUT_FORMAT("elf64-hppa-linux")
|
|
|
|
OUTPUT_ARCH(hppa:hppa2.0w)
|
|
|
|
#endif
|
|
|
|
|
2019-05-14 19:40:53 +00:00
|
|
|
#define EXIT_TEXT_SECTIONS() .exit.text : { EXIT_TEXT }
|
|
|
|
#if !defined(CONFIG_64BIT) || defined(CONFIG_MLONGCALLS)
|
|
|
|
#define MLONGCALL_KEEP(x)
|
|
|
|
#define MLONGCALL_DISCARD(x) x
|
|
|
|
#else
|
|
|
|
#define MLONGCALL_KEEP(x) x
|
|
|
|
#define MLONGCALL_DISCARD(x)
|
|
|
|
#endif
|
|
|
|
|
2013-11-30 21:07:51 +00:00
|
|
|
ENTRY(parisc_kernel_start)
|
2005-04-16 22:20:36 +00:00
|
|
|
#ifndef CONFIG_64BIT
|
|
|
|
jiffies = jiffies_64 + 4;
|
|
|
|
#else
|
|
|
|
jiffies = jiffies_64;
|
|
|
|
#endif
|
|
|
|
SECTIONS
|
|
|
|
{
|
2007-10-18 07:04:25 +00:00
|
|
|
. = KERNEL_BINARY_TEXT_START;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2013-11-30 21:07:51 +00:00
|
|
|
__init_begin = .;
|
|
|
|
HEAD_TEXT_SECTION
|
2019-05-14 19:40:53 +00:00
|
|
|
MLONGCALL_DISCARD(INIT_TEXT_SECTION(8))
|
2013-11-30 21:07:51 +00:00
|
|
|
|
|
|
|
. = ALIGN(PAGE_SIZE);
|
|
|
|
INIT_DATA_SECTION(PAGE_SIZE)
|
2019-05-14 19:40:53 +00:00
|
|
|
MLONGCALL_DISCARD(EXIT_TEXT_SECTIONS())
|
2013-11-30 21:07:51 +00:00
|
|
|
.exit.data :
|
|
|
|
{
|
|
|
|
EXIT_DATA
|
|
|
|
}
|
|
|
|
PERCPU_SECTION(8)
|
2018-10-16 20:38:22 +00:00
|
|
|
. = ALIGN(4);
|
|
|
|
.altinstructions : {
|
|
|
|
__alt_instructions = .;
|
|
|
|
*(.altinstructions)
|
|
|
|
__alt_instructions_end = .;
|
|
|
|
}
|
2015-11-21 23:07:44 +00:00
|
|
|
. = ALIGN(HUGEPAGE_SIZE);
|
2013-11-30 21:07:51 +00:00
|
|
|
__init_end = .;
|
|
|
|
/* freed after init ends here */
|
|
|
|
|
2007-10-18 07:04:25 +00:00
|
|
|
_text = .; /* Text and read-only data */
|
2013-11-30 21:07:51 +00:00
|
|
|
_stext = .;
|
2019-05-14 19:40:53 +00:00
|
|
|
MLONGCALL_KEEP(INIT_TEXT_SECTION(8))
|
2013-11-30 21:07:51 +00:00
|
|
|
.text ALIGN(PAGE_SIZE) : {
|
2007-10-18 07:04:25 +00:00
|
|
|
TEXT_TEXT
|
2019-05-14 19:40:53 +00:00
|
|
|
LOCK_TEXT
|
2007-10-18 07:04:25 +00:00
|
|
|
SCHED_TEXT
|
2016-10-08 00:02:55 +00:00
|
|
|
CPUIDLE_TEXT
|
2009-02-08 23:43:36 +00:00
|
|
|
KPROBES_TEXT
|
|
|
|
IRQENTRY_TEXT
|
2016-03-25 21:22:05 +00:00
|
|
|
SOFTIRQENTRY_TEXT
|
2007-10-18 07:04:25 +00:00
|
|
|
*(.text.do_softirq)
|
|
|
|
*(.text.sys_exit)
|
|
|
|
*(.text.do_sigaltstack)
|
|
|
|
*(.text.do_fork)
|
2017-07-09 20:50:40 +00:00
|
|
|
*(.text.div)
|
|
|
|
*($$*) /* millicode routines */
|
2007-10-18 07:04:25 +00:00
|
|
|
*(.text.*)
|
|
|
|
*(.fixup)
|
|
|
|
*(.lock.text) /* out-of-line lock text */
|
|
|
|
*(.gnu.warning)
|
2012-05-17 14:34:34 +00:00
|
|
|
}
|
2019-05-14 19:40:53 +00:00
|
|
|
MLONGCALL_KEEP(EXIT_TEXT_SECTIONS())
|
2013-11-30 21:07:51 +00:00
|
|
|
. = ALIGN(PAGE_SIZE);
|
2007-10-18 07:04:25 +00:00
|
|
|
_etext = .;
|
2013-11-30 21:07:51 +00:00
|
|
|
/* End of text section */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2011-05-20 01:34:58 +00:00
|
|
|
/* Start of data section */
|
|
|
|
_sdata = .;
|
|
|
|
|
2016-10-09 09:12:34 +00:00
|
|
|
/* Architecturally we need to keep __gp below 0x1000000 and thus
|
2019-10-29 21:13:34 +00:00
|
|
|
* in front of RO_DATA() which stores lots of tracepoint
|
2016-10-09 09:12:34 +00:00
|
|
|
* and ftrace symbols. */
|
2013-11-30 21:07:51 +00:00
|
|
|
#ifdef CONFIG_64BIT
|
|
|
|
. = ALIGN(16);
|
|
|
|
/* Linkage tables */
|
|
|
|
.opd : {
|
2017-11-09 23:48:28 +00:00
|
|
|
__start_opd = .;
|
2013-11-30 21:07:51 +00:00
|
|
|
*(.opd)
|
2017-11-09 23:48:28 +00:00
|
|
|
__end_opd = .;
|
2013-11-30 21:07:51 +00:00
|
|
|
} PROVIDE (__gp = .);
|
|
|
|
.plt : {
|
|
|
|
*(.plt)
|
|
|
|
}
|
|
|
|
.dlt : {
|
|
|
|
*(.dlt)
|
|
|
|
}
|
|
|
|
#endif
|
2007-08-27 03:28:34 +00:00
|
|
|
|
2019-10-29 21:13:34 +00:00
|
|
|
RO_DATA(8)
|
2016-10-09 09:12:34 +00:00
|
|
|
|
2007-10-18 07:04:25 +00:00
|
|
|
/* unwind info */
|
|
|
|
.PARISC.unwind : {
|
|
|
|
__start___unwind = .;
|
|
|
|
*(.PARISC.unwind)
|
|
|
|
__stop___unwind = .;
|
|
|
|
}
|
2006-04-20 20:40:23 +00:00
|
|
|
|
2013-11-30 21:07:51 +00:00
|
|
|
/* writeable */
|
|
|
|
/* Make sure this is page aligned so
|
|
|
|
* that we can properly leave these
|
|
|
|
* as writable
|
|
|
|
*/
|
2015-11-21 23:07:44 +00:00
|
|
|
. = ALIGN(HUGEPAGE_SIZE);
|
2013-11-30 21:07:51 +00:00
|
|
|
data_start = .;
|
|
|
|
|
2007-10-18 07:04:25 +00:00
|
|
|
/* Data */
|
2019-10-29 21:13:35 +00:00
|
|
|
RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, PAGE_SIZE)
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-10-18 07:04:25 +00:00
|
|
|
/* PA-RISC locks requires 16-byte alignment */
|
|
|
|
. = ALIGN(16);
|
2010-02-20 00:03:55 +00:00
|
|
|
.data..lock_aligned : {
|
|
|
|
*(.data..lock_aligned)
|
2007-10-18 07:04:25 +00:00
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-10-18 07:04:25 +00:00
|
|
|
/* End of data section */
|
|
|
|
_edata = .;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-10-18 07:04:25 +00:00
|
|
|
/* BSS */
|
2015-11-21 23:07:44 +00:00
|
|
|
BSS_SECTION(PAGE_SIZE, PAGE_SIZE, PAGE_SIZE)
|
|
|
|
|
|
|
|
. = ALIGN(HUGEPAGE_SIZE);
|
2007-10-18 07:04:25 +00:00
|
|
|
_end = . ;
|
2007-07-19 08:48:12 +00:00
|
|
|
|
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 02:27:40 +00:00
|
|
|
STABS_DEBUG
|
2020-08-21 19:42:45 +00:00
|
|
|
ELF_DETAILS
|
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 02:27:40 +00:00
|
|
|
.note 0 : { *(.note) }
|
|
|
|
|
2007-10-18 07:04:25 +00:00
|
|
|
/* Sections to be discarded */
|
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 02:27:40 +00:00
|
|
|
DISCARDS
|
2007-10-18 07:04:25 +00:00
|
|
|
/DISCARD/ : {
|
2005-04-16 22:20:36 +00:00
|
|
|
#ifdef CONFIG_64BIT
|
2007-10-18 07:04:25 +00:00
|
|
|
/* temporary hack until binutils is fixed to not emit these
|
|
|
|
* for static binaries
|
|
|
|
*/
|
|
|
|
*(.interp)
|
|
|
|
*(.dynsym)
|
|
|
|
*(.dynstr)
|
|
|
|
*(.dynamic)
|
|
|
|
*(.hash)
|
|
|
|
*(.gnu.hash)
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|