/* This file is is generated by a shell script. DO NOT EDIT! */
/* Emulate the original gld for the given ${EMULATION_NAME}
- Copyright (C) 2014-2015 Free Software Foundation, Inc.
+ Copyright (C) 2014-2017 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
Extended for the MSP430 by Nick Clifton nickc@redhat.com
/* The MSP430 port *needs* linker relaxtion in order to cope with large
functions where conditional branches do not fit into a +/- 1024 byte range. */
- if (! link_info.relocatable)
+ if (!bfd_link_relocatable (&link_info))
TARGET_ENABLE_RELAXATION;
}
{
*isfile = 0;
- if (link_info.relocatable && config.build_constructors)
+ if (bfd_link_relocatable (&link_info) && config.build_constructors)
return
EOF
sed $sc ldscripts/${EMULATION_NAME}.xu >> e${EMULATION_NAME}.c
-echo ' ; else if (link_info.relocatable) return' >> e${EMULATION_NAME}.c
+echo ' ; else if (bfd_link_relocatable (&link_info)) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xr >> e${EMULATION_NAME}.c
echo ' ; else if (!config.text_read_only) return' >> e${EMULATION_NAME}.c
sed $sc ldscripts/${EMULATION_NAME}.xbn >> e${EMULATION_NAME}.c
{
*isfile = 1;
- if (link_info.relocatable && config.build_constructors)
+ if (bfd_link_relocatable (&link_info) && config.build_constructors)
return "ldscripts/${EMULATION_NAME}.xu";
- else if (link_info.relocatable)
+ else if (bfd_link_relocatable (&link_info))
return "ldscripts/${EMULATION_NAME}.xr";
else if (!config.text_read_only)
return "ldscripts/${EMULATION_NAME}.xbn";
char * lower_name;
char * upper_name;
char * name;
+ char * buf = NULL;
lang_output_section_statement_type * lower;
lang_output_section_statement_type * upper;
lang_output_section_statement_type * os;
if ((s->flags & SEC_ALLOC) == 0)
return NULL;
- if (link_info.relocatable)
+ if (bfd_link_relocatable (&link_info))
return NULL;
/* If constraints are involved let the linker handle the placement normally. */
only use the part of the name before the second dot. */
if (strchr (secname + 1, '.') != NULL)
{
- name = ACONCAT ((secname, NULL));
+ buf = name = xstrdup (secname);
* strchr (name + 1, '.') = 0;
}
else
name = (char *) secname;
- lower_name = ACONCAT ((".lower", name, NULL));
- upper_name = ACONCAT ((".upper", name, NULL));
+ lower_name = concat (".lower", name, NULL);
+ upper_name = concat (".upper", name, NULL);
/* Find the corresponding lower and upper sections. */
lower = lang_output_section_find (lower_name);
if (upper == NULL)
{
einfo ("%P: error: no section named %s or %s in linker script\n", lower_name, upper_name);
- return NULL;
+ goto end;
}
}
else if (upper == NULL)
}
lang_add_section (& os->children, s, NULL, os);
+ end:
+ free (upper_name);
+ free (lower_name);
+ if (buf)
+ free (buf);
return os;
}
EOF