36af4a4e51
* elflink.h (elf_link_add_object_symbols): Use !info->executable instead of info->shared where appropriate. (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. (_bfd_elf_link_create_dynamic_sections): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section and DT_DEBUG dynamic tag even for position independent executables. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise. * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise. * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise. * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise. include/ * bfdlink.h (struct bfd_link_info): Add pie and executable bits. ld/ * lexsup.c (OPTION_PIE): Define. (ld_options): Add -pie and --pic-executable options. (parse_args): Handle OPTION_PIE. * ldmain.c (main): Initialize link_info.pie and link_info.executable. * genscripts.sh: Generate PIE scripts. * ld.texinfo: Document -pie and --pic-executable options. * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): (gld${EMULATION_NAME}_place_orphan): Likewise. (gld${EMULATION_NAME}_get_script): Include PIE scripts. * scripttempl/elf.sc: In PIE scripts set . the same way as in shared scripts. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Set to yes. * emulparams/elf64_ia64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_x86_64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64alpha.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Likewise.
40 lines
1.2 KiB
Bash
40 lines
1.2 KiB
Bash
# If you change this file, please also look at files which source this one:
|
|
# elf32lppc.sh elf32ppclinux.sh elf32ppcsim.sh
|
|
|
|
TEMPLATE_NAME=elf32
|
|
EXTRA_EM_FILE=ppc32elf
|
|
GENERATE_SHLIB_SCRIPT=yes
|
|
GENERATE_PIE_SCRIPT=yes
|
|
SCRIPT_NAME=elf
|
|
OUTPUT_FORMAT="elf32-powerpc"
|
|
TEXT_START_ADDR=0x01800000
|
|
MAXPAGESIZE=0x10000
|
|
ARCH=powerpc:common
|
|
MACHINE=
|
|
BSS_PLT=
|
|
EXECUTABLE_SYMBOLS='PROVIDE (__stack = 0); PROVIDE (___stack = 0);'
|
|
OTHER_BSS_END_SYMBOLS='__end = .;'
|
|
OTHER_READWRITE_SECTIONS="
|
|
.fixup ${RELOCATING-0} : { *(.fixup) }
|
|
.got1 ${RELOCATING-0} : { *(.got1) }
|
|
.got2 ${RELOCATING-0} : { *(.got2) }
|
|
"
|
|
OTHER_GOT_RELOC_SECTIONS="
|
|
.rela.got1 ${RELOCATING-0} : { *(.rela.got1) }
|
|
.rela.got2 ${RELOCATING-0} : { *(.rela.got2) }
|
|
"
|
|
|
|
# Treat a host that matches the target with the possible exception of "64"
|
|
# in the name as if it were native.
|
|
if test `echo "$host" | sed -e s/64//` = `echo "$target" | sed -e s/64//`; then
|
|
case " $EMULATION_LIBPATH " in
|
|
*" ${EMULATION_NAME} "*)
|
|
NATIVE=yes
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
# Look for 64 bit target libraries in /lib64, /usr/lib64 etc., first.
|
|
case "$EMULATION_NAME" in
|
|
*64*) LIBPATH_SUFFIX=64 ;;
|
|
esac
|