diff options
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 |