mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04: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 <[email protected]> Acked-by: Paul Mundt <[email protected]> Acked-by: Mike Frysinger <[email protected]> Tested-by: Michal Simek <[email protected]> Cc: [email protected] Cc: Michal Simek <[email protected]> Cc: [email protected] Cc: Sam Ravnborg <[email protected]> Cc: Tony Luck <[email protected]>
This commit is contained in:
parent
1dcdd0911b
commit
023bf6f1b8
25 changed files with 80 additions and 155 deletions
|
|
@ -134,14 +134,6 @@ SECTIONS
|
|||
__bss_stop = .;
|
||||
_end = .;
|
||||
|
||||
/* Sections to be discarded */
|
||||
/DISCARD/ : {
|
||||
EXIT_TEXT
|
||||
EXIT_DATA
|
||||
*(.exitcall.exit)
|
||||
*(.discard)
|
||||
}
|
||||
|
||||
.mdebug 0 : {
|
||||
*(.mdebug)
|
||||
}
|
||||
|
|
@ -151,4 +143,6 @@ SECTIONS
|
|||
|
||||
STABS_DEBUG
|
||||
DWARF_DEBUG
|
||||
|
||||
DISCARDS
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue