Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f01ec4fc
K
Kernel
项目概览
openeuler
/
Kernel
大约 2 年 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
f01ec4fc
编写于
11月 25, 2019
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'x86/build' into x86/asm, to pick up completed topic branch
Signed-off-by:
N
Ingo Molnar
<
mingo@kernel.org
>
上级
45c08383
66584ea6
变更
38
隐藏空白更改
内联
并排
Showing
38 changed file
with
163 addition
and
179 deletion
+163
-179
arch/alpha/kernel/vmlinux.lds.S
arch/alpha/kernel/vmlinux.lds.S
+8
-10
arch/arc/kernel/vmlinux.lds.S
arch/arc/kernel/vmlinux.lds.S
+2
-4
arch/arm/kernel/vmlinux-xip.lds.S
arch/arm/kernel/vmlinux-xip.lds.S
+1
-3
arch/arm/kernel/vmlinux.lds.S
arch/arm/kernel/vmlinux.lds.S
+1
-3
arch/arm64/kernel/vmlinux.lds.S
arch/arm64/kernel/vmlinux.lds.S
+5
-5
arch/c6x/kernel/vmlinux.lds.S
arch/c6x/kernel/vmlinux.lds.S
+4
-4
arch/csky/kernel/vmlinux.lds.S
arch/csky/kernel/vmlinux.lds.S
+2
-3
arch/h8300/kernel/vmlinux.lds.S
arch/h8300/kernel/vmlinux.lds.S
+5
-4
arch/hexagon/kernel/vmlinux.lds.S
arch/hexagon/kernel/vmlinux.lds.S
+2
-3
arch/ia64/kernel/vmlinux.lds.S
arch/ia64/kernel/vmlinux.lds.S
+9
-11
arch/m68k/kernel/vmlinux-nommu.lds
arch/m68k/kernel/vmlinux-nommu.lds
+2
-2
arch/m68k/kernel/vmlinux-std.lds
arch/m68k/kernel/vmlinux-std.lds
+2
-2
arch/m68k/kernel/vmlinux-sun3.lds
arch/m68k/kernel/vmlinux-sun3.lds
+2
-2
arch/microblaze/kernel/vmlinux.lds.S
arch/microblaze/kernel/vmlinux.lds.S
+4
-4
arch/mips/kernel/vmlinux.lds.S
arch/mips/kernel/vmlinux.lds.S
+6
-9
arch/nds32/kernel/vmlinux.lds.S
arch/nds32/kernel/vmlinux.lds.S
+2
-3
arch/nios2/kernel/vmlinux.lds.S
arch/nios2/kernel/vmlinux.lds.S
+2
-3
arch/openrisc/kernel/vmlinux.lds.S
arch/openrisc/kernel/vmlinux.lds.S
+3
-4
arch/parisc/kernel/vmlinux.lds.S
arch/parisc/kernel/vmlinux.lds.S
+4
-7
arch/powerpc/kernel/vmlinux.lds.S
arch/powerpc/kernel/vmlinux.lds.S
+7
-30
arch/riscv/kernel/vmlinux.lds.S
arch/riscv/kernel/vmlinux.lds.S
+2
-3
arch/s390/kernel/vmlinux.lds.S
arch/s390/kernel/vmlinux.lds.S
+5
-7
arch/sh/kernel/vmlinux.lds.S
arch/sh/kernel/vmlinux.lds.S
+1
-2
arch/sparc/kernel/vmlinux.lds.S
arch/sparc/kernel/vmlinux.lds.S
+1
-2
arch/um/include/asm/common.lds.S
arch/um/include/asm/common.lds.S
+1
-2
arch/unicore32/kernel/vmlinux.lds.S
arch/unicore32/kernel/vmlinux.lds.S
+2
-3
arch/x86/boot/Makefile
arch/x86/boot/Makefile
+1
-0
arch/x86/boot/compressed/Makefile
arch/x86/boot/compressed/Makefile
+1
-0
arch/x86/entry/vdso/Makefile
arch/x86/entry/vdso/Makefile
+0
-2
arch/x86/include/asm/processor.h
arch/x86/include/asm/processor.h
+1
-1
arch/x86/include/asm/sections.h
arch/x86/include/asm/sections.h
+0
-1
arch/x86/kernel/setup.c
arch/x86/kernel/setup.c
+11
-1
arch/x86/kernel/vmlinux.lds.S
arch/x86/kernel/vmlinux.lds.S
+7
-9
arch/x86/mm/init.c
arch/x86/mm/init.c
+4
-4
arch/x86/mm/init_64.c
arch/x86/mm/init_64.c
+9
-7
arch/x86/mm/pti.c
arch/x86/mm/pti.c
+1
-1
arch/xtensa/kernel/vmlinux.lds.S
arch/xtensa/kernel/vmlinux.lds.S
+4
-4
include/asm-generic/vmlinux.lds.h
include/asm-generic/vmlinux.lds.h
+39
-14
未找到文件。
arch/alpha/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
/*
SPDX
-
License
-
Identifier
:
GPL
-
2
.0
*/
/*
SPDX
-
License
-
Identifier
:
GPL
-
2
.0
*/
#define EMITS_PT_NOTE
#define RO_EXCEPTION_TABLE_ALIGN 16
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm/thread_info.h>
#include <asm/thread_info.h>
#include <asm/cache.h>
#include <asm/cache.h>
...
@@ -8,7 +12,7 @@
...
@@ -8,7 +12,7 @@
OUTPUT_FORMAT
("
elf64
-
alpha
")
OUTPUT_FORMAT
("
elf64
-
alpha
")
OUTPUT_ARCH
(
alpha
)
OUTPUT_ARCH
(
alpha
)
ENTRY
(
__start
)
ENTRY
(
__start
)
PHDRS
{
kernel
PT_LOAD
; note PT_NOTE; }
PHDRS
{
text
PT_LOAD
; note PT_NOTE; }
jiffies
=
jiffies_64
;
jiffies
=
jiffies_64
;
SECTIONS
SECTIONS
{
{
...
@@ -27,17 +31,11 @@ SECTIONS
...
@@ -27,17 +31,11 @@ SECTIONS
LOCK_TEXT
LOCK_TEXT
*(.
fixup
)
*(.
fixup
)
*(.
gnu.warning
)
*(.
gnu.warning
)
}
:
kernel
}
:
text
swapper_pg_dir
=
SWAPPER_PGD
;
swapper_pg_dir
=
SWAPPER_PGD
;
_etext
=
.
; /* End of text section */
_etext
=
.
; /* End of text section */
NOTES
:
kernel
:
note
RO_DATA
(4096)
.
dummy
:
{
*(.
dummy
)
}
:
kernel
RODATA
EXCEPTION_TABLE
(16)
/
*
Will
be
freed
after
init
*/
/
*
Will
be
freed
after
init
*/
__init_begin
=
ALIGN
(
PAGE_SIZE
)
;
__init_begin
=
ALIGN
(
PAGE_SIZE
)
;
...
@@ -52,7 +50,7 @@ SECTIONS
...
@@ -52,7 +50,7 @@ SECTIONS
_sdata
=
.
; /* Start of rw data section */
_sdata
=
.
; /* Start of rw data section */
_data
=
.
;
_data
=
.
;
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
.
got
:
{
.
got
:
{
*(.
got
)
*(.
got
)
...
...
arch/arc/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -95,13 +95,13 @@ SECTIONS
...
@@ -95,13 +95,13 @@ SECTIONS
_etext
=
.
;
_etext
=
.
;
_sdata
=
.
;
_sdata
=
.
;
RO_DATA
_SECTION
(
PAGE_SIZE
)
RO_DATA
(
PAGE_SIZE
)
/
*
/
*
*
1
.
this
is
.
data
essentially
*
1
.
this
is
.
data
essentially
*
2
.
THREAD_SIZE
for
init
.
task
,
must
be
kernel
-
stk
sz
aligned
*
2
.
THREAD_SIZE
for
init
.
task
,
must
be
kernel
-
stk
sz
aligned
*/
*/
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
_edata
=
.
;
_edata
=
.
;
...
@@ -118,8 +118,6 @@ SECTIONS
...
@@ -118,8 +118,6 @@ SECTIONS
/
DISCARD
/
:
{
*(
.
eh_frame
)
}
/
DISCARD
/
:
{
*(
.
eh_frame
)
}
#endif
#endif
NOTES
.
=
ALIGN
(
PAGE_SIZE
)
;
.
=
ALIGN
(
PAGE_SIZE
)
;
_end
=
.
;
_end
=
.
;
...
...
arch/arm/kernel/vmlinux-xip.lds.S
浏览文件 @
f01ec4fc
...
@@ -70,8 +70,6 @@ SECTIONS
...
@@ -70,8 +70,6 @@ SECTIONS
ARM_UNWIND_SECTIONS
ARM_UNWIND_SECTIONS
#endif
#endif
NOTES
_etext
=
.
; /* End of text and rodata section */
_etext
=
.
; /* End of text and rodata section */
ARM_VECTORS
ARM_VECTORS
...
@@ -114,7 +112,7 @@ SECTIONS
...
@@ -114,7 +112,7 @@ SECTIONS
.
=
ALIGN
(
THREAD_SIZE
)
;
.
=
ALIGN
(
THREAD_SIZE
)
;
_sdata
=
.
;
_sdata
=
.
;
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
.
data.
ro_after_init
:
AT
(
ADDR
(
.
data
.
ro_after_init
)
-
LOAD_OFFSET
)
{
.
data.
ro_after_init
:
AT
(
ADDR
(
.
data
.
ro_after_init
)
-
LOAD_OFFSET
)
{
*(.
data..
ro_after_init
)
*(.
data..
ro_after_init
)
}
}
...
...
arch/arm/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -81,8 +81,6 @@ SECTIONS
...
@@ -81,8 +81,6 @@ SECTIONS
ARM_UNWIND_SECTIONS
ARM_UNWIND_SECTIONS
#endif
#endif
NOTES
#ifdef CONFIG_STRICT_KERNEL_RWX
#ifdef CONFIG_STRICT_KERNEL_RWX
.
=
ALIGN
(
1
<<
SECTION_SHIFT
)
;
.
=
ALIGN
(
1
<<
SECTION_SHIFT
)
;
#else
#else
...
@@ -143,7 +141,7 @@ SECTIONS
...
@@ -143,7 +141,7 @@ SECTIONS
__init_end
=
.
;
__init_end
=
.
;
_sdata
=
.
;
_sdata
=
.
;
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
_edata
=
.
;
_edata
=
.
;
BSS_SECTION
(0,
0
,
0
)
BSS_SECTION
(0,
0
,
0
)
...
...
arch/arm64/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
*
Written
by
Martin
Mares
<
mj
@
atrey
.
karlin
.
mff
.
cuni
.
cz
>
*
Written
by
Martin
Mares
<
mj
@
atrey
.
karlin
.
mff
.
cuni
.
cz
>
*/
*/
#define RO_EXCEPTION_TABLE_ALIGN 8
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm/cache.h>
#include <asm/cache.h>
#include <asm/kernel-pgtable.h>
#include <asm/kernel-pgtable.h>
...
@@ -135,11 +137,9 @@ SECTIONS
...
@@ -135,11 +137,9 @@ SECTIONS
.
=
ALIGN
(
SEGMENT_ALIGN
)
;
.
=
ALIGN
(
SEGMENT_ALIGN
)
;
_etext
=
.
; /* End of text section */
_etext
=
.
; /* End of text section */
RO_DATA
(
PAGE_SIZE
)
/*
everything
from
this
point
to
*/
/
*
everything
from
this
point
to
__init_begin
will
be
marked
RO
NX
*/
EXCEPTION_TABLE
(8)
/*
__init_begin
will
be
marked
RO
NX
*/
RO_DATA
(
PAGE_SIZE
)
NOTES
.
=
ALIGN
(
PAGE_SIZE
)
;
idmap_pg_dir
=
.
;
idmap_pg_dir
=
.
;
.
+=
IDMAP_DIR_SIZE
;
.
+=
IDMAP_DIR_SIZE
;
...
@@ -215,7 +215,7 @@ SECTIONS
...
@@ -215,7 +215,7 @@ SECTIONS
_data
=
.
;
_data
=
.
;
_sdata
=
.
;
_sdata
=
.
;
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_ALIGN
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_ALIGN
)
/
*
/
*
*
Data
written
with
the
MMU
off
but
read
with
the
MMU
on
requires
*
Data
written
with
the
MMU
off
but
read
with
the
MMU
on
requires
...
...
arch/c6x/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
*
Copyright
(
C
)
2010
,
2011
Texas
Instruments
Incorporated
*
Copyright
(
C
)
2010
,
2011
Texas
Instruments
Incorporated
*
Mark
Salter
<
msalter
@
redhat
.
com
>
*
Mark
Salter
<
msalter
@
redhat
.
com
>
*/
*/
#define RO_EXCEPTION_TABLE_ALIGN 16
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm/thread_info.h>
#include <asm/thread_info.h>
#include <asm/page.h>
#include <asm/page.h>
...
@@ -80,10 +83,7 @@ SECTIONS
...
@@ -80,10 +83,7 @@ SECTIONS
*(.
gnu.warning
)
*(.
gnu.warning
)
}
}
EXCEPTION_TABLE
(16)
RO_DATA
(
PAGE_SIZE
)
NOTES
RO_DATA_SECTION
(
PAGE_SIZE
)
.
const
:
.
const
:
{
{
*(.
const
.
const
.
*
.
gnu
.
linkonce
.
r
.
*)
*(.
const
.
const
.
*
.
gnu
.
linkonce
.
r
.
*)
...
...
arch/csky/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -49,11 +49,10 @@ SECTIONS
...
@@ -49,11 +49,10 @@ SECTIONS
_sdata
=
.
;
_sdata
=
.
;
RO_DATA
_SECTION
(
PAGE_SIZE
)
RO_DATA
(
PAGE_SIZE
)
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
_edata
=
.
;
_edata
=
.
;
NOTES
EXCEPTION_TABLE
(
L1_CACHE_BYTES
)
EXCEPTION_TABLE
(
L1_CACHE_BYTES
)
BSS_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
L1_CACHE_BYTES
)
BSS_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
L1_CACHE_BYTES
)
VBR_BASE
VBR_BASE
...
...
arch/h8300/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
/*
SPDX
-
License
-
Identifier
:
GPL
-
2
.0
*/
/*
SPDX
-
License
-
Identifier
:
GPL
-
2
.0
*/
#define RO_EXCEPTION_TABLE_ALIGN 16
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm/page.h>
#include <asm/page.h>
#include <asm/thread_info.h>
#include <asm/thread_info.h>
...
@@ -37,9 +40,7 @@ SECTIONS
...
@@ -37,9 +40,7 @@ SECTIONS
#endif
#endif
_etext
=
.
;
_etext
=
.
;
}
}
EXCEPTION_TABLE
(16)
RO_DATA
(4)
NOTES
RO_DATA_SECTION
(4)
ROMEND
=
.
;
ROMEND
=
.
;
#if defined(CONFIG_ROMKERNEL)
#if defined(CONFIG_ROMKERNEL)
.
=
RAMTOP
;
.
=
RAMTOP
;
...
@@ -48,7 +49,7 @@ SECTIONS
...
@@ -48,7 +49,7 @@ SECTIONS
#endif
#endif
_sdata
=
.
;
_sdata
=
.
;
__data_start
=
.
;
__data_start
=
.
;
RW_DATA
_SECTION
(0,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(0,
PAGE_SIZE
,
THREAD_SIZE
)
#if defined(CONFIG_ROMKERNEL)
#if defined(CONFIG_ROMKERNEL)
#undef ADDR
#undef ADDR
#endif
#endif
...
...
arch/hexagon/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -49,12 +49,11 @@ SECTIONS
...
@@ -49,12 +49,11 @@ SECTIONS
INIT_DATA_SECTION
(
PAGE_SIZE
)
INIT_DATA_SECTION
(
PAGE_SIZE
)
_sdata
=
.
;
_sdata
=
.
;
RW_DATA
_SECTION
(32,
PAGE_SIZE
,
_THREAD_SIZE
)
RW_DATA
(32,
PAGE_SIZE
,
_THREAD_SIZE
)
RO_DATA
_SECTION
(
PAGE_SIZE
)
RO_DATA
(
PAGE_SIZE
)
_edata
=
.
;
_edata
=
.
;
EXCEPTION_TABLE
(16)
EXCEPTION_TABLE
(16)
NOTES
BSS_SECTION
(
_PAGE_SIZE
,
_PAGE_SIZE
,
_PAGE_SIZE
)
BSS_SECTION
(
_PAGE_SIZE
,
_PAGE_SIZE
,
_PAGE_SIZE
)
...
...
arch/ia64/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
#include <asm/pgtable.h>
#include <asm/pgtable.h>
#include <asm/thread_info.h>
#include <asm/thread_info.h>
#define EMITS_PT_NOTE
#define RO_EXCEPTION_TABLE_ALIGN 16
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
OUTPUT_FORMAT
("
elf64
-
ia64
-
little
")
OUTPUT_FORMAT
("
elf64
-
ia64
-
little
")
...
@@ -13,7 +16,7 @@ ENTRY(phys_start)
...
@@ -13,7 +16,7 @@ ENTRY(phys_start)
jiffies
=
jiffies_64
;
jiffies
=
jiffies_64
;
PHDRS
{
PHDRS
{
code
PT_LOAD
;
text
PT_LOAD
;
percpu
PT_LOAD
;
percpu
PT_LOAD
;
data
PT_LOAD
;
data
PT_LOAD
;
note
PT_NOTE
;
note
PT_NOTE
;
...
@@ -36,7 +39,7 @@ SECTIONS {
...
@@ -36,7 +39,7 @@ SECTIONS {
phys_start
=
_start
-
LOAD_OFFSET
;
phys_start
=
_start
-
LOAD_OFFSET
;
code
:
{
code
:
{
}
:
code
}
:
text
.
=
KERNEL_START
;
.
=
KERNEL_START
;
_text
=
.
;
_text
=
.
;
...
@@ -68,11 +71,6 @@ SECTIONS {
...
@@ -68,11 +71,6 @@ SECTIONS {
/
*
/
*
*
Read
-
only
data
*
Read
-
only
data
*/
*/
NOTES
:
code
:
note
/*
put
.
notes
in
text
and
mark
in
PT_NOTE
*/
code_continues
:
{
}
:
code
/*
switch
back
to
regular
program
...
*/
EXCEPTION_TABLE
(16)
/
*
MCA
table
*/
/
*
MCA
table
*/
.
=
ALIGN
(
16
)
;
.
=
ALIGN
(
16
)
;
...
@@ -102,11 +100,11 @@ SECTIONS {
...
@@ -102,11 +100,11 @@ SECTIONS {
__start_unwind
=
.
;
__start_unwind
=
.
;
*(.
IA_64
.
unwind
*)
*(.
IA_64
.
unwind
*)
__end_unwind
=
.
;
__end_unwind
=
.
;
}
:
code
:
unwind
}
:
text
:
unwind
code_continues2
:
{
code_continues2
:
{
}
:
code
}
:
text
RO
DATA
RO
_DATA
(4096)
.
opd
:
AT
(
ADDR
(
.
opd
)
-
LOAD_OFFSET
)
{
.
opd
:
AT
(
ADDR
(
.
opd
)
-
LOAD_OFFSET
)
{
__start_opd
=
.
;
__start_opd
=
.
;
...
@@ -214,7 +212,7 @@ SECTIONS {
...
@@ -214,7 +212,7 @@ SECTIONS {
_end
=
.
;
_end
=
.
;
code
:
{
code
:
{
}
:
code
}
:
text
STABS_DEBUG
STABS_DEBUG
DWARF_DEBUG
DWARF_DEBUG
...
...
arch/m68k/kernel/vmlinux-nommu.lds
浏览文件 @
f01ec4fc
...
@@ -60,8 +60,8 @@ SECTIONS {
...
@@ -60,8 +60,8 @@ SECTIONS {
#endif
#endif
_sdata = .;
_sdata = .;
RO_DATA
_SECTION
(PAGE_SIZE)
RO_DATA(PAGE_SIZE)
RW_DATA
_SECTION
(16, PAGE_SIZE, THREAD_SIZE)
RW_DATA(16, PAGE_SIZE, THREAD_SIZE)
_edata = .;
_edata = .;
EXCEPTION_TABLE(16)
EXCEPTION_TABLE(16)
...
...
arch/m68k/kernel/vmlinux-std.lds
浏览文件 @
f01ec4fc
...
@@ -31,9 +31,9 @@ SECTIONS
...
@@ -31,9 +31,9 @@ SECTIONS
_sdata = .; /* Start of data section */
_sdata = .; /* Start of data section */
RO
DATA
RO
_DATA(4096)
RW_DATA
_SECTION
(16, PAGE_SIZE, THREAD_SIZE)
RW_DATA(16, PAGE_SIZE, THREAD_SIZE)
BSS_SECTION(0, 0, 0)
BSS_SECTION(0, 0, 0)
...
...
arch/m68k/kernel/vmlinux-sun3.lds
浏览文件 @
f01ec4fc
...
@@ -24,13 +24,13 @@ SECTIONS
...
@@ -24,13 +24,13 @@ SECTIONS
*(.fixup)
*(.fixup)
*(.gnu.warning)
*(.gnu.warning)
} :text = 0x4e75
} :text = 0x4e75
RO
DATA
RO
_DATA(4096)
_etext = .; /* End of text section */
_etext = .; /* End of text section */
EXCEPTION_TABLE(16) :data
EXCEPTION_TABLE(16) :data
_sdata = .; /* Start of rw data section */
_sdata = .; /* Start of rw data section */
RW_DATA
_SECTION
(16, PAGE_SIZE, THREAD_SIZE) :data
RW_DATA(16, PAGE_SIZE, THREAD_SIZE) :data
/* End of data goes *here* so that freeing init code works properly. */
/* End of data goes *here* so that freeing init code works properly. */
_edata = .;
_edata = .;
NOTES
NOTES
...
...
arch/microblaze/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
OUTPUT_ARCH
(
microblaze
)
OUTPUT_ARCH
(
microblaze
)
ENTRY
(
microblaze_start
)
ENTRY
(
microblaze_start
)
#define RO_EXCEPTION_TABLE_ALIGN 16
#include <asm/page.h>
#include <asm/page.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm/thread_info.h>
#include <asm/thread_info.h>
...
@@ -51,9 +53,7 @@ SECTIONS {
...
@@ -51,9 +53,7 @@ SECTIONS {
}
}
.
=
ALIGN
(
16
)
;
.
=
ALIGN
(
16
)
;
RODATA
RO_DATA
(4096)
EXCEPTION_TABLE
(16)
NOTES
/
*
/
*
*
sdata2
section
can
go
anywhere
,
but
must
be
word
aligned
*
sdata2
section
can
go
anywhere
,
but
must
be
word
aligned
...
@@ -70,7 +70,7 @@ SECTIONS {
...
@@ -70,7 +70,7 @@ SECTIONS {
}
}
_sdata
=
.
;
_sdata
=
.
;
RW_DATA
_SECTION
(32,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(32,
PAGE_SIZE
,
THREAD_SIZE
)
_edata
=
.
;
_edata
=
.
;
/
*
Under
the
microblaze
ABI
,
.
sdata
and
.
sbss
must
be
contiguous
*/
/
*
Under
the
microblaze
ABI
,
.
sdata
and
.
sbss
must
be
contiguous
*/
...
...
arch/mips/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -10,6 +10,11 @@
...
@@ -10,6 +10,11 @@
*/
*/
#define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)
#define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)
/*
Cavium
Octeon
should
not
have
a
separate
PT_NOTE
Program
Header
.
*/
#ifndef CONFIG_CAVIUM_OCTEON_SOC
#define EMITS_PT_NOTE
#endif
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
#undef mips
#undef mips
...
@@ -76,16 +81,8 @@ SECTIONS
...
@@ -76,16 +81,8 @@ SECTIONS
__stop___dbe_table
=
.
;
__stop___dbe_table
=
.
;
}
}
#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
.
dummy
:
{
*(
.
dummy
)
}
:
text
_sdata
=
.
; /* Start of data section */
_sdata
=
.
; /* Start of data section */
RO
DATA
RO
_DATA
(4096)
/
*
writeable
*/
/
*
writeable
*/
.
data
:
{
/*
Data
*/
.
data
:
{
/*
Data
*/
...
...
arch/nds32/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -53,12 +53,11 @@ SECTIONS
...
@@ -53,12 +53,11 @@ SECTIONS
_etext
=
.
; /* End of text and rodata section */
_etext
=
.
; /* End of text and rodata section */
_sdata
=
.
;
_sdata
=
.
;
RO_DATA
_SECTION
(
PAGE_SIZE
)
RO_DATA
(
PAGE_SIZE
)
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
_edata
=
.
;
_edata
=
.
;
EXCEPTION_TABLE
(16)
EXCEPTION_TABLE
(16)
NOTES
BSS_SECTION
(4,
4
,
4
)
BSS_SECTION
(4,
4
,
4
)
_end
=
.
;
_end
=
.
;
...
...
arch/nios2/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -49,8 +49,8 @@ SECTIONS
...
@@ -49,8 +49,8 @@ SECTIONS
__init_end
=
.
;
__init_end
=
.
;
_sdata
=
.
;
_sdata
=
.
;
RO_DATA
_SECTION
(
PAGE_SIZE
)
RO_DATA
(
PAGE_SIZE
)
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
_edata
=
.
;
_edata
=
.
;
BSS_SECTION
(0,
0
,
0
)
BSS_SECTION
(0,
0
,
0
)
...
@@ -58,7 +58,6 @@ SECTIONS
...
@@ -58,7 +58,6 @@ SECTIONS
STABS_DEBUG
STABS_DEBUG
DWARF_DEBUG
DWARF_DEBUG
NOTES
DISCARDS
DISCARDS
}
}
arch/openrisc/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -67,19 +67,18 @@ SECTIONS
...
@@ -67,19 +67,18 @@ SECTIONS
_sdata
=
.
;
_sdata
=
.
;
/
*
Page
alignment
required
for
RO_DATA
_SECTION
*/
/
*
Page
alignment
required
for
RO_DATA
*/
RO_DATA
_SECTION
(
PAGE_SIZE
)
RO_DATA
(
PAGE_SIZE
)
_e_kernel_ro
=
.
;
_e_kernel_ro
=
.
;
/
*
Whatever
comes
after
_e_kernel_ro
had
better
be
page
-
aligend
,
too
*/
/
*
Whatever
comes
after
_e_kernel_ro
had
better
be
page
-
aligend
,
too
*/
/
*
32
here
is
cacheline
size
...
recheck
this
*/
/
*
32
here
is
cacheline
size
...
recheck
this
*/
RW_DATA
_SECTION
(32,
PAGE_SIZE
,
PAGE_SIZE
)
RW_DATA
(32,
PAGE_SIZE
,
PAGE_SIZE
)
_edata
=
.
;
_edata
=
.
;
EXCEPTION_TABLE
(4)
EXCEPTION_TABLE
(4)
NOTES
/
*
Init
code
and
data
*/
/
*
Init
code
and
data
*/
.
=
ALIGN
(
PAGE_SIZE
)
;
.
=
ALIGN
(
PAGE_SIZE
)
;
...
...
arch/parisc/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
*(.
data..vm0.pte
)
*(.
data..vm0.pte
)
#define CC_USING_PATCHABLE_FUNCTION_ENTRY
#define CC_USING_PATCHABLE_FUNCTION_ENTRY
#define RO_EXCEPTION_TABLE_ALIGN 8
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
...
@@ -109,7 +110,7 @@ SECTIONS
...
@@ -109,7 +110,7 @@ SECTIONS
_sdata
=
.
;
_sdata
=
.
;
/
*
Architecturally
we
need
to
keep
__gp
below
0x1000000
and
thus
/
*
Architecturally
we
need
to
keep
__gp
below
0x1000000
and
thus
*
in
front
of
RO_DATA
_SECTION
()
which
stores
lots
of
tracepoint
*
in
front
of
RO_DATA
()
which
stores
lots
of
tracepoint
*
and
ftrace
symbols
.
*/
*
and
ftrace
symbols
.
*/
#ifdef CONFIG_64BIT
#ifdef CONFIG_64BIT
.
=
ALIGN
(
16
)
;
.
=
ALIGN
(
16
)
;
...
@@ -127,11 +128,7 @@ SECTIONS
...
@@ -127,11 +128,7 @@ SECTIONS
}
}
#endif
#endif
RO_DATA_SECTION
(8)
RO_DATA
(8)
/
*
RO
because
of
BUILDTIME_EXTABLE_SORT
*/
EXCEPTION_TABLE
(8)
NOTES
/
*
unwind
info
*/
/
*
unwind
info
*/
.
PARISC.unwind
:
{
.
PARISC.unwind
:
{
...
@@ -149,7 +146,7 @@ SECTIONS
...
@@ -149,7 +146,7 @@ SECTIONS
data_start
=
.
;
data_start
=
.
;
/
*
Data
*/
/
*
Data
*/
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
PAGE_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
PAGE_SIZE
)
/
*
PA
-
RISC
locks
requires
16
-
byte
alignment
*/
/
*
PA
-
RISC
locks
requires
16
-
byte
alignment
*/
.
=
ALIGN
(
16
)
;
.
=
ALIGN
(
16
)
;
...
...
arch/powerpc/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -6,6 +6,8 @@
...
@@ -6,6 +6,8 @@
#endif
#endif
#define BSS_FIRST_SECTIONS *(.bss.prominit)
#define BSS_FIRST_SECTIONS *(.bss.prominit)
#define EMITS_PT_NOTE
#define RO_EXCEPTION_TABLE_ALIGN 0
#include <asm/page.h>
#include <asm/page.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
...
@@ -18,22 +20,8 @@
...
@@ -18,22 +20,8 @@
ENTRY
(
_stext
)
ENTRY
(
_stext
)
PHDRS
{
PHDRS
{
kernel
PT_LOAD
FLAGS
(
7
)
; /* RWX */
text
PT_LOAD
FLAGS
(
7
)
; /* RWX */
notes
PT_NOTE
FLAGS
(
0
)
;
note
PT_NOTE
FLAGS
(
0
)
;
dummy
PT_NOTE
FLAGS
(
0
)
;
/
*
binutils
<
2
.18
has
a
bug
that
makes
it
misbehave
when
taking
an
ELF
file
with
all
segments
at
load
address
0
as
input
.
This
happens
when
running
"strip"
on
vmlinux
,
because
of
the
AT
()
magic
in
this
linker
script
.
People
using
GCC
>=
4
.2
won
't run into
this
problem
,
because
the
"build-id"
support
will
put
some
data
into
the
"notes"
segment
(
at
a
non
-
zero
load
address
)
.
To
work
around
this
,
we
force
some
data
into
both
the
"dummy"
segment
and
the
kernel
segment
,
so
the
dummy
segment
will
get
a
non
-
zero
load
address
.
It
's not enough to always create the
"
notes
"
segment
,
since
if
nothing
gets
assigned
to
it
,
its
load
address
will
be
zero
.
*/
}
}
#ifdef CONFIG_PPC64
#ifdef CONFIG_PPC64
...
@@ -77,7 +65,7 @@ SECTIONS
...
@@ -77,7 +65,7 @@ SECTIONS
#else /* !CONFIG_PPC64 */
#else /* !CONFIG_PPC64 */
HEAD_TEXT
HEAD_TEXT
#endif
#endif
}
:
kernel
}
:
text
__head_end
=
.
;
__head_end
=
.
;
...
@@ -126,7 +114,7 @@ SECTIONS
...
@@ -126,7 +114,7 @@ SECTIONS
__got2_end
=
.
;
__got2_end
=
.
;
#endif /* CONFIG_PPC32 */
#endif /* CONFIG_PPC32 */
}
:
kernel
}
:
text
.
=
ALIGN
(
ETEXT_ALIGN_SIZE
)
;
.
=
ALIGN
(
ETEXT_ALIGN_SIZE
)
;
_etext
=
.
;
_etext
=
.
;
...
@@ -175,17 +163,6 @@ SECTIONS
...
@@ -175,17 +163,6 @@ SECTIONS
__stop__btb_flush_fixup
=
.
;
__stop__btb_flush_fixup
=
.
;
}
}
#endif
#endif
EXCEPTION_TABLE
(0)
NOTES
:
kernel
:
notes
/
*
The
dummy
segment
contents
for
the
bug
workaround
mentioned
above
near
PHDRS
.
*/
.
dummy
:
AT
(
ADDR
(
.
dummy
)
-
LOAD_OFFSET
)
{
LONG
(0)
LONG
(0)
LONG
(0)
}
:
kernel
:
dummy
/*
/*
*
Init
sections
discarded
at
runtime
*
Init
sections
discarded
at
runtime
...
@@ -200,7 +177,7 @@ SECTIONS
...
@@ -200,7 +177,7 @@ SECTIONS
#ifdef CONFIG_PPC64
#ifdef CONFIG_PPC64
*(.
tramp.ftrace.init
)
;
*(.
tramp.ftrace.init
)
;
#endif
#endif
}
:
kernel
}
:
text
/
*
.
exit
.
text
is
discarded
at
runtime
,
not
link
time
,
/
*
.
exit
.
text
is
discarded
at
runtime
,
not
link
time
,
*
to
deal
with
references
from
__bug_table
*
to
deal
with
references
from
__bug_table
...
...
arch/riscv/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -52,12 +52,12 @@ SECTIONS
...
@@ -52,12 +52,12 @@ SECTIONS
/
*
Start
of
data
section
*/
/
*
Start
of
data
section
*/
_sdata
=
.
;
_sdata
=
.
;
RO_DATA
_SECTION
(
L1_CACHE_BYTES
)
RO_DATA
(
L1_CACHE_BYTES
)
.
srodata
:
{
.
srodata
:
{
*(.
srodata
*)
*(.
srodata
*)
}
}
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
.
sdata
:
{
.
sdata
:
{
__global_pointer
$
=
.
+
0x800
;
__global_pointer
$
=
.
+
0x800
;
*(.
sdata
*)
*(.
sdata
*)
...
@@ -69,7 +69,6 @@ SECTIONS
...
@@ -69,7 +69,6 @@ SECTIONS
BSS_SECTION
(
PAGE_SIZE
,
PAGE_SIZE
,
0
)
BSS_SECTION
(
PAGE_SIZE
,
PAGE_SIZE
,
0
)
EXCEPTION_TABLE
(0
x10
)
EXCEPTION_TABLE
(0
x10
)
NOTES
.
rel.dyn
:
{
.
rel.dyn
:
{
*(.
rel.dyn
*)
*(.
rel.dyn
*)
...
...
arch/s390/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
/*
Handle
ro_after_init
data
on
our
own
.
*/
/*
Handle
ro_after_init
data
on
our
own
.
*/
#define RO_AFTER_INIT_DATA
#define RO_AFTER_INIT_DATA
#define EMITS_PT_NOTE
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm/vmlinux.lds.h>
#include <asm/vmlinux.lds.h>
...
@@ -50,11 +52,7 @@ SECTIONS
...
@@ -50,11 +52,7 @@ SECTIONS
_etext
=
.
; /* End of text section */
_etext
=
.
; /* End of text section */
}
:
text
=
0x0700
}
:
text
=
0x0700
NOTES
:
text
:
note
RO_DATA
(
PAGE_SIZE
)
.
dummy
:
{
*(
.
dummy
)
}
:
data
RO_DATA_SECTION
(
PAGE_SIZE
)
.
=
ALIGN
(
PAGE_SIZE
)
;
.
=
ALIGN
(
PAGE_SIZE
)
;
_sdata
=
.
; /* Start of data section */
_sdata
=
.
; /* Start of data section */
...
@@ -64,12 +62,12 @@ SECTIONS
...
@@ -64,12 +62,12 @@ SECTIONS
.
data..
ro_after_init
:
{
.
data..
ro_after_init
:
{
*(.
data..
ro_after_init
)
*(.
data..
ro_after_init
)
JUMP_TABLE_DATA
JUMP_TABLE_DATA
}
}
:
data
EXCEPTION_TABLE
(16)
EXCEPTION_TABLE
(16)
.
=
ALIGN
(
PAGE_SIZE
)
;
.
=
ALIGN
(
PAGE_SIZE
)
;
__end_ro_after_init
=
.
;
__end_ro_after_init
=
.
;
RW_DATA
_SECTION
(0
x100
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(0
x100
,
PAGE_SIZE
,
THREAD_SIZE
)
BOOT_DATA_PRESERVED
BOOT_DATA_PRESERVED
_edata
=
.
; /* End of data section */
_edata
=
.
; /* End of data section */
...
...
arch/sh/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -48,11 +48,10 @@ SECTIONS
...
@@ -48,11 +48,10 @@ SECTIONS
}
=
0x0009
}
=
0x0009
EXCEPTION_TABLE
(16)
EXCEPTION_TABLE
(16)
NOTES
_sdata
=
.
;
_sdata
=
.
;
RO_DATA
(
PAGE_SIZE
)
RO_DATA
(
PAGE_SIZE
)
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
_edata
=
.
;
_edata
=
.
;
DWARF_EH_FRAME
DWARF_EH_FRAME
...
...
arch/sparc/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -67,7 +67,7 @@ SECTIONS
...
@@ -67,7 +67,7 @@ SECTIONS
.
data1
:
{
.
data1
:
{
*(.
data1
)
*(.
data1
)
}
}
RW_DATA
_SECTION
(
SMP_CACHE_BYTES
,
0
,
THREAD_SIZE
)
RW_DATA
(
SMP_CACHE_BYTES
,
0
,
THREAD_SIZE
)
/
*
End
of
data
section
*/
/
*
End
of
data
section
*/
_edata
=
.
;
_edata
=
.
;
...
@@ -78,7 +78,6 @@ SECTIONS
...
@@ -78,7 +78,6 @@ SECTIONS
__stop___fixup
=
.
;
__stop___fixup
=
.
;
}
}
EXCEPTION_TABLE
(16)
EXCEPTION_TABLE
(16)
NOTES
.
=
ALIGN
(
PAGE_SIZE
)
;
.
=
ALIGN
(
PAGE_SIZE
)
;
__init_begin
=
ALIGN
(
PAGE_SIZE
)
;
__init_begin
=
ALIGN
(
PAGE_SIZE
)
;
...
...
arch/um/include/asm/common.lds.S
浏览文件 @
f01ec4fc
...
@@ -9,14 +9,13 @@
...
@@ -9,14 +9,13 @@
_sdata
=
.
;
_sdata
=
.
;
PROVIDE
(
sdata
=
.
)
;
PROVIDE
(
sdata
=
.
)
;
RO
DATA
RO
_DATA
(4096)
.
unprotected
:
{
*(
.
unprotected
)
}
.
unprotected
:
{
*(
.
unprotected
)
}
.
=
ALIGN
(
4096
)
;
.
=
ALIGN
(
4096
)
;
PROVIDE
(
_unprotected_end
=
.
)
;
PROVIDE
(
_unprotected_end
=
.
)
;
.
=
ALIGN
(
4096
)
;
.
=
ALIGN
(
4096
)
;
NOTES
EXCEPTION_TABLE
(0)
EXCEPTION_TABLE
(0)
BUG_TABLE
BUG_TABLE
...
...
arch/unicore32/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -43,12 +43,11 @@ SECTIONS
...
@@ -43,12 +43,11 @@ SECTIONS
_etext
=
.
;
_etext
=
.
;
_sdata
=
.
;
_sdata
=
.
;
RO_DATA
_SECTION
(
PAGE_SIZE
)
RO_DATA
(
PAGE_SIZE
)
RW_DATA
_SECTION
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
L1_CACHE_BYTES
,
PAGE_SIZE
,
THREAD_SIZE
)
_edata
=
.
;
_edata
=
.
;
EXCEPTION_TABLE
(
L1_CACHE_BYTES
)
EXCEPTION_TABLE
(
L1_CACHE_BYTES
)
NOTES
BSS_SECTION
(0,
0
,
0
)
BSS_SECTION
(0,
0
,
0
)
_end
=
.
;
_end
=
.
;
...
...
arch/x86/boot/Makefile
浏览文件 @
f01ec4fc
...
@@ -67,6 +67,7 @@ clean-files += cpustr.h
...
@@ -67,6 +67,7 @@ clean-files += cpustr.h
KBUILD_CFLAGS
:=
$(REALMODE_CFLAGS)
-D_SETUP
KBUILD_CFLAGS
:=
$(REALMODE_CFLAGS)
-D_SETUP
KBUILD_AFLAGS
:=
$(KBUILD_CFLAGS)
-D__ASSEMBLY__
KBUILD_AFLAGS
:=
$(KBUILD_CFLAGS)
-D__ASSEMBLY__
KBUILD_CFLAGS
+=
$(
call
cc-option,-fmacro-prefix-map
=
$(srctree)
/
=
)
GCOV_PROFILE
:=
n
GCOV_PROFILE
:=
n
UBSAN_SANITIZE
:=
n
UBSAN_SANITIZE
:=
n
...
...
arch/x86/boot/compressed/Makefile
浏览文件 @
f01ec4fc
...
@@ -38,6 +38,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
...
@@ -38,6 +38,7 @@ KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
KBUILD_CFLAGS
+=
$(
call
cc-disable-warning, address-of-packed-member
)
KBUILD_CFLAGS
+=
$(
call
cc-disable-warning, address-of-packed-member
)
KBUILD_CFLAGS
+=
$(
call
cc-disable-warning, gnu
)
KBUILD_CFLAGS
+=
$(
call
cc-disable-warning, gnu
)
KBUILD_CFLAGS
+=
-Wno-pointer-sign
KBUILD_CFLAGS
+=
-Wno-pointer-sign
KBUILD_CFLAGS
+=
$(
call
cc-option,-fmacro-prefix-map
=
$(srctree)
/
=
)
KBUILD_AFLAGS
:=
$(KBUILD_CFLAGS)
-D__ASSEMBLY__
KBUILD_AFLAGS
:=
$(KBUILD_CFLAGS)
-D__ASSEMBLY__
GCOV_PROFILE
:=
n
GCOV_PROFILE
:=
n
...
...
arch/x86/entry/vdso/Makefile
浏览文件 @
f01ec4fc
...
@@ -87,11 +87,9 @@ $(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS
...
@@ -87,11 +87,9 @@ $(vobjs): KBUILD_CFLAGS := $(filter-out $(GCC_PLUGINS_CFLAGS) $(RETPOLINE_CFLAGS
#
#
# vDSO code runs in userspace and -pg doesn't help with profiling anyway.
# vDSO code runs in userspace and -pg doesn't help with profiling anyway.
#
#
CFLAGS_REMOVE_vdso-note.o
=
-pg
CFLAGS_REMOVE_vclock_gettime.o
=
-pg
CFLAGS_REMOVE_vclock_gettime.o
=
-pg
CFLAGS_REMOVE_vdso32/
vclock_gettime.o
=
-pg
CFLAGS_REMOVE_vdso32/
vclock_gettime.o
=
-pg
CFLAGS_REMOVE_vgetcpu.o
=
-pg
CFLAGS_REMOVE_vgetcpu.o
=
-pg
CFLAGS_REMOVE_vvar.o
=
-pg
#
#
# X32 processes use x32 vDSO to access 64bit kernel data.
# X32 processes use x32 vDSO to access 64bit kernel data.
...
...
arch/x86/include/asm/processor.h
浏览文件 @
f01ec4fc
...
@@ -958,7 +958,7 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
...
@@ -958,7 +958,7 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
extern
unsigned
long
arch_align_stack
(
unsigned
long
sp
);
extern
unsigned
long
arch_align_stack
(
unsigned
long
sp
);
void
free_init_pages
(
const
char
*
what
,
unsigned
long
begin
,
unsigned
long
end
);
void
free_init_pages
(
const
char
*
what
,
unsigned
long
begin
,
unsigned
long
end
);
extern
void
free_kernel_image_pages
(
void
*
begin
,
void
*
end
);
extern
void
free_kernel_image_pages
(
const
char
*
what
,
void
*
begin
,
void
*
end
);
void
default_idle
(
void
);
void
default_idle
(
void
);
#ifdef CONFIG_XEN
#ifdef CONFIG_XEN
...
...
arch/x86/include/asm/sections.h
浏览文件 @
f01ec4fc
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
#include <asm/extable.h>
#include <asm/extable.h>
extern
char
__brk_base
[],
__brk_limit
[];
extern
char
__brk_base
[],
__brk_limit
[];
extern
struct
exception_table_entry
__stop___ex_table
[];
extern
char
__end_rodata_aligned
[];
extern
char
__end_rodata_aligned
[];
#if defined(CONFIG_X86_64)
#if defined(CONFIG_X86_64)
...
...
arch/x86/kernel/setup.c
浏览文件 @
f01ec4fc
...
@@ -143,6 +143,13 @@ struct boot_params boot_params;
...
@@ -143,6 +143,13 @@ struct boot_params boot_params;
/*
/*
* Machine setup..
* Machine setup..
*/
*/
static
struct
resource
rodata_resource
=
{
.
name
=
"Kernel rodata"
,
.
start
=
0
,
.
end
=
0
,
.
flags
=
IORESOURCE_BUSY
|
IORESOURCE_SYSTEM_RAM
};
static
struct
resource
data_resource
=
{
static
struct
resource
data_resource
=
{
.
name
=
"Kernel data"
,
.
name
=
"Kernel data"
,
.
start
=
0
,
.
start
=
0
,
...
@@ -951,7 +958,9 @@ void __init setup_arch(char **cmdline_p)
...
@@ -951,7 +958,9 @@ void __init setup_arch(char **cmdline_p)
code_resource
.
start
=
__pa_symbol
(
_text
);
code_resource
.
start
=
__pa_symbol
(
_text
);
code_resource
.
end
=
__pa_symbol
(
_etext
)
-
1
;
code_resource
.
end
=
__pa_symbol
(
_etext
)
-
1
;
data_resource
.
start
=
__pa_symbol
(
_etext
);
rodata_resource
.
start
=
__pa_symbol
(
__start_rodata
);
rodata_resource
.
end
=
__pa_symbol
(
__end_rodata
)
-
1
;
data_resource
.
start
=
__pa_symbol
(
_sdata
);
data_resource
.
end
=
__pa_symbol
(
_edata
)
-
1
;
data_resource
.
end
=
__pa_symbol
(
_edata
)
-
1
;
bss_resource
.
start
=
__pa_symbol
(
__bss_start
);
bss_resource
.
start
=
__pa_symbol
(
__bss_start
);
bss_resource
.
end
=
__pa_symbol
(
__bss_stop
)
-
1
;
bss_resource
.
end
=
__pa_symbol
(
__bss_stop
)
-
1
;
...
@@ -1040,6 +1049,7 @@ void __init setup_arch(char **cmdline_p)
...
@@ -1040,6 +1049,7 @@ void __init setup_arch(char **cmdline_p)
/* after parse_early_param, so could debug it */
/* after parse_early_param, so could debug it */
insert_resource
(
&
iomem_resource
,
&
code_resource
);
insert_resource
(
&
iomem_resource
,
&
code_resource
);
insert_resource
(
&
iomem_resource
,
&
rodata_resource
);
insert_resource
(
&
iomem_resource
,
&
data_resource
);
insert_resource
(
&
iomem_resource
,
&
data_resource
);
insert_resource
(
&
iomem_resource
,
&
bss_resource
);
insert_resource
(
&
iomem_resource
,
&
bss_resource
);
...
...
arch/x86/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -21,6 +21,9 @@
...
@@ -21,6 +21,9 @@
#define LOAD_OFFSET __START_KERNEL_map
#define LOAD_OFFSET __START_KERNEL_map
#endif
#endif
#define EMITS_PT_NOTE
#define RO_EXCEPTION_TABLE_ALIGN 16
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm/asm-offsets.h>
#include <asm/asm-offsets.h>
#include <asm/thread_info.h>
#include <asm/thread_info.h>
...
@@ -141,17 +144,12 @@ SECTIONS
...
@@ -141,17 +144,12 @@ SECTIONS
*(.
text.
__x86
.
indirect_thunk
)
*(.
text.
__x86
.
indirect_thunk
)
__indirect_thunk_end
=
.
;
__indirect_thunk_end
=
.
;
#endif
#endif
}
:
text
=
0xcccc
/
*
End
of
text
section
*/
/
*
End
of
text
section
,
which
should
occupy
whole
number
of
pages
*/
_etext
=
.
;
_etext
=
.
;
}
:
text
=
0x9090
NOTES
:
text
:
note
EXCEPTION_TABLE
(16)
:
text
=
0x9090
/
*
.
text
should
occupy
whole
number
of
pages
*/
.
=
ALIGN
(
PAGE_SIZE
)
;
.
=
ALIGN
(
PAGE_SIZE
)
;
X86_ALIGN_RODATA_BEGIN
X86_ALIGN_RODATA_BEGIN
RO_DATA
(
PAGE_SIZE
)
RO_DATA
(
PAGE_SIZE
)
X86_ALIGN_RODATA_END
X86_ALIGN_RODATA_END
...
...
arch/x86/mm/init.c
浏览文件 @
f01ec4fc
...
@@ -829,14 +829,13 @@ void free_init_pages(const char *what, unsigned long begin, unsigned long end)
...
@@ -829,14 +829,13 @@ void free_init_pages(const char *what, unsigned long begin, unsigned long end)
* used for the kernel image only. free_init_pages() will do the
* used for the kernel image only. free_init_pages() will do the
* right thing for either kind of address.
* right thing for either kind of address.
*/
*/
void
free_kernel_image_pages
(
void
*
begin
,
void
*
end
)
void
free_kernel_image_pages
(
const
char
*
what
,
void
*
begin
,
void
*
end
)
{
{
unsigned
long
begin_ul
=
(
unsigned
long
)
begin
;
unsigned
long
begin_ul
=
(
unsigned
long
)
begin
;
unsigned
long
end_ul
=
(
unsigned
long
)
end
;
unsigned
long
end_ul
=
(
unsigned
long
)
end
;
unsigned
long
len_pages
=
(
end_ul
-
begin_ul
)
>>
PAGE_SHIFT
;
unsigned
long
len_pages
=
(
end_ul
-
begin_ul
)
>>
PAGE_SHIFT
;
free_init_pages
(
what
,
begin_ul
,
end_ul
);
free_init_pages
(
"unused kernel image"
,
begin_ul
,
end_ul
);
/*
/*
* PTI maps some of the kernel into userspace. For performance,
* PTI maps some of the kernel into userspace. For performance,
...
@@ -865,7 +864,8 @@ void __ref free_initmem(void)
...
@@ -865,7 +864,8 @@ void __ref free_initmem(void)
mem_encrypt_free_decrypted_mem
();
mem_encrypt_free_decrypted_mem
();
free_kernel_image_pages
(
&
__init_begin
,
&
__init_end
);
free_kernel_image_pages
(
"unused kernel image (initmem)"
,
&
__init_begin
,
&
__init_end
);
}
}
#ifdef CONFIG_BLK_DEV_INITRD
#ifdef CONFIG_BLK_DEV_INITRD
...
...
arch/x86/mm/init_64.c
浏览文件 @
f01ec4fc
...
@@ -1263,7 +1263,7 @@ int kernel_set_to_readonly;
...
@@ -1263,7 +1263,7 @@ int kernel_set_to_readonly;
void
set_kernel_text_rw
(
void
)
void
set_kernel_text_rw
(
void
)
{
{
unsigned
long
start
=
PFN_ALIGN
(
_text
);
unsigned
long
start
=
PFN_ALIGN
(
_text
);
unsigned
long
end
=
PFN_ALIGN
(
_
_stop___ex_table
);
unsigned
long
end
=
PFN_ALIGN
(
_
etext
);
if
(
!
kernel_set_to_readonly
)
if
(
!
kernel_set_to_readonly
)
return
;
return
;
...
@@ -1282,7 +1282,7 @@ void set_kernel_text_rw(void)
...
@@ -1282,7 +1282,7 @@ void set_kernel_text_rw(void)
void
set_kernel_text_ro
(
void
)
void
set_kernel_text_ro
(
void
)
{
{
unsigned
long
start
=
PFN_ALIGN
(
_text
);
unsigned
long
start
=
PFN_ALIGN
(
_text
);
unsigned
long
end
=
PFN_ALIGN
(
_
_stop___ex_table
);
unsigned
long
end
=
PFN_ALIGN
(
_
etext
);
if
(
!
kernel_set_to_readonly
)
if
(
!
kernel_set_to_readonly
)
return
;
return
;
...
@@ -1300,9 +1300,9 @@ void mark_rodata_ro(void)
...
@@ -1300,9 +1300,9 @@ void mark_rodata_ro(void)
{
{
unsigned
long
start
=
PFN_ALIGN
(
_text
);
unsigned
long
start
=
PFN_ALIGN
(
_text
);
unsigned
long
rodata_start
=
PFN_ALIGN
(
__start_rodata
);
unsigned
long
rodata_start
=
PFN_ALIGN
(
__start_rodata
);
unsigned
long
end
=
(
unsigned
long
)
&
__end_rodata_hpage_align
;
unsigned
long
end
=
(
unsigned
long
)
__end_rodata_hpage_align
;
unsigned
long
text_end
=
PFN_ALIGN
(
&
__stop___ex_table
);
unsigned
long
text_end
=
PFN_ALIGN
(
_etext
);
unsigned
long
rodata_end
=
PFN_ALIGN
(
&
__end_rodata
);
unsigned
long
rodata_end
=
PFN_ALIGN
(
__end_rodata
);
unsigned
long
all_end
;
unsigned
long
all_end
;
printk
(
KERN_INFO
"Write protecting the kernel read-only data: %luk
\n
"
,
printk
(
KERN_INFO
"Write protecting the kernel read-only data: %luk
\n
"
,
...
@@ -1334,8 +1334,10 @@ void mark_rodata_ro(void)
...
@@ -1334,8 +1334,10 @@ void mark_rodata_ro(void)
set_memory_ro
(
start
,
(
end
-
start
)
>>
PAGE_SHIFT
);
set_memory_ro
(
start
,
(
end
-
start
)
>>
PAGE_SHIFT
);
#endif
#endif
free_kernel_image_pages
((
void
*
)
text_end
,
(
void
*
)
rodata_start
);
free_kernel_image_pages
(
"unused kernel image (text/rodata gap)"
,
free_kernel_image_pages
((
void
*
)
rodata_end
,
(
void
*
)
_sdata
);
(
void
*
)
text_end
,
(
void
*
)
rodata_start
);
free_kernel_image_pages
(
"unused kernel image (rodata/data gap)"
,
(
void
*
)
rodata_end
,
(
void
*
)
_sdata
);
debug_checkwx
();
debug_checkwx
();
}
}
...
...
arch/x86/mm/pti.c
浏览文件 @
f01ec4fc
...
@@ -574,7 +574,7 @@ static void pti_clone_kernel_text(void)
...
@@ -574,7 +574,7 @@ static void pti_clone_kernel_text(void)
*/
*/
unsigned
long
start
=
PFN_ALIGN
(
_text
);
unsigned
long
start
=
PFN_ALIGN
(
_text
);
unsigned
long
end_clone
=
(
unsigned
long
)
__end_rodata_aligned
;
unsigned
long
end_clone
=
(
unsigned
long
)
__end_rodata_aligned
;
unsigned
long
end_global
=
PFN_ALIGN
((
unsigned
long
)
_
_stop___ex_table
);
unsigned
long
end_global
=
PFN_ALIGN
((
unsigned
long
)
_
etext
);
if
(
!
pti_kernel_image_global_ok
())
if
(
!
pti_kernel_image_global_ok
())
return
;
return
;
...
...
arch/xtensa/kernel/vmlinux.lds.S
浏览文件 @
f01ec4fc
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
*
Joe
Taylor
<
joe
@
tensilica
.
com
,
joetylr
@
yahoo
.
com
>
*
Joe
Taylor
<
joe
@
tensilica
.
com
,
joetylr
@
yahoo
.
com
>
*/
*/
#define RO_EXCEPTION_TABLE_ALIGN 16
#include <asm-generic/vmlinux.lds.h>
#include <asm-generic/vmlinux.lds.h>
#include <asm/page.h>
#include <asm/page.h>
#include <asm/thread_info.h>
#include <asm/thread_info.h>
...
@@ -124,18 +126,16 @@ SECTIONS
...
@@ -124,18 +126,16 @@ SECTIONS
.
=
ALIGN
(
16
)
;
.
=
ALIGN
(
16
)
;
RO
DATA
RO
_DATA
(4096)
/
*
Relocation
table
*/
/
*
Relocation
table
*/
.
fixup
:
{
*(
.
fixup
)
}
.
fixup
:
{
*(
.
fixup
)
}
EXCEPTION_TABLE
(16)
NOTES
/
*
Data
section
*/
/
*
Data
section
*/
_sdata
=
.
;
_sdata
=
.
;
RW_DATA
_SECTION
(
XCHAL_ICACHE_LINESIZE
,
PAGE_SIZE
,
THREAD_SIZE
)
RW_DATA
(
XCHAL_ICACHE_LINESIZE
,
PAGE_SIZE
,
THREAD_SIZE
)
_edata
=
.
;
_edata
=
.
;
/
*
Initialization
code
and
data
:
*/
/
*
Initialization
code
and
data
:
*/
...
...
include/asm-generic/vmlinux.lds.h
浏览文件 @
f01ec4fc
...
@@ -23,12 +23,11 @@
...
@@ -23,12 +23,11 @@
* _etext = .;
* _etext = .;
*
*
* _sdata = .;
* _sdata = .;
* RO_DATA
_SECTION
(PAGE_SIZE)
* RO_DATA(PAGE_SIZE)
* RW_DATA
_SECTION
(...)
* RW_DATA(...)
* _edata = .;
* _edata = .;
*
*
* EXCEPTION_TABLE(...)
* EXCEPTION_TABLE(...)
* NOTES
*
*
* BSS_SECTION(0, 0, 0)
* BSS_SECTION(0, 0, 0)
* _end = .;
* _end = .;
...
@@ -54,6 +53,33 @@
...
@@ -54,6 +53,33 @@
#define LOAD_OFFSET 0
#define LOAD_OFFSET 0
#endif
#endif
/*
* Only some architectures want to have the .notes segment visible in
* a separate PT_NOTE ELF Program Header. When this happens, it needs
* to be visible in both the kernel text's PT_LOAD and the PT_NOTE
* Program Headers. In this case, though, the PT_LOAD needs to be made
* the default again so that all the following sections don't also end
* up in the PT_NOTE Program Header.
*/
#ifdef EMITS_PT_NOTE
#define NOTES_HEADERS :text :note
#define NOTES_HEADERS_RESTORE __restore_ph : { *(.__restore_ph) } :text
#else
#define NOTES_HEADERS
#define NOTES_HEADERS_RESTORE
#endif
/*
* Some architectures have non-executable read-only exception tables.
* They can be added to the RO_DATA segment by specifying their desired
* alignment.
*/
#ifdef RO_EXCEPTION_TABLE_ALIGN
#define RO_EXCEPTION_TABLE EXCEPTION_TABLE(RO_EXCEPTION_TABLE_ALIGN)
#else
#define RO_EXCEPTION_TABLE
#endif
/* Align . to a 8 byte boundary equals to maximum function alignment. */
/* Align . to a 8 byte boundary equals to maximum function alignment. */
#define ALIGN_FUNCTION() . = ALIGN(8)
#define ALIGN_FUNCTION() . = ALIGN(8)
...
@@ -348,7 +374,7 @@
...
@@ -348,7 +374,7 @@
/*
/*
* Read only Data
* Read only Data
*/
*/
#define RO_DATA
_SECTION(align)
\
#define RO_DATA
(align)
\
. = ALIGN((align)); \
. = ALIGN((align)); \
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
__start_rodata = .; \
__start_rodata = .; \
...
@@ -496,15 +522,13 @@
...
@@ -496,15 +522,13 @@
__start___modver = .; \
__start___modver = .; \
KEEP(*(__modver)) \
KEEP(*(__modver)) \
__stop___modver = .; \
__stop___modver = .; \
. = ALIGN((align)); \
__end_rodata = .; \
} \
} \
. = ALIGN((align));
\
RO_EXCEPTION_TABLE \
/* RODATA & RO_DATA provided for backward compatibility.
NOTES \
* All archs are supposed to use RO_DATA() */
\
#define RODATA RO_DATA_SECTION(4096)
. = ALIGN((align)); \
#define RO_DATA(align) RO_DATA_SECTION(align)
__end_rodata = .;
/*
/*
* .text section. Map to function alignment to avoid address changes
* .text section. Map to function alignment to avoid address changes
...
@@ -790,7 +814,8 @@
...
@@ -790,7 +814,8 @@
__start_notes = .; \
__start_notes = .; \
KEEP(*(.note.*)) \
KEEP(*(.note.*)) \
__stop_notes = .; \
__stop_notes = .; \
}
} NOTES_HEADERS \
NOTES_HEADERS_RESTORE
#define INIT_SETUP(initsetup_align) \
#define INIT_SETUP(initsetup_align) \
. = ALIGN(initsetup_align); \
. = ALIGN(initsetup_align); \
...
@@ -962,7 +987,7 @@
...
@@ -962,7 +987,7 @@
* matches the requirement of PAGE_ALIGNED_DATA.
* matches the requirement of PAGE_ALIGNED_DATA.
*
*
* use 0 as page_align if page_aligned data is not used */
* use 0 as page_align if page_aligned data is not used */
#define RW_DATA
_SECTION(cacheline, pagealigned, inittask)
\
#define RW_DATA
(cacheline, pagealigned, inittask)
\
. = ALIGN(PAGE_SIZE); \
. = ALIGN(PAGE_SIZE); \
.data : AT(ADDR(.data) - LOAD_OFFSET) { \
.data : AT(ADDR(.data) - LOAD_OFFSET) { \
INIT_TASK_DATA(inittask) \
INIT_TASK_DATA(inittask) \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录