annotate include/plugin-api.h @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 /* plugin-api.h -- External linker plugin API. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
3 /* Copyright (C) 2009-2018 Free Software Foundation, Inc.
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 Written by Cary Coutant <ccoutant@google.com>.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 This file is part of binutils.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 This program is free software; you can redistribute it and/or modify
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 it under the terms of the GNU General Public License as published by
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 the Free Software Foundation; either version 3 of the License, or
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 (at your option) any later version.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 This program is distributed in the hope that it will be useful,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 GNU General Public License for more details.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 along with this program; if not, write to the Free Software
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 MA 02110-1301, USA. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 /* This file defines the interface for writing a linker plugin, which is
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 described at < http://gcc.gnu.org/wiki/whopr/driver >. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 #ifndef PLUGIN_API_H
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 #define PLUGIN_API_H
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 #ifdef HAVE_STDINT_H
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 #include <stdint.h>
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 #elif defined(HAVE_INTTYPES_H)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 #include <inttypes.h>
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 #endif
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 #include <sys/types.h>
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 #if !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H) && \
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 !defined(UINT64_MAX) && !defined(uint64_t)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 #error can not find uint64_t type
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 #endif
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 #ifdef __cplusplus
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 extern "C"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 #endif
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 /* Status code returned by most API routines. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 LDPS_OK = 0,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 LDPS_NO_SYMS, /* Attempt to get symbols that haven't been added. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 LDPS_BAD_HANDLE, /* No claimed object associated with given handle. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 LDPS_ERR
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 /* Additional Error codes TBD. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 /* The version of the API specification. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
57
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 enum ld_plugin_api_version
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 LD_PLUGIN_API_VERSION = 1
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
62
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 /* The type of output file being generated by the linker. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
64
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 enum ld_plugin_output_file_type
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 LDPO_REL,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 LDPO_EXEC,
111
kono
parents: 67
diff changeset
69 LDPO_DYN,
kono
parents: 67
diff changeset
70 LDPO_PIE
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
72
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 /* An input file managed by the plugin library. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
74
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 struct ld_plugin_input_file
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 const char *name;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 int fd;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 off_t offset;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 off_t filesize;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 void *handle;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
83
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
84 /* A symbol belonging to an input file managed by the plugin library. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
85
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 struct ld_plugin_symbol
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 char *name;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 char *version;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 int def;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 int visibility;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 uint64_t size;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 char *comdat_key;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 int resolution;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
96
111
kono
parents: 67
diff changeset
97 /* An object's section. */
kono
parents: 67
diff changeset
98
kono
parents: 67
diff changeset
99 struct ld_plugin_section
kono
parents: 67
diff changeset
100 {
kono
parents: 67
diff changeset
101 const void* handle;
kono
parents: 67
diff changeset
102 unsigned int shndx;
kono
parents: 67
diff changeset
103 };
kono
parents: 67
diff changeset
104
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
105 /* Whether the symbol is a definition, reference, or common, weak or not. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
106
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
107 enum ld_plugin_symbol_kind
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
108 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
109 LDPK_DEF,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
110 LDPK_WEAKDEF,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
111 LDPK_UNDEF,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 LDPK_WEAKUNDEF,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 LDPK_COMMON
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
114 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
115
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
116 /* The visibility of the symbol. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
117
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 enum ld_plugin_symbol_visibility
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
120 LDPV_DEFAULT,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 LDPV_PROTECTED,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 LDPV_INTERNAL,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 LDPV_HIDDEN
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
124 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
125
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 /* How a symbol is resolved. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 enum ld_plugin_symbol_resolution
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
129 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 LDPR_UNKNOWN = 0,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
131
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 /* Symbol is still undefined at this point. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
133 LDPR_UNDEF,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
134
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
135 /* This is the prevailing definition of the symbol, with references from
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
136 regular object code. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
137 LDPR_PREVAILING_DEF,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
138
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
139 /* This is the prevailing definition of the symbol, with no
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 references from regular objects. It is only referenced from IR
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 code. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 LDPR_PREVAILING_DEF_IRONLY,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
143
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 /* This definition was pre-empted by a definition in a regular
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 object file. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 LDPR_PREEMPTED_REG,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
147
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 /* This definition was pre-empted by a definition in another IR file. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 LDPR_PREEMPTED_IR,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
150
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 /* This symbol was resolved by a definition in another IR file. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 LDPR_RESOLVED_IR,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
153
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 /* This symbol was resolved by a definition in a regular object
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
155 linked into the main executable. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 LDPR_RESOLVED_EXEC,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
157
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 /* This symbol was resolved by a definition in a shared object. */
111
kono
parents: 67
diff changeset
159 LDPR_RESOLVED_DYN,
kono
parents: 67
diff changeset
160
kono
parents: 67
diff changeset
161 /* This is the prevailing definition of the symbol, with no
kono
parents: 67
diff changeset
162 references from regular objects. It is only referenced from IR
kono
parents: 67
diff changeset
163 code, but the symbol is exported and may be referenced from
kono
parents: 67
diff changeset
164 a dynamic object (not seen at link time). */
kono
parents: 67
diff changeset
165 LDPR_PREVAILING_DEF_IRONLY_EXP
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
166 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
167
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 /* The plugin library's "claim file" handler. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
169
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 (*ld_plugin_claim_file_handler) (
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 const struct ld_plugin_input_file *file, int *claimed);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
174
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 /* The plugin library's "all symbols read" handler. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
176
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
179 (*ld_plugin_all_symbols_read_handler) (void);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
180
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
181 /* The plugin library's cleanup handler. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
182
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 (*ld_plugin_cleanup_handler) (void);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
186
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
187 /* The linker's interface for registering the "claim file" handler. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
188
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 (*ld_plugin_register_claim_file) (ld_plugin_claim_file_handler handler);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
192
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
193 /* The linker's interface for registering the "all symbols read" handler. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
194
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
195 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
197 (*ld_plugin_register_all_symbols_read) (
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 ld_plugin_all_symbols_read_handler handler);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
199
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 /* The linker's interface for registering the cleanup handler. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
201
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
202 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
203 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
204 (*ld_plugin_register_cleanup) (ld_plugin_cleanup_handler handler);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
205
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 /* The linker's interface for adding symbols from a claimed input file. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
207
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 (*ld_plugin_add_symbols) (void *handle, int nsyms,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 const struct ld_plugin_symbol *syms);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
212
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 /* The linker's interface for getting the input file information with
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 an open (possibly re-opened) file descriptor. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
215
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
217 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
218 (*ld_plugin_get_input_file) (const void *handle,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
219 struct ld_plugin_input_file *file);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
220
111
kono
parents: 67
diff changeset
221 typedef
kono
parents: 67
diff changeset
222 enum ld_plugin_status
kono
parents: 67
diff changeset
223 (*ld_plugin_get_view) (const void *handle, const void **viewp);
kono
parents: 67
diff changeset
224
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 /* The linker's interface for releasing the input file. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
226
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
228 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 (*ld_plugin_release_input_file) (const void *handle);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
230
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 /* The linker's interface for retrieving symbol resolution information. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
232
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 (*ld_plugin_get_symbols) (const void *handle, int nsyms,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
236 struct ld_plugin_symbol *syms);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
237
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 /* The linker's interface for adding a compiled input file. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
239
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 enum ld_plugin_status
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
242 (*ld_plugin_add_input_file) (const char *pathname);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
243
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
244 /* The linker's interface for adding a library that should be searched. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
245
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 enum ld_plugin_status
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
248 (*ld_plugin_add_input_library) (const char *libname);
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
249
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
250 /* The linker's interface for adding a library path that should be searched. */
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
251
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
252 typedef
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
253 enum ld_plugin_status
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
254 (*ld_plugin_set_extra_library_path) (const char *path);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
255
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 /* The linker's interface for issuing a warning or error message. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
257
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
260 (*ld_plugin_message) (int level, const char *format, ...);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
261
111
kono
parents: 67
diff changeset
262 /* The linker's interface for retrieving the number of sections in an object.
kono
parents: 67
diff changeset
263 The handle is obtained in the claim_file handler. This interface should
kono
parents: 67
diff changeset
264 only be invoked in the claim_file handler. This function sets *COUNT to
kono
parents: 67
diff changeset
265 the number of sections in the object. */
kono
parents: 67
diff changeset
266
kono
parents: 67
diff changeset
267 typedef
kono
parents: 67
diff changeset
268 enum ld_plugin_status
kono
parents: 67
diff changeset
269 (*ld_plugin_get_input_section_count) (const void* handle, unsigned int *count);
kono
parents: 67
diff changeset
270
kono
parents: 67
diff changeset
271 /* The linker's interface for retrieving the section type of a specific
kono
parents: 67
diff changeset
272 section in an object. This interface should only be invoked in the
kono
parents: 67
diff changeset
273 claim_file handler. This function sets *TYPE to an ELF SHT_xxx value. */
kono
parents: 67
diff changeset
274
kono
parents: 67
diff changeset
275 typedef
kono
parents: 67
diff changeset
276 enum ld_plugin_status
kono
parents: 67
diff changeset
277 (*ld_plugin_get_input_section_type) (const struct ld_plugin_section section,
kono
parents: 67
diff changeset
278 unsigned int *type);
kono
parents: 67
diff changeset
279
kono
parents: 67
diff changeset
280 /* The linker's interface for retrieving the name of a specific section in
kono
parents: 67
diff changeset
281 an object. This interface should only be invoked in the claim_file handler.
kono
parents: 67
diff changeset
282 This function sets *SECTION_NAME_PTR to a null-terminated buffer allocated
kono
parents: 67
diff changeset
283 by malloc. The plugin must free *SECTION_NAME_PTR. */
kono
parents: 67
diff changeset
284
kono
parents: 67
diff changeset
285 typedef
kono
parents: 67
diff changeset
286 enum ld_plugin_status
kono
parents: 67
diff changeset
287 (*ld_plugin_get_input_section_name) (const struct ld_plugin_section section,
kono
parents: 67
diff changeset
288 char **section_name_ptr);
kono
parents: 67
diff changeset
289
kono
parents: 67
diff changeset
290 /* The linker's interface for retrieving the contents of a specific section
kono
parents: 67
diff changeset
291 in an object. This interface should only be invoked in the claim_file
kono
parents: 67
diff changeset
292 handler. This function sets *SECTION_CONTENTS to point to a buffer that is
kono
parents: 67
diff changeset
293 valid until clam_file handler returns. It sets *LEN to the size of the
kono
parents: 67
diff changeset
294 buffer. */
kono
parents: 67
diff changeset
295
kono
parents: 67
diff changeset
296 typedef
kono
parents: 67
diff changeset
297 enum ld_plugin_status
kono
parents: 67
diff changeset
298 (*ld_plugin_get_input_section_contents) (const struct ld_plugin_section section,
kono
parents: 67
diff changeset
299 const unsigned char **section_contents,
kono
parents: 67
diff changeset
300 size_t* len);
kono
parents: 67
diff changeset
301
kono
parents: 67
diff changeset
302 /* The linker's interface for specifying the desired order of sections.
kono
parents: 67
diff changeset
303 The sections should be specifed using the array SECTION_LIST in the
kono
parents: 67
diff changeset
304 order in which they should appear in the final layout. NUM_SECTIONS
kono
parents: 67
diff changeset
305 specifies the number of entries in each array. This should be invoked
kono
parents: 67
diff changeset
306 in the all_symbols_read handler. */
kono
parents: 67
diff changeset
307
kono
parents: 67
diff changeset
308 typedef
kono
parents: 67
diff changeset
309 enum ld_plugin_status
kono
parents: 67
diff changeset
310 (*ld_plugin_update_section_order) (const struct ld_plugin_section *section_list,
kono
parents: 67
diff changeset
311 unsigned int num_sections);
kono
parents: 67
diff changeset
312
kono
parents: 67
diff changeset
313 /* The linker's interface for specifying that reordering of sections is
kono
parents: 67
diff changeset
314 desired so that the linker can prepare for it. This should be invoked
kono
parents: 67
diff changeset
315 before update_section_order, preferably in the claim_file handler. */
kono
parents: 67
diff changeset
316
kono
parents: 67
diff changeset
317 typedef
kono
parents: 67
diff changeset
318 enum ld_plugin_status
kono
parents: 67
diff changeset
319 (*ld_plugin_allow_section_ordering) (void);
kono
parents: 67
diff changeset
320
kono
parents: 67
diff changeset
321 /* The linker's interface for specifying that a subset of sections is
kono
parents: 67
diff changeset
322 to be mapped to a unique segment. If the plugin wants to call
kono
parents: 67
diff changeset
323 unique_segment_for_sections, it must call this function from a
kono
parents: 67
diff changeset
324 claim_file_handler or when it is first loaded. */
kono
parents: 67
diff changeset
325
kono
parents: 67
diff changeset
326 typedef
kono
parents: 67
diff changeset
327 enum ld_plugin_status
kono
parents: 67
diff changeset
328 (*ld_plugin_allow_unique_segment_for_sections) (void);
kono
parents: 67
diff changeset
329
kono
parents: 67
diff changeset
330 /* The linker's interface for specifying that a specific set of sections
kono
parents: 67
diff changeset
331 must be mapped to a unique segment. ELF segments do not have names
kono
parents: 67
diff changeset
332 and the NAME is used as the name of the newly created output section
kono
parents: 67
diff changeset
333 that is then placed in the unique PT_LOAD segment. FLAGS is used to
kono
parents: 67
diff changeset
334 specify if any additional segment flags need to be set. For instance,
kono
parents: 67
diff changeset
335 a specific segment flag can be set to identify this segment. Unsetting
kono
parents: 67
diff changeset
336 segment flags that would be set by default is not possible. The
kono
parents: 67
diff changeset
337 parameter SEGMENT_ALIGNMENT when non-zero will override the default. */
kono
parents: 67
diff changeset
338
kono
parents: 67
diff changeset
339 typedef
kono
parents: 67
diff changeset
340 enum ld_plugin_status
kono
parents: 67
diff changeset
341 (*ld_plugin_unique_segment_for_sections) (
kono
parents: 67
diff changeset
342 const char* segment_name,
kono
parents: 67
diff changeset
343 uint64_t segment_flags,
kono
parents: 67
diff changeset
344 uint64_t segment_alignment,
kono
parents: 67
diff changeset
345 const struct ld_plugin_section * section_list,
kono
parents: 67
diff changeset
346 unsigned int num_sections);
kono
parents: 67
diff changeset
347
kono
parents: 67
diff changeset
348 /* The linker's interface for retrieving the section alignment requirement
kono
parents: 67
diff changeset
349 of a specific section in an object. This interface should only be invoked in the
kono
parents: 67
diff changeset
350 claim_file handler. This function sets *ADDRALIGN to the ELF sh_addralign
kono
parents: 67
diff changeset
351 value of the input section. */
kono
parents: 67
diff changeset
352
kono
parents: 67
diff changeset
353 typedef
kono
parents: 67
diff changeset
354 enum ld_plugin_status
kono
parents: 67
diff changeset
355 (*ld_plugin_get_input_section_alignment) (const struct ld_plugin_section section,
kono
parents: 67
diff changeset
356 unsigned int *addralign);
kono
parents: 67
diff changeset
357
kono
parents: 67
diff changeset
358 /* The linker's interface for retrieving the section size of a specific section
kono
parents: 67
diff changeset
359 in an object. This interface should only be invoked in the claim_file handler.
kono
parents: 67
diff changeset
360 This function sets *SECSIZE to the ELF sh_size
kono
parents: 67
diff changeset
361 value of the input section. */
kono
parents: 67
diff changeset
362
kono
parents: 67
diff changeset
363 typedef
kono
parents: 67
diff changeset
364 enum ld_plugin_status
kono
parents: 67
diff changeset
365 (*ld_plugin_get_input_section_size) (const struct ld_plugin_section section,
kono
parents: 67
diff changeset
366 uint64_t *secsize);
kono
parents: 67
diff changeset
367
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
368 typedef
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
369 enum ld_plugin_status
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
370 (*ld_plugin_new_input_handler) (const struct ld_plugin_input_file *file);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
371
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
372 /* The linker's interface for registering the "new_input" handler. This handler
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
373 will be notified when a new input file has been added after the
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
374 all_symbols_read event, allowing the plugin to, for example, set a unique
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
375 segment for sections in plugin-generated input files. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
376
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
377 typedef
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
378 enum ld_plugin_status
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
379 (*ld_plugin_register_new_input) (ld_plugin_new_input_handler handler);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
380
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
381 /* The linker's interface for getting the list of wrapped symbols using the
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
382 --wrap option. This sets *NUM_SYMBOLS to number of wrapped symbols and
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
383 *WRAP_SYMBOL_LIST to the list of wrapped symbols. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
384
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
385 typedef
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
386 enum ld_plugin_status
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
387 (*ld_plugin_get_wrap_symbols) (uint64_t *num_symbols,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
388 const char ***wrap_symbol_list);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
389
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 enum ld_plugin_level
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 LDPL_INFO,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 LDPL_WARNING,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 LDPL_ERROR,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 LDPL_FATAL
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
396 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
397
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
398 /* Values for the tv_tag field of the transfer vector. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
399
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
400 enum ld_plugin_tag
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
401 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
402 LDPT_NULL = 0,
111
kono
parents: 67
diff changeset
403 LDPT_API_VERSION = 1,
kono
parents: 67
diff changeset
404 LDPT_GOLD_VERSION = 2,
kono
parents: 67
diff changeset
405 LDPT_LINKER_OUTPUT = 3,
kono
parents: 67
diff changeset
406 LDPT_OPTION = 4,
kono
parents: 67
diff changeset
407 LDPT_REGISTER_CLAIM_FILE_HOOK = 5,
kono
parents: 67
diff changeset
408 LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK = 6,
kono
parents: 67
diff changeset
409 LDPT_REGISTER_CLEANUP_HOOK = 7,
kono
parents: 67
diff changeset
410 LDPT_ADD_SYMBOLS = 8,
kono
parents: 67
diff changeset
411 LDPT_GET_SYMBOLS = 9,
kono
parents: 67
diff changeset
412 LDPT_ADD_INPUT_FILE = 10,
kono
parents: 67
diff changeset
413 LDPT_MESSAGE = 11,
kono
parents: 67
diff changeset
414 LDPT_GET_INPUT_FILE = 12,
kono
parents: 67
diff changeset
415 LDPT_RELEASE_INPUT_FILE = 13,
kono
parents: 67
diff changeset
416 LDPT_ADD_INPUT_LIBRARY = 14,
kono
parents: 67
diff changeset
417 LDPT_OUTPUT_NAME = 15,
kono
parents: 67
diff changeset
418 LDPT_SET_EXTRA_LIBRARY_PATH = 16,
kono
parents: 67
diff changeset
419 LDPT_GNU_LD_VERSION = 17,
kono
parents: 67
diff changeset
420 LDPT_GET_VIEW = 18,
kono
parents: 67
diff changeset
421 LDPT_GET_INPUT_SECTION_COUNT = 19,
kono
parents: 67
diff changeset
422 LDPT_GET_INPUT_SECTION_TYPE = 20,
kono
parents: 67
diff changeset
423 LDPT_GET_INPUT_SECTION_NAME = 21,
kono
parents: 67
diff changeset
424 LDPT_GET_INPUT_SECTION_CONTENTS = 22,
kono
parents: 67
diff changeset
425 LDPT_UPDATE_SECTION_ORDER = 23,
kono
parents: 67
diff changeset
426 LDPT_ALLOW_SECTION_ORDERING = 24,
kono
parents: 67
diff changeset
427 LDPT_GET_SYMBOLS_V2 = 25,
kono
parents: 67
diff changeset
428 LDPT_ALLOW_UNIQUE_SEGMENT_FOR_SECTIONS = 26,
kono
parents: 67
diff changeset
429 LDPT_UNIQUE_SEGMENT_FOR_SECTIONS = 27,
kono
parents: 67
diff changeset
430 LDPT_GET_SYMBOLS_V3 = 28,
kono
parents: 67
diff changeset
431 LDPT_GET_INPUT_SECTION_ALIGNMENT = 29,
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
432 LDPT_GET_INPUT_SECTION_SIZE = 30,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
433 LDPT_REGISTER_NEW_INPUT_HOOK = 31,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
434 LDPT_GET_WRAP_SYMBOLS = 32
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
435 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
436
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 /* The plugin transfer vector. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
438
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
439 struct ld_plugin_tv
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
441 enum ld_plugin_tag tv_tag;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
442 union
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
443 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
444 int tv_val;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
445 const char *tv_string;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
446 ld_plugin_register_claim_file tv_register_claim_file;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
447 ld_plugin_register_all_symbols_read tv_register_all_symbols_read;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 ld_plugin_register_cleanup tv_register_cleanup;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 ld_plugin_add_symbols tv_add_symbols;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 ld_plugin_get_symbols tv_get_symbols;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
451 ld_plugin_add_input_file tv_add_input_file;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 ld_plugin_message tv_message;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 ld_plugin_get_input_file tv_get_input_file;
111
kono
parents: 67
diff changeset
454 ld_plugin_get_view tv_get_view;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 ld_plugin_release_input_file tv_release_input_file;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 ld_plugin_add_input_library tv_add_input_library;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
457 ld_plugin_set_extra_library_path tv_set_extra_library_path;
111
kono
parents: 67
diff changeset
458 ld_plugin_get_input_section_count tv_get_input_section_count;
kono
parents: 67
diff changeset
459 ld_plugin_get_input_section_type tv_get_input_section_type;
kono
parents: 67
diff changeset
460 ld_plugin_get_input_section_name tv_get_input_section_name;
kono
parents: 67
diff changeset
461 ld_plugin_get_input_section_contents tv_get_input_section_contents;
kono
parents: 67
diff changeset
462 ld_plugin_update_section_order tv_update_section_order;
kono
parents: 67
diff changeset
463 ld_plugin_allow_section_ordering tv_allow_section_ordering;
kono
parents: 67
diff changeset
464 ld_plugin_allow_unique_segment_for_sections tv_allow_unique_segment_for_sections;
kono
parents: 67
diff changeset
465 ld_plugin_unique_segment_for_sections tv_unique_segment_for_sections;
kono
parents: 67
diff changeset
466 ld_plugin_get_input_section_alignment tv_get_input_section_alignment;
kono
parents: 67
diff changeset
467 ld_plugin_get_input_section_size tv_get_input_section_size;
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
468 ld_plugin_register_new_input tv_register_new_input;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
469 ld_plugin_get_wrap_symbols tv_get_wrap_symbols;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
470 } tv_u;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 };
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
472
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
473 /* The plugin library's "onload" entry point. */
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
474
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
475 typedef
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
476 enum ld_plugin_status
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
477 (*ld_plugin_onload) (struct ld_plugin_tv *tv);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
478
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 #ifdef __cplusplus
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
480 }
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 #endif
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
482
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 #endif /* !defined(PLUGIN_API_H) */