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.