]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/elf32-avr.h
avr/gas: Write out data to track .org/.align usage.
[thirdparty/binutils-gdb.git] / bfd / elf32-avr.h
CommitLineData
28c9d252 1/* AVR-specific support for 32-bit ELF.
b90efa5b 2 Copyright (C) 2006-2015 Free Software Foundation, Inc.
28c9d252
NC
3
4 Written by Bjoern Haase <bjoern.m.haase@web.de>
5
6 This file is part of BFD, the Binary File Descriptor library.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
cd123cb7 10 the Free Software Foundation; either version 3 of the License, or
28c9d252
NC
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
68ffbac6 20 Foundation, Inc., 51 Franklin Street - Fifth Floor,
28c9d252
NC
21 Boston, MA 02110-1301, USA. */
22
23
24/* These four functions will be called from the ld back-end. */
25
26extern void
27elf32_avr_setup_params (struct bfd_link_info *, bfd *, asection *,
28 bfd_boolean, bfd_boolean, bfd_boolean,
29 bfd_vma, bfd_boolean);
30
31extern int
32elf32_avr_setup_section_lists (bfd *, struct bfd_link_info *);
33
34extern bfd_boolean
35elf32_avr_size_stubs (bfd *, struct bfd_link_info *, bfd_boolean);
36
37extern bfd_boolean
38elf32_avr_build_stubs (struct bfd_link_info *);
fdd410ac
AB
39
40/* The name of the section into which the property records are stored. */
41#define AVR_PROPERTY_RECORD_SECTION_NAME ".avr.prop"
42
43/* The current version number for the format of the property records. */
44#define AVR_PROPERTY_RECORDS_VERSION 1
45
46/* The size of the header that is written to the property record section
47 before the property records are written out. */
48#define AVR_PROPERTY_SECTION_HEADER_SIZE 4
49
50/* This holds a single property record in memory, the structure of this
51 data when written out to the ELF section is more compressed. */
52
53struct avr_property_record
54{
55 /* The section and offset for this record. */
56 asection *section;
57 bfd_vma offset;
58
59 /* The type of this record. */
60 enum {
61 RECORD_ORG = 0,
62 RECORD_ORG_AND_FILL = 1,
63 RECORD_ALIGN = 2,
64 RECORD_ALIGN_AND_FILL = 3
65 } type;
66
67 /* Type specific data. */
68 union
69 {
70 /* RECORD_ORG and RECORD_ORG_AND_FILL. */
71 struct
72 {
73 unsigned long fill;
74 } org;
75
76 /* RECORD_ALIGN and RECORD_ALIGN_AND_FILL. */
77 struct
78 {
79 unsigned long bytes;
80 unsigned long fill;
81
82 /* This field is used during linker relaxation to track the number of
83 bytes that have been opened up before this alignment directive.
84 When we have enough bytes available it is possible to move the
85 re-align this directive backwards while still maintaining the
86 alignment requirement. */
87 unsigned long preceding_deleted;
88 } align;
89 } data;
90};