GENERATE_SHLIB_SCRIPT vs. EMBEDDED.
authorAlan Modra <amodra@gmail.com>
Fri, 1 Nov 2019 03:15:25 +0000 (13:45 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 5 Nov 2019 04:02:19 +0000 (14:32 +1030)
commitf2aaebdb97977ee7a5c83c02af871e758e7d594b
tree6fba5fa0f963bd0460e7aae7a112be529ddaf67b
parentcbb54a288a91084361cd4d57c88a73540494980b
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.
15 files changed:
ld/ChangeLog
ld/emulparams/aarch64elf.sh
ld/emulparams/aarch64elf32.sh
ld/emulparams/arcelf.sh
ld/emulparams/armelf.sh
ld/emulparams/armelf_fbsd.sh
ld/emulparams/armelf_nbsd.sh
ld/emulparams/armelf_vxworks.sh
ld/emulparams/armsymbian.sh
ld/emulparams/elf32bfin.sh
ld/emulparams/elf32microblaze.sh
ld/emulparams/score3_elf.sh
ld/emulparams/shelf.sh
ld/emulparams/shelf_nbsd.sh
ld/emulparams/shelf_uclinux.sh
This page took 0.027038 seconds and 4 git commands to generate.