OpenCores
URL https://opencores.org/ocsvn/hf-risc/hf-risc/trunk

Subversion Repositories hf-risc

[/] [hf-risc/] [trunk/] [tools/] [riscv-gnu-toolchain-master/] [binutils/] [ld/] [emultempl/] [riscvelf.em] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 serginhofr
# This shell script emits a C file. -*- C -*-
2
#   Copyright 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
3
#
4
# This file is part of the GNU Binutils.
5
#
6
# This program is free software; you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation; either version 3 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19
# MA 02110-1301, USA.
20
 
21
fragment <
22
 
23
#include "ldmain.h"
24
#include "ldctor.h"
25
#include "elf/riscv.h"
26
#include "elfxx-riscv.h"
27
 
28
static void
29
riscv_elf_before_allocation (void)
30
{
31
  gld${EMULATION_NAME}_before_allocation ();
32
 
33
  if (link_info.discard == discard_sec_merge)
34
    link_info.discard = discard_l;
35
 
36
  /* We always need at least some relaxation to handle code alignment.  */
37
  if (RELAXATION_DISABLED_BY_USER)
38
    TARGET_ENABLE_RELAXATION;
39
  else
40
    ENABLE_RELAXATION;
41
 
42
  link_info.relax_pass = 2;
43
}
44
 
45
static void
46
gld${EMULATION_NAME}_after_allocation (void)
47
{
48
  int need_layout = 0;
49
 
50
  /* Don't attempt to discard unused .eh_frame sections until the final link,
51
     as we can't reliably tell if they're used until after relaxation.  */
52
  if (!link_info.relocatable)
53
    {
54
      need_layout = bfd_elf_discard_info (link_info.output_bfd, &link_info);
55
      if (need_layout < 0)
56
        {
57
          einfo ("%X%P: .eh_frame/.stab edit: %E\n");
58
          return;
59
        }
60
    }
61
 
62
  gld${EMULATION_NAME}_map_segments (need_layout);
63
}
64
 
65
EOF
66
 
67
LDEMUL_BEFORE_ALLOCATION=riscv_elf_before_allocation
68
LDEMUL_AFTER_ALLOCATION=gld${EMULATION_NAME}_after_allocation

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.