diff options
author | Alan Modra <amodra@gmail.com> | 2021-01-26 10:48:09 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-01-26 20:54:43 +1030 |
commit | 1c9c9b9b55520b36c15af94ee0803f0922b3ca09 (patch) | |
tree | 9f173d24144a20066955dc47b2e69201ab527656 /ld/emultempl/beos.em | |
parent | a45ef9a30ba53836cbc4ae1e287c20aeb4b349f6 (diff) | |
download | gdb-1c9c9b9b55520b36c15af94ee0803f0922b3ca09.zip gdb-1c9c9b9b55520b36c15af94ee0803f0922b3ca09.tar.gz gdb-1c9c9b9b55520b36c15af94ee0803f0922b3ca09.tar.bz2 |
PR27226, ld.bfd contains huge .rodata section
This makes it possible to build ld without any compiled-in scripts,
by setting COMPILE_IN=no in the environment. pe, beos and pdp11
targets didn't support scripts from the file system, with pdp11
nastily editing the ld/ldscripts file so that the built-in script
didn't match.
PR 27226
* emulparams/alphavms.sh: Don't set COMPILE_IN.
* emulparams/elf64_ia64_vms.sh: Likewise.
* emulparams/elf64mmix.sh: Likewise.
* emulparams/elf_iamcu.sh: Likewise.
* emulparams/elf_k1om.sh: Likewise.
* emulparams/elf_l1om.sh: Likewise.
* emulparams/mmo.sh: Likewise.
* emulparams/pdp11.sh: Set DATA_SEG_ADDR.
* scripttempl/pdp11.sc: Use it.
* emultempl/pdp11.em: Don't edit .xn script for separate_code,
instead use .xe script. Support scripts from file system.
* emultempl/beos.em: Support scripts from file system.
* emultempl/pe.em: Likewise.
* emultempl/pep.em: Likewise.
* testsuite/ld-bootstrap/bootstrap.exp: Make tmpdir/ldscripts link.
Diffstat (limited to 'ld/emultempl/beos.em')
-rw-r--r-- | ld/emultempl/beos.em | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ld/emultempl/beos.em b/ld/emultempl/beos.em index bb4395f..fc43ce1 100644 --- a/ld/emultempl/beos.em +++ b/ld/emultempl/beos.em @@ -712,7 +712,11 @@ gld${EMULATION_NAME}_place_orphan (asection *s, static char * gld_${EMULATION_NAME}_get_script (int *isfile) EOF + +if test x"$COMPILE_IN" = xyes +then # Scripts compiled in. + # sed commands to quote an ld script as a C string. sc="-f stringify.sed" @@ -734,6 +738,27 @@ echo ' ; else return' >> e${EMULATION_NAME}.c sed $sc ldscripts/${EMULATION_NAME}.x >> e${EMULATION_NAME}.c echo '; }' >> e${EMULATION_NAME}.c +else +# Scripts read from the filesystem. + +fragment <<EOF +{ + *isfile = 1; + + if (bfd_link_relocatable (&link_info) && config.build_constructors) + return "ldscripts/${EMULATION_NAME}.xu"; + else if (bfd_link_relocatable (&link_info)) + return "ldscripts/${EMULATION_NAME}.xr"; + else if (!config.text_read_only) + return "ldscripts/${EMULATION_NAME}.xbn"; + else if (!config.magic_demand_paged) + return "ldscripts/${EMULATION_NAME}.xn"; + else + return "ldscripts/${EMULATION_NAME}.x"; +} +EOF +fi + fragment <<EOF |