# This shell script emits a C file. -*- C -*-
-# Copyright 2000, 2001, 2002, 2003, 2004, 2007, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 2000-2016 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
if (cranges != NULL)
{
- if (command_line.relax)
+ if (RELAXATION_ENABLED)
{
/* FIXME: Look through incoming sections with .cranges
descriptors, build up some kind of descriptors that the
}
}
- command_line.relax = FALSE;
+ DISABLE_RELAXATION;
}
/* We wouldn't need to do anything when there's already a .cranges
.cranges section. */
}
- if (command_line.relax)
+ if (RELAXATION_ENABLED)
{
LANG_FOR_EACH_INPUT_STATEMENT (f)
{
if (bfd_get_flavour (f->the_bfd) == bfd_target_elf_flavour)
{
asection *isec;
+
for (isec = f->the_bfd->sections;
isec != NULL;
isec = isec->next)
{
einfo (_("%P: Sorry, turning off relaxing: SHmedia sections present.\n"));
einfo (" %I\n", f);
- command_line.relax = FALSE;
+ DISABLE_RELAXATION;
goto done_scanning_shmedia_sections;
}
}
bfd_vma cranges_growth = 0;
asection *osec;
bfd_byte *crangesp;
+ asection *cranges;
- asection *cranges = bfd_get_section_by_name (link_info.output_bfd,
- SH64_CRANGES_SECTION_NAME);
+ gld${EMULATION_NAME}_after_allocation ();
- /* If this ever starts doing something, we will pick it up. */
- after_allocation_default ();
+ /* Needed, since we create link_orders here. */
+ lang_clear_os_map ();
+
+ cranges = bfd_get_section_by_name (link_info.output_bfd,
+ SH64_CRANGES_SECTION_NAME);
/* If there is no .cranges section, it is because it was seen earlier on
that none was needed. Otherwise it must have been created then, or
}
}
- /* ldemul_after_allocation may be called twice. First directly from
- lang_process, and the second time when lang_process calls ldemul_finish,
- which calls gld${EMULATION_NAME}_finish, e.g. gldshelf32_finish, which
- is defined in emultempl/elf32.em and calls ldemul_after_allocation,
- if bfd_elf_discard_info returned true. */
if (cranges->contents != NULL)
free (cranges->contents);
/* If we emit relocatable contents, we need a
relocation for the start address. */
- if (link_info.relocatable || link_info.emitrelocations)
+ if (bfd_link_relocatable (&link_info)
+ || link_info.emitrelocations)
{
/* FIXME: We could perhaps use lang_add_reloc and
friends here, but I'm not really sure that
cranges->size = crangesp - cranges->contents;
cranges->rawsize = cranges->size;
}
+EOF
+
+