aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-avr.h
blob: 688b70685415f854108b70e4e1f82a6778a19a3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* AVR-specific support for 32-bit ELF.
   Copyright (C) 2006-2015 Free Software Foundation, Inc.

   Written by Bjoern Haase <bjoern.m.haase@web.de>

   This file is part of BFD, the Binary File Descriptor library.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor,
   Boston, MA 02110-1301, USA.  */


/* These four functions will be called from the ld back-end.  */

extern void
elf32_avr_setup_params (struct bfd_link_info *, bfd *, asection *,
                        bfd_boolean, bfd_boolean, bfd_boolean,
                        bfd_vma, bfd_boolean);

extern int
elf32_avr_setup_section_lists (bfd *, struct bfd_link_info *);

extern bfd_boolean
elf32_avr_size_stubs (bfd *, struct bfd_link_info *, bfd_boolean);

extern bfd_boolean
elf32_avr_build_stubs (struct bfd_link_info *);

/* The name of the section into which the property records are stored.  */
#define AVR_PROPERTY_RECORD_SECTION_NAME ".avr.prop"

/* The current version number for the format of the property records.  */
#define AVR_PROPERTY_RECORDS_VERSION 1

/* The size of the header that is written to the property record section
   before the property records are written out.  */
#define AVR_PROPERTY_SECTION_HEADER_SIZE 4

/* This holds a single property record in memory, the structure of this
   data when written out to the ELF section is more compressed.  */

struct avr_property_record
{
  /* The section and offset for this record.  */
  asection *section;
  bfd_vma offset;

  /* The type of this record.  */
  enum {
    RECORD_ORG = 0,
    RECORD_ORG_AND_FILL = 1,
    RECORD_ALIGN = 2,
    RECORD_ALIGN_AND_FILL = 3
  } type;

  /* Type specific data.  */
  union
  {
    /* RECORD_ORG and RECORD_ORG_AND_FILL.  */
    struct
    {
      unsigned long fill;
    } org;

    /* RECORD_ALIGN and RECORD_ALIGN_AND_FILL.  */
    struct
    {
      unsigned long bytes;
      unsigned long fill;

      /* This field is used during linker relaxation to track the number of
         bytes that have been opened up before this alignment directive.
         When we have enough bytes available it is possible to move the
         re-align this directive backwards while still maintaining the
         alignment requirement.  */
      unsigned long preceding_deleted;
    } align;
  } data;
};