FIXME stripping images with a .rsrc section still needs to be fixed. */
if (i != 0)
{
- if ((CONST_STRNEQ (sna, ".stab"))
- && (!CONST_STRNEQ (snb, ".stab")))
+ if ((startswith (sna, ".stab"))
+ && (!startswith (snb, ".stab")))
return 1;
}
return i;
{
/* Is this the .idata section? */
if (sec->spec.name != NULL
- && CONST_STRNEQ (sec->spec.name, ".idata"))
+ && startswith (sec->spec.name, ".idata"))
{
/* Sort the children. We want to sort any objects in
the same archive. In order to handle the case of
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"
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