GENERATE_SHLIB_SCRIPT vs. EMBEDDED.
A target that sets EMBEDDED non-empty is one that doesn't want to put the ELF file header or program header in a memory image. Likely the target isn't interested in supporting dynamically loaded executables, shared libraries, or PIEs, because loaders for such binaries generally require program headers to be present. This isn't 100% true though. The target might be one where the loader accesses the file system in order to retrieve headers. Also, note that not all "shared libraries" require gcc -shared or the shared library support in the linker. I believe one implementation of shared libraries on uclinux is like this. So, this patch removes GENERATE_SHLIB_SCRIPT and GENERATE_PIE_SCRIPT in most emulparams files where EMBEDDED is set, restoring the shared lib and pie support in emulparams files that unset EMBEDDED after including a file where the support is removed. Exceptions to the general rule that EMBEDDED disables shared libs are: arm*-*-symbianelf*, where the OS wants shared library support without ELF program headers in the image, and sh*-*-uclinux*, where I've left things as they were, ie. both EMBEDDED and GENERATE_SHLIB_SCRIPT because I'm unsure as to the shared library scheme. * emulparams/aarch64elf.sh (GENERATE_SHLIB_SCRIPT), (GENERATE_PIE_SCRIPT): Don't set. * emulparams/aarch64elf32.sh (GENERATE_SHLIB_SCRIPT), (GENERATE_PIE_SCRIPT): Don't set. * emulparams/arcelf.sh (GENERATE_SHLIB_SCRIPT): Don't set. * emulparams/armelf.sh (GENERATE_SHLIB_SCRIPT), (GENERATE_PIE_SCRIPT): Don't set. * emulparams/armelf_fbsd.sh (GENERATE_SHLIB_SCRIPT): Set. * emulparams/armelf_nbsd.sh (GENERATE_SHLIB_SCRIPT), (GENERATE_PIE_SCRIPT): Set. * emulparams/armelf_vxworks.sh (GENERATE_SHLIB_SCRIPT): Set. * emulparams/armsymbian.sh (GENERATE_SHLIB_SCRIPT): Set. * emulparams/elf32bfin.sh (GENERATE_SHLIB_SCRIPT): Don't set. * emulparams/elf32microblaze.sh (GENERATE_SHLIB_SCRIPT): Don't set. * emulparams/score3_elf.sh (GENERATE_SHLIB_SCRIPT): Don't set. * emulparams/shelf.sh (GENERATE_SHLIB_SCRIPT): Don't set. * emulparams/shelf_nbsd.sh (GENERATE_SHLIB_SCRIPT), (GENERATE_PIE_SCRIPT): Set. * emulparams/shelf_uclinux.sh (GENERATE_SHLIB_SCRIPT): Set.
This commit is contained in:
parent
cbb54a288a
commit
f2aaebdb97
22
ld/ChangeLog
22
ld/ChangeLog
@ -1,3 +1,25 @@
|
||||
2019-11-05 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* emulparams/aarch64elf.sh (GENERATE_SHLIB_SCRIPT),
|
||||
(GENERATE_PIE_SCRIPT): Don't set.
|
||||
* emulparams/aarch64elf32.sh (GENERATE_SHLIB_SCRIPT),
|
||||
(GENERATE_PIE_SCRIPT): Don't set.
|
||||
* emulparams/arcelf.sh (GENERATE_SHLIB_SCRIPT): Don't set.
|
||||
* emulparams/armelf.sh (GENERATE_SHLIB_SCRIPT),
|
||||
(GENERATE_PIE_SCRIPT): Don't set.
|
||||
* emulparams/armelf_fbsd.sh (GENERATE_SHLIB_SCRIPT): Set.
|
||||
* emulparams/armelf_nbsd.sh (GENERATE_SHLIB_SCRIPT),
|
||||
(GENERATE_PIE_SCRIPT): Set.
|
||||
* emulparams/armelf_vxworks.sh (GENERATE_SHLIB_SCRIPT): Set.
|
||||
* emulparams/armsymbian.sh (GENERATE_SHLIB_SCRIPT): Set.
|
||||
* emulparams/elf32bfin.sh (GENERATE_SHLIB_SCRIPT): Don't set.
|
||||
* emulparams/elf32microblaze.sh (GENERATE_SHLIB_SCRIPT): Don't set.
|
||||
* emulparams/score3_elf.sh (GENERATE_SHLIB_SCRIPT): Don't set.
|
||||
* emulparams/shelf.sh (GENERATE_SHLIB_SCRIPT): Don't set.
|
||||
* emulparams/shelf_nbsd.sh (GENERATE_SHLIB_SCRIPT),
|
||||
(GENERATE_PIE_SCRIPT): Set.
|
||||
* emulparams/shelf_uclinux.sh (GENERATE_SHLIB_SCRIPT): Set.
|
||||
|
||||
2019-11-05 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* emulparams/elf32bfinfd.sh: Unset EMBEDDED rather assigning as empty.
|
||||
|
@ -12,9 +12,6 @@ NO_REL_RELOCS=yes
|
||||
TEMPLATE_NAME=elf
|
||||
EXTRA_EM_FILE=aarch64elf
|
||||
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
GENERATE_PIE_SCRIPT=yes
|
||||
|
||||
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
|
||||
|
||||
ENTRY=_start
|
||||
|
@ -12,9 +12,6 @@ NO_REL_RELOCS=yes
|
||||
TEMPLATE_NAME=elf
|
||||
EXTRA_EM_FILE=aarch64elf
|
||||
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
GENERATE_PIE_SCRIPT=yes
|
||||
|
||||
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
|
||||
|
||||
ENTRY=_start
|
||||
|
@ -19,5 +19,3 @@ SDATA_START_SYMBOLS='__SDATA_BEGIN__ = . + 0x100;'
|
||||
JLI_START_TABLE='__JLI_TABLE__ = .;'
|
||||
OTHER_SECTIONS="/DISCARD/ : { *(.__arc_profile_*) }"
|
||||
EMBEDDED=yes
|
||||
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
|
@ -32,9 +32,6 @@ OTHER_READONLY_SECTIONS="
|
||||
|
||||
DATA_START_SYMBOLS="${CREATE_SHLIB+PROVIDE (}__data_start = .${CREATE_SHLIB+)};"
|
||||
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
GENERATE_PIE_SCRIPT=yes
|
||||
|
||||
ARCH=arm
|
||||
MACHINE=
|
||||
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
|
||||
|
@ -5,7 +5,7 @@ TEXT_START_ADDR=0x00010000
|
||||
|
||||
TARGET2_TYPE=got-rel
|
||||
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
GENERATE_PIE_SCRIPT=yes
|
||||
|
||||
unset STACK_ADDR
|
||||
unset EMBEDDED
|
||||
|
@ -3,5 +3,7 @@ MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
|
||||
TEXT_START_ADDR=0x00008000
|
||||
TARGET2_TYPE=got-rel
|
||||
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
GENERATE_PIE_SCRIPT=yes
|
||||
unset STACK_ADDR
|
||||
unset EMBEDDED
|
||||
|
@ -4,3 +4,4 @@ BIG_OUTPUT_FORMAT="elf32-bigarm-vxworks"
|
||||
LITTLE_OUTPUT_FORMAT="$OUTPUT_FORMAT"
|
||||
MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
|
||||
source_sh ${srcdir}/emulparams/vxworks.sh
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
|
@ -8,6 +8,8 @@ TARGET1_IS_REL=1
|
||||
TARGET2_TYPE=abs
|
||||
# On BPABI systems, program headers should not be mapped.
|
||||
EMBEDDED=yes
|
||||
# Nonetheless, shared libraries are also supported
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
|
||||
# As for armelf.sh, but add the SymbianOS-specific
|
||||
# .ARM.exidx$${Base,Limit} symbols.
|
||||
|
@ -6,7 +6,6 @@ TARGET_PAGE_SIZE=0x1000
|
||||
ARCH=bfin
|
||||
MACHINE=
|
||||
TEMPLATE_NAME=elf
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
EMBEDDED=yes
|
||||
USER_LABEL_PREFIX=_
|
||||
EXTRA_EM_FILE=bfin
|
||||
|
@ -21,6 +21,3 @@ NOP=0x80000000
|
||||
#OTHER_RELOCATING_SECTIONS='PROVIDE (_stack = _end + 0x1000);'
|
||||
|
||||
TEMPLATE_NAME=elf
|
||||
#GENERATE_SHLIB_SCRIPT=yes
|
||||
|
||||
|
||||
|
@ -26,4 +26,3 @@ ARCH=score3
|
||||
MACHINE=
|
||||
ENTRY=_start
|
||||
EMBEDDED=yes
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
|
@ -9,7 +9,6 @@ MAXPAGESIZE=128
|
||||
ARCH=sh
|
||||
MACHINE=
|
||||
TEMPLATE_NAME=elf
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
EMBEDDED=yes
|
||||
# These are for compatibility with the COFF toolchain.
|
||||
ENTRY=start
|
||||
|
@ -11,5 +11,7 @@ DATA_START_SYMBOLS='PROVIDE (__data_start = .);';
|
||||
|
||||
ENTRY=_start
|
||||
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
GENERATE_PIE_SCRIPT=yes
|
||||
unset EMBEDDED
|
||||
unset STACK_ADDR
|
||||
|
@ -2,3 +2,4 @@ source_sh ${srcdir}/emulparams/shelf.sh
|
||||
|
||||
# We do not want a .stack section
|
||||
unset STACK_ADDR
|
||||
GENERATE_SHLIB_SCRIPT=yes
|
||||
|
Loading…
x
Reference in New Issue
Block a user