Beifengdo commited on
Commit
dca58c2
·
verified ·
1 Parent(s): 963c3c8

Archive original Arduino development files (part 7)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +104 -0
  2. hardware/tools/avr/bin/avr-c++filt.exe +3 -0
  3. hardware/tools/avr/bin/avr-cpp.exe +3 -0
  4. hardware/tools/avr/bin/avr-elfedit.exe +0 -0
  5. hardware/tools/avr/bin/avr-gcc-ar.exe +0 -0
  6. hardware/tools/avr/bin/avr-gcc-nm.exe +0 -0
  7. hardware/tools/avr/bin/avr-gcc-ranlib.exe +0 -0
  8. hardware/tools/avr/bin/avr-gcc.exe +3 -0
  9. hardware/tools/avr/bin/avr-gcov-dump.exe +3 -0
  10. hardware/tools/avr/bin/avr-gcov-tool.exe +3 -0
  11. hardware/tools/avr/bin/avr-gcov.exe +3 -0
  12. hardware/tools/avr/bin/avr-gprof.exe +3 -0
  13. hardware/tools/avr/bin/avr-man +37 -0
  14. hardware/tools/avr/bin/avr-size.exe +3 -0
  15. hardware/tools/avr/bin/avr-strings.exe +3 -0
  16. hardware/tools/avr/bin/avrdude.exe +3 -0
  17. hardware/tools/avr/bin/giveio.sys +0 -0
  18. hardware/tools/avr/bin/install_giveio.bat +34 -0
  19. hardware/tools/avr/bin/libusb0.dll +0 -0
  20. hardware/tools/avr/bin/loaddrv.exe +0 -0
  21. hardware/tools/avr/bin/remove_giveio.bat +14 -0
  22. hardware/tools/avr/bin/status_giveio.bat +12 -0
  23. hardware/tools/avr/builtin_tools_versions.txt +3 -0
  24. hardware/tools/avr/etc/avrdude.conf +0 -0
  25. hardware/tools/avr/i686-w64-mingw32/avr/include/ansidecl.h +329 -0
  26. hardware/tools/avr/i686-w64-mingw32/avr/include/bfd.h +0 -0
  27. hardware/tools/avr/i686-w64-mingw32/avr/include/bfdlink.h +881 -0
  28. hardware/tools/avr/i686-w64-mingw32/avr/include/dis-asm.h +394 -0
  29. hardware/tools/avr/i686-w64-mingw32/avr/include/plugin-api.h +432 -0
  30. hardware/tools/avr/i686-w64-mingw32/avr/include/symcat.h +55 -0
  31. hardware/tools/avr/i686-w64-mingw32/avr/lib/libbfd.a +3 -0
  32. hardware/tools/avr/i686-w64-mingw32/avr/lib/libbfd.la +41 -0
  33. hardware/tools/avr/i686-w64-mingw32/avr/lib/libopcodes.a +0 -0
  34. hardware/tools/avr/i686-w64-mingw32/avr/lib/libopcodes.la +41 -0
  35. hardware/tools/avr/include/libiberty/demangle.h +685 -0
  36. hardware/tools/avr/include/libiberty/dyn-string.h +72 -0
  37. hardware/tools/avr/include/libiberty/fibheap.h +94 -0
  38. hardware/tools/avr/include/libiberty/floatformat.h +159 -0
  39. hardware/tools/avr/include/libiberty/hashtab.h +204 -0
  40. hardware/tools/avr/include/libiberty/libiberty.h +739 -0
  41. hardware/tools/avr/include/libiberty/objalloc.h +115 -0
  42. hardware/tools/avr/include/libiberty/partition.h +82 -0
  43. hardware/tools/avr/include/libiberty/safe-ctype.h +150 -0
  44. hardware/tools/avr/include/libiberty/sort.h +48 -0
  45. hardware/tools/avr/include/libiberty/splay-tree.h +156 -0
  46. hardware/tools/avr/include/libiberty/timeval-utils.h +40 -0
  47. hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/libgcc.a +3 -0
  48. hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/libgcov.a +3 -0
  49. hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/tiny-stack/libgcc.a +3 -0
  50. hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/tiny-stack/libgcov.a +3 -0
.gitattributes CHANGED
@@ -150,3 +150,107 @@ hardware/tools/avr/avr/lib/tiny-stack/libc.a filter=lfs diff=lfs merge=lfs -text
150
  hardware/tools/avr/bin/arduinoOTA.exe filter=lfs diff=lfs merge=lfs -text
151
  hardware/tools/avr/bin/avr-addr2line.exe filter=lfs diff=lfs merge=lfs -text
152
  hardware/tools/avr/bin/avr-c++.exe filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  hardware/tools/avr/bin/arduinoOTA.exe filter=lfs diff=lfs merge=lfs -text
151
  hardware/tools/avr/bin/avr-addr2line.exe filter=lfs diff=lfs merge=lfs -text
152
  hardware/tools/avr/bin/avr-c++.exe filter=lfs diff=lfs merge=lfs -text
153
+ hardware/tools/avr/bin/avr-c++filt.exe filter=lfs diff=lfs merge=lfs -text
154
+ hardware/tools/avr/bin/avr-cpp.exe filter=lfs diff=lfs merge=lfs -text
155
+ hardware/tools/avr/bin/avr-gcc.exe filter=lfs diff=lfs merge=lfs -text
156
+ hardware/tools/avr/bin/avr-gcov-dump.exe filter=lfs diff=lfs merge=lfs -text
157
+ hardware/tools/avr/bin/avr-gcov-tool.exe filter=lfs diff=lfs merge=lfs -text
158
+ hardware/tools/avr/bin/avr-gcov.exe filter=lfs diff=lfs merge=lfs -text
159
+ hardware/tools/avr/bin/avr-gprof.exe filter=lfs diff=lfs merge=lfs -text
160
+ hardware/tools/avr/bin/avr-size.exe filter=lfs diff=lfs merge=lfs -text
161
+ hardware/tools/avr/bin/avr-strings.exe filter=lfs diff=lfs merge=lfs -text
162
+ hardware/tools/avr/bin/avrdude.exe filter=lfs diff=lfs merge=lfs -text
163
+ hardware/tools/avr/i686-w64-mingw32/avr/lib/libbfd.a filter=lfs diff=lfs merge=lfs -text
164
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/libgcc.a filter=lfs diff=lfs merge=lfs -text
165
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/libgcov.a filter=lfs diff=lfs merge=lfs -text
166
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/tiny-stack/libgcc.a filter=lfs diff=lfs merge=lfs -text
167
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/tiny-stack/libgcov.a filter=lfs diff=lfs merge=lfs -text
168
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr3/libgcc.a filter=lfs diff=lfs merge=lfs -text
169
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr3/libgcov.a filter=lfs diff=lfs merge=lfs -text
170
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr31/libgcc.a filter=lfs diff=lfs merge=lfs -text
171
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr31/libgcov.a filter=lfs diff=lfs merge=lfs -text
172
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr35/libgcc.a filter=lfs diff=lfs merge=lfs -text
173
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr35/libgcov.a filter=lfs diff=lfs merge=lfs -text
174
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr4/libgcc.a filter=lfs diff=lfs merge=lfs -text
175
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr4/libgcov.a filter=lfs diff=lfs merge=lfs -text
176
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr5/libgcc.a filter=lfs diff=lfs merge=lfs -text
177
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr5/libgcov.a filter=lfs diff=lfs merge=lfs -text
178
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr51/libgcc.a filter=lfs diff=lfs merge=lfs -text
179
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr51/libgcov.a filter=lfs diff=lfs merge=lfs -text
180
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr6/libgcc.a filter=lfs diff=lfs merge=lfs -text
181
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avr6/libgcov.a filter=lfs diff=lfs merge=lfs -text
182
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega2/libgcc.a filter=lfs diff=lfs merge=lfs -text
183
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega2/libgcov.a filter=lfs diff=lfs merge=lfs -text
184
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega3/libgcc.a filter=lfs diff=lfs merge=lfs -text
185
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega3/libgcov.a filter=lfs diff=lfs merge=lfs -text
186
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega3/short-calls/libgcc.a filter=lfs diff=lfs merge=lfs -text
187
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega3/short-calls/libgcov.a filter=lfs diff=lfs merge=lfs -text
188
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega4/libgcc.a filter=lfs diff=lfs merge=lfs -text
189
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega4/libgcov.a filter=lfs diff=lfs merge=lfs -text
190
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega5/libgcc.a filter=lfs diff=lfs merge=lfs -text
191
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega5/libgcov.a filter=lfs diff=lfs merge=lfs -text
192
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega6/libgcc.a filter=lfs diff=lfs merge=lfs -text
193
+ hardware/tools/avr/lib/gcc/avr/7.3.0/avrxmega6/libgcov.a filter=lfs diff=lfs merge=lfs -text
194
+ hardware/tools/avr/lib/gcc/avr/7.3.0/libgcc.a filter=lfs diff=lfs merge=lfs -text
195
+ hardware/tools/avr/lib/gcc/avr/7.3.0/libgcov.a filter=lfs diff=lfs merge=lfs -text
196
+ hardware/tools/avr/lib/gcc/avr/7.3.0/tiny-stack/libgcc.a filter=lfs diff=lfs merge=lfs -text
197
+ hardware/tools/avr/lib/gcc/avr/7.3.0/tiny-stack/libgcov.a filter=lfs diff=lfs merge=lfs -text
198
+ hardware/tools/avr/lib/libiberty.a filter=lfs diff=lfs merge=lfs -text
199
+ hardware/tools/avr/libexec/gcc/avr/7.3.0/cc1.exe filter=lfs diff=lfs merge=lfs -text
200
+ hardware/tools/avr/libexec/gcc/avr/7.3.0/cc1plus.exe filter=lfs diff=lfs merge=lfs -text
201
+ hardware/tools/avr/libexec/gcc/avr/7.3.0/collect2.exe filter=lfs diff=lfs merge=lfs -text
202
+ hardware/tools/avr/libexec/gcc/avr/7.3.0/install-tools/fixincl.exe filter=lfs diff=lfs merge=lfs -text
203
+ hardware/tools/avr/libexec/gcc/avr/7.3.0/liblto_plugin-0.dll filter=lfs diff=lfs merge=lfs -text
204
+ hardware/tools/avr/libexec/gcc/avr/7.3.0/lto-wrapper.exe filter=lfs diff=lfs merge=lfs -text
205
+ hardware/tools/avr/libexec/gcc/avr/7.3.0/lto1.exe filter=lfs diff=lfs merge=lfs -text
206
+ java/bin/awt.dll filter=lfs diff=lfs merge=lfs -text
207
+ java/bin/client/jvm.dll filter=lfs diff=lfs merge=lfs -text
208
+ java/bin/concrt140.dll filter=lfs diff=lfs merge=lfs -text
209
+ java/bin/dcpr.dll filter=lfs diff=lfs merge=lfs -text
210
+ java/bin/deploy.dll filter=lfs diff=lfs merge=lfs -text
211
+ java/bin/dtplugin/deployJava1.dll filter=lfs diff=lfs merge=lfs -text
212
+ java/bin/dtplugin/npdeployJava1.dll filter=lfs diff=lfs merge=lfs -text
213
+ java/bin/eula.dll filter=lfs diff=lfs merge=lfs -text
214
+ java/bin/fontmanager.dll filter=lfs diff=lfs merge=lfs -text
215
+ java/bin/fxplugins.dll filter=lfs diff=lfs merge=lfs -text
216
+ java/bin/glass.dll filter=lfs diff=lfs merge=lfs -text
217
+ java/bin/glib-lite.dll filter=lfs diff=lfs merge=lfs -text
218
+ java/bin/gstreamer-lite.dll filter=lfs diff=lfs merge=lfs -text
219
+ java/bin/hprof.dll filter=lfs diff=lfs merge=lfs -text
220
+ java/bin/instrument.dll filter=lfs diff=lfs merge=lfs -text
221
+ java/bin/java.dll filter=lfs diff=lfs merge=lfs -text
222
+ java/bin/java.exe filter=lfs diff=lfs merge=lfs -text
223
+ java/bin/JavaAccessBridge-32.dll filter=lfs diff=lfs merge=lfs -text
224
+ java/bin/JavaAccessBridge.dll filter=lfs diff=lfs merge=lfs -text
225
+ java/bin/javacpl.cpl filter=lfs diff=lfs merge=lfs -text
226
+ java/bin/javafx_font_t2k.dll filter=lfs diff=lfs merge=lfs -text
227
+ java/bin/javafx_iio.dll filter=lfs diff=lfs merge=lfs -text
228
+ java/bin/javaw.exe filter=lfs diff=lfs merge=lfs -text
229
+ java/bin/javaws.exe filter=lfs diff=lfs merge=lfs -text
230
+ java/bin/jdwp.dll filter=lfs diff=lfs merge=lfs -text
231
+ java/bin/jfxmedia.dll filter=lfs diff=lfs merge=lfs -text
232
+ java/bin/jfxwebkit.dll filter=lfs diff=lfs merge=lfs -text
233
+ java/bin/jli.dll filter=lfs diff=lfs merge=lfs -text
234
+ java/bin/jp2iexp.dll filter=lfs diff=lfs merge=lfs -text
235
+ java/bin/jp2ssv.dll filter=lfs diff=lfs merge=lfs -text
236
+ java/bin/jpeg.dll filter=lfs diff=lfs merge=lfs -text
237
+ java/bin/kcms.dll filter=lfs diff=lfs merge=lfs -text
238
+ java/bin/lcms.dll filter=lfs diff=lfs merge=lfs -text
239
+ java/bin/mlib_image.dll filter=lfs diff=lfs merge=lfs -text
240
+ java/bin/msvcp140.dll filter=lfs diff=lfs merge=lfs -text
241
+ java/bin/msvcr100.dll filter=lfs diff=lfs merge=lfs -text
242
+ java/bin/plugin2/npjp2.dll filter=lfs diff=lfs merge=lfs -text
243
+ java/bin/prism_d3d.dll filter=lfs diff=lfs merge=lfs -text
244
+ java/bin/splashscreen.dll filter=lfs diff=lfs merge=lfs -text
245
+ java/bin/ssv.dll filter=lfs diff=lfs merge=lfs -text
246
+ java/bin/sunec.dll filter=lfs diff=lfs merge=lfs -text
247
+ java/bin/t2k.dll filter=lfs diff=lfs merge=lfs -text
248
+ java/bin/ucrtbase.dll filter=lfs diff=lfs merge=lfs -text
249
+ java/bin/unpack200.exe filter=lfs diff=lfs merge=lfs -text
250
+ java/bin/wsdetect.dll filter=lfs diff=lfs merge=lfs -text
251
+ java/lib/charsets.jar filter=lfs diff=lfs merge=lfs -text
252
+ java/lib/cmm/PYCC.pf filter=lfs diff=lfs merge=lfs -text
253
+ java/lib/deploy.jar filter=lfs diff=lfs merge=lfs -text
254
+ java/lib/ext/access-bridge-32.jar filter=lfs diff=lfs merge=lfs -text
255
+ java/lib/ext/access-bridge.jar filter=lfs diff=lfs merge=lfs -text
256
+ java/lib/ext/cldrdata.jar filter=lfs diff=lfs merge=lfs -text
hardware/tools/avr/bin/avr-c++filt.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:de32fc5cd0de072bf358689f35362a05cfd68164b1d5220a2e81b35b64d52bcd
3
+ size 605696
hardware/tools/avr/bin/avr-cpp.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bee5ae89bb60a87dc957ac11cd7169988b66000d68b4d0085a9890d22dc65651
3
+ size 876032
hardware/tools/avr/bin/avr-elfedit.exe ADDED
Binary file (35.8 kB). View file
 
hardware/tools/avr/bin/avr-gcc-ar.exe ADDED
Binary file (52.7 kB). View file
 
hardware/tools/avr/bin/avr-gcc-nm.exe ADDED
Binary file (52.7 kB). View file
 
hardware/tools/avr/bin/avr-gcc-ranlib.exe ADDED
Binary file (53.2 kB). View file
 
hardware/tools/avr/bin/avr-gcc.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d3a9a093afbd132302e430e4c88bbacccb0490ebf730f626b74662dc2460307b
3
+ size 874496
hardware/tools/avr/bin/avr-gcov-dump.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7f058299bdcd287d0bd8990ad9bfbed583738e205c344a93457b0838d0527565
3
+ size 438272
hardware/tools/avr/bin/avr-gcov-tool.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ab0075f4a92b8950cab0dd24da0e48f32e9c32b4eed18a1b251bd58883147da7
3
+ size 483328
hardware/tools/avr/bin/avr-gcov.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:639cdb3fa5e79f83cbbbafffc2b86c85b15c4d07a22e8274843eeddd902b17bb
3
+ size 523776
hardware/tools/avr/bin/avr-gprof.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c63499172764b35b11f9b03f72eddd514fe20a23f2ec0e02a486d9ff8031740
3
+ size 667648
hardware/tools/avr/bin/avr-man ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #! /bin/sh
2
+
3
+ # Copyright (c) 2004, Joerg Wunsch
4
+ # All rights reserved.
5
+ #
6
+ # Redistribution and use in source and binary forms, with or without
7
+ # modification, are permitted provided that the following conditions are met:
8
+ #
9
+ # * Redistributions of source code must retain the above copyright
10
+ # notice, this list of conditions and the following disclaimer.
11
+ # * Redistributions in binary form must reproduce the above copyright
12
+ # notice, this list of conditions and the following disclaimer in
13
+ # the documentation and/or other materials provided with the
14
+ # distribution.
15
+ # * Neither the name of the copyright holders nor the names of
16
+ # contributors may be used to endorse or promote products derived
17
+ # from this software without specific prior written permission.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
+ # POSSIBILITY OF SUCH DAMAGE.
30
+
31
+ ## man(1) replacement to access the avr-libc manual pages
32
+
33
+ : ${DESTDIR:-}
34
+ prefix=/home/jenkins-mingw32/workspace/avr-gcc-staging/label/Ubuntu14.04x64-mingw32/objdir
35
+ datadir=/home/jenkins-mingw32/workspace/avr-gcc-staging/label/Ubuntu14.04x64-mingw32/objdir/share
36
+
37
+ exec man -M /home/jenkins-mingw32/workspace/avr-gcc-staging/label/Ubuntu14.04x64-mingw32/objdir/share/doc/avr-libc-2.0.0/man "$@"
hardware/tools/avr/bin/avr-size.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:caf3b7005c4aee1ac99254b62fb5d4be13912c21d9a750745c859e80000a9590
3
+ size 616448
hardware/tools/avr/bin/avr-strings.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a9f9427d0f07aa5dfa9cd057cdac39889a40decdc5767b042394689010af411
3
+ size 608256
hardware/tools/avr/bin/avrdude.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b77b5409f89090f836427948980862200a88fd7900d65442e43f0c966cd82653
3
+ size 562688
hardware/tools/avr/bin/giveio.sys ADDED
Binary file (5.25 kB). View file
 
hardware/tools/avr/bin/install_giveio.bat ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @set DIRVERNAME=giveio
2
+ @set DIRVERFILE=%DIRVERNAME%.sys
3
+
4
+ @echo Copying the driver to the windows directory
5
+ @echo target file: %WINDIR%\%DIRVERFILE%
6
+ @copy %DIRVERFILE% %WINDIR%\%DIRVERFILE%
7
+
8
+ @echo Remove a running service if needed...
9
+ @loaddrv stop %DIRVERNAME% >NUL
10
+ @if errorlevel 2 goto install
11
+
12
+ @loaddrv remove %DIRVERNAME% >NUL
13
+ @if errorlevel 1 goto install
14
+
15
+ :install
16
+ @echo Installing Windows NT/2k/XP driver: %DIRVERNAME%
17
+
18
+ @loaddrv install %DIRVERNAME% %WINDIR%\%DIRVERFILE%
19
+ @if errorlevel 3 goto error
20
+
21
+ @loaddrv start %DIRVERNAME%
22
+ @if errorlevel 1 goto error
23
+
24
+ @loaddrv starttype %DIRVERNAME% auto
25
+ @if errorlevel 1 goto error
26
+
27
+ @echo Success
28
+ @goto exit
29
+
30
+ :error
31
+ @echo ERROR: Installation of %DIRVERNAME% failed
32
+
33
+ :exit
34
+
hardware/tools/avr/bin/libusb0.dll ADDED
Binary file (67.7 kB). View file
 
hardware/tools/avr/bin/loaddrv.exe ADDED
Binary file (17.4 kB). View file
 
hardware/tools/avr/bin/remove_giveio.bat ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @set DIRVERNAME=giveio
2
+
3
+ @loaddrv stop %DIRVERNAME%
4
+ @if errorlevel 2 goto error
5
+
6
+ @loaddrv remove %DIRVERNAME%
7
+ @if errorlevel 1 goto error
8
+
9
+ @goto exit
10
+
11
+ :error
12
+ @echo ERROR: Deinstallation of %DIRVERNAME% failed
13
+
14
+ :exit
hardware/tools/avr/bin/status_giveio.bat ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @set DIRVERNAME=giveio
2
+
3
+ @loaddrv status %DIRVERNAME%
4
+ @if errorlevel 1 goto error
5
+
6
+ @goto exit
7
+
8
+ :error
9
+ @echo ERROR: Status querry for %DIRVERNAME% failed
10
+
11
+ :exit
12
+
hardware/tools/avr/builtin_tools_versions.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ arduino.avrdude=6.3.0-arduino17
2
+ arduino.arduinoOTA=1.3.0
3
+ arduino.avr-gcc=7.3.0-atmel3.6.1-arduino7
hardware/tools/avr/etc/avrdude.conf ADDED
The diff for this file is too large to render. See raw diff
 
hardware/tools/avr/i686-w64-mingw32/avr/include/ansidecl.h ADDED
@@ -0,0 +1,329 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* ANSI and traditional C compatability macros
2
+ Copyright (C) 1991-2015 Free Software Foundation, Inc.
3
+ This file is part of the GNU C Library.
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
18
+
19
+ /* ANSI and traditional C compatibility macros
20
+
21
+ ANSI C is assumed if __STDC__ is #defined.
22
+
23
+ Macro ANSI C definition Traditional C definition
24
+ ----- ---- - ---------- ----------- - ----------
25
+ PTR `void *' `char *'
26
+ const not defined `'
27
+ volatile not defined `'
28
+ signed not defined `'
29
+
30
+ For ease of writing code which uses GCC extensions but needs to be
31
+ portable to other compilers, we provide the GCC_VERSION macro that
32
+ simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
33
+ wrappers around __attribute__. Also, __extension__ will be #defined
34
+ to nothing if it doesn't work. See below. */
35
+
36
+ #ifndef _ANSIDECL_H
37
+ #define _ANSIDECL_H 1
38
+
39
+ #ifdef __cplusplus
40
+ extern "C" {
41
+ #endif
42
+
43
+ /* Every source file includes this file,
44
+ so they will all get the switch for lint. */
45
+ /* LINTLIBRARY */
46
+
47
+ /* Using MACRO(x,y) in cpp #if conditionals does not work with some
48
+ older preprocessors. Thus we can't define something like this:
49
+
50
+ #define HAVE_GCC_VERSION(MAJOR, MINOR) \
51
+ (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
52
+
53
+ and then test "#if HAVE_GCC_VERSION(2,7)".
54
+
55
+ So instead we use the macro below and test it against specific values. */
56
+
57
+ /* This macro simplifies testing whether we are using gcc, and if it
58
+ is of a particular minimum version. (Both major & minor numbers are
59
+ significant.) This macro will evaluate to 0 if we are not using
60
+ gcc at all. */
61
+ #ifndef GCC_VERSION
62
+ #define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
63
+ #endif /* GCC_VERSION */
64
+
65
+ #if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
66
+ /* All known AIX compilers implement these things (but don't always
67
+ define __STDC__). The RISC/OS MIPS compiler defines these things
68
+ in SVR4 mode, but does not define __STDC__. */
69
+ /* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
70
+ C++ compilers, does not define __STDC__, though it acts as if this
71
+ was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
72
+
73
+ #define PTR void *
74
+
75
+ #undef const
76
+ #undef volatile
77
+ #undef signed
78
+
79
+ /* inline requires special treatment; it's in C99, and GCC >=2.7 supports
80
+ it too, but it's not in C89. */
81
+ #undef inline
82
+ #if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__))
83
+ /* it's a keyword */
84
+ #else
85
+ # if GCC_VERSION >= 2007
86
+ # define inline __inline__ /* __inline__ prevents -pedantic warnings */
87
+ # else
88
+ # define inline /* nothing */
89
+ # endif
90
+ #endif
91
+
92
+ #else /* Not ANSI C. */
93
+
94
+ #define PTR char *
95
+
96
+ /* some systems define these in header files for non-ansi mode */
97
+ #undef const
98
+ #undef volatile
99
+ #undef signed
100
+ #undef inline
101
+ #define const
102
+ #define volatile
103
+ #define signed
104
+ #define inline
105
+
106
+ #endif /* ANSI C. */
107
+
108
+ /* Define macros for some gcc attributes. This permits us to use the
109
+ macros freely, and know that they will come into play for the
110
+ version of gcc in which they are supported. */
111
+
112
+ #if (GCC_VERSION < 2007)
113
+ # define __attribute__(x)
114
+ #endif
115
+
116
+ /* Attribute __malloc__ on functions was valid as of gcc 2.96. */
117
+ #ifndef ATTRIBUTE_MALLOC
118
+ # if (GCC_VERSION >= 2096)
119
+ # define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
120
+ # else
121
+ # define ATTRIBUTE_MALLOC
122
+ # endif /* GNUC >= 2.96 */
123
+ #endif /* ATTRIBUTE_MALLOC */
124
+
125
+ /* Attributes on labels were valid as of gcc 2.93 and g++ 4.5. For
126
+ g++ an attribute on a label must be followed by a semicolon. */
127
+ #ifndef ATTRIBUTE_UNUSED_LABEL
128
+ # ifndef __cplusplus
129
+ # if GCC_VERSION >= 2093
130
+ # define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
131
+ # else
132
+ # define ATTRIBUTE_UNUSED_LABEL
133
+ # endif
134
+ # else
135
+ # if GCC_VERSION >= 4005
136
+ # define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED ;
137
+ # else
138
+ # define ATTRIBUTE_UNUSED_LABEL
139
+ # endif
140
+ # endif
141
+ #endif
142
+
143
+ /* Similarly to ARG_UNUSED below. Prior to GCC 3.4, the C++ frontend
144
+ couldn't parse attributes placed after the identifier name, and now
145
+ the entire compiler is built with C++. */
146
+ #ifndef ATTRIBUTE_UNUSED
147
+ #if GCC_VERSION >= 3004
148
+ # define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
149
+ #else
150
+ #define ATTRIBUTE_UNUSED
151
+ #endif
152
+ #endif /* ATTRIBUTE_UNUSED */
153
+
154
+ /* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the
155
+ identifier name. */
156
+ #if ! defined(__cplusplus) || (GCC_VERSION >= 3004)
157
+ # define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED
158
+ #else /* !__cplusplus || GNUC >= 3.4 */
159
+ # define ARG_UNUSED(NAME) NAME
160
+ #endif /* !__cplusplus || GNUC >= 3.4 */
161
+
162
+ #ifndef ATTRIBUTE_NORETURN
163
+ #define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
164
+ #endif /* ATTRIBUTE_NORETURN */
165
+
166
+ /* Attribute `nonnull' was valid as of gcc 3.3. */
167
+ #ifndef ATTRIBUTE_NONNULL
168
+ # if (GCC_VERSION >= 3003)
169
+ # define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
170
+ # else
171
+ # define ATTRIBUTE_NONNULL(m)
172
+ # endif /* GNUC >= 3.3 */
173
+ #endif /* ATTRIBUTE_NONNULL */
174
+
175
+ /* Attribute `returns_nonnull' was valid as of gcc 4.9. */
176
+ #ifndef ATTRIBUTE_RETURNS_NONNULL
177
+ # if (GCC_VERSION >= 4009)
178
+ # define ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
179
+ # else
180
+ # define ATTRIBUTE_RETURNS_NONNULL
181
+ # endif /* GNUC >= 4.9 */
182
+ #endif /* ATTRIBUTE_RETURNS_NONNULL */
183
+
184
+ /* Attribute `pure' was valid as of gcc 3.0. */
185
+ #ifndef ATTRIBUTE_PURE
186
+ # if (GCC_VERSION >= 3000)
187
+ # define ATTRIBUTE_PURE __attribute__ ((__pure__))
188
+ # else
189
+ # define ATTRIBUTE_PURE
190
+ # endif /* GNUC >= 3.0 */
191
+ #endif /* ATTRIBUTE_PURE */
192
+
193
+ /* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL.
194
+ This was the case for the `printf' format attribute by itself
195
+ before GCC 3.3, but as of 3.3 we need to add the `nonnull'
196
+ attribute to retain this behavior. */
197
+ #ifndef ATTRIBUTE_PRINTF
198
+ #define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)
199
+ #define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
200
+ #define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
201
+ #define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
202
+ #define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
203
+ #define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
204
+ #endif /* ATTRIBUTE_PRINTF */
205
+
206
+ /* Use ATTRIBUTE_FPTR_PRINTF when the format attribute is to be set on
207
+ a function pointer. Format attributes were allowed on function
208
+ pointers as of gcc 3.1. */
209
+ #ifndef ATTRIBUTE_FPTR_PRINTF
210
+ # if (GCC_VERSION >= 3001)
211
+ # define ATTRIBUTE_FPTR_PRINTF(m, n) ATTRIBUTE_PRINTF(m, n)
212
+ # else
213
+ # define ATTRIBUTE_FPTR_PRINTF(m, n)
214
+ # endif /* GNUC >= 3.1 */
215
+ # define ATTRIBUTE_FPTR_PRINTF_1 ATTRIBUTE_FPTR_PRINTF(1, 2)
216
+ # define ATTRIBUTE_FPTR_PRINTF_2 ATTRIBUTE_FPTR_PRINTF(2, 3)
217
+ # define ATTRIBUTE_FPTR_PRINTF_3 ATTRIBUTE_FPTR_PRINTF(3, 4)
218
+ # define ATTRIBUTE_FPTR_PRINTF_4 ATTRIBUTE_FPTR_PRINTF(4, 5)
219
+ # define ATTRIBUTE_FPTR_PRINTF_5 ATTRIBUTE_FPTR_PRINTF(5, 6)
220
+ #endif /* ATTRIBUTE_FPTR_PRINTF */
221
+
222
+ /* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A
223
+ NULL format specifier was allowed as of gcc 3.3. */
224
+ #ifndef ATTRIBUTE_NULL_PRINTF
225
+ # if (GCC_VERSION >= 3003)
226
+ # define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
227
+ # else
228
+ # define ATTRIBUTE_NULL_PRINTF(m, n)
229
+ # endif /* GNUC >= 3.3 */
230
+ # define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2)
231
+ # define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3)
232
+ # define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4)
233
+ # define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5)
234
+ # define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
235
+ #endif /* ATTRIBUTE_NULL_PRINTF */
236
+
237
+ /* Attribute `sentinel' was valid as of gcc 3.5. */
238
+ #ifndef ATTRIBUTE_SENTINEL
239
+ # if (GCC_VERSION >= 3005)
240
+ # define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
241
+ # else
242
+ # define ATTRIBUTE_SENTINEL
243
+ # endif /* GNUC >= 3.5 */
244
+ #endif /* ATTRIBUTE_SENTINEL */
245
+
246
+
247
+ #ifndef ATTRIBUTE_ALIGNED_ALIGNOF
248
+ # if (GCC_VERSION >= 3000)
249
+ # define ATTRIBUTE_ALIGNED_ALIGNOF(m) __attribute__ ((__aligned__ (__alignof__ (m))))
250
+ # else
251
+ # define ATTRIBUTE_ALIGNED_ALIGNOF(m)
252
+ # endif /* GNUC >= 3.0 */
253
+ #endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
254
+
255
+ /* Useful for structures whose layout must much some binary specification
256
+ regardless of the alignment and padding qualities of the compiler. */
257
+ #ifndef ATTRIBUTE_PACKED
258
+ # define ATTRIBUTE_PACKED __attribute__ ((packed))
259
+ #endif
260
+
261
+ /* Attribute `hot' and `cold' was valid as of gcc 4.3. */
262
+ #ifndef ATTRIBUTE_COLD
263
+ # if (GCC_VERSION >= 4003)
264
+ # define ATTRIBUTE_COLD __attribute__ ((__cold__))
265
+ # else
266
+ # define ATTRIBUTE_COLD
267
+ # endif /* GNUC >= 4.3 */
268
+ #endif /* ATTRIBUTE_COLD */
269
+ #ifndef ATTRIBUTE_HOT
270
+ # if (GCC_VERSION >= 4003)
271
+ # define ATTRIBUTE_HOT __attribute__ ((__hot__))
272
+ # else
273
+ # define ATTRIBUTE_HOT
274
+ # endif /* GNUC >= 4.3 */
275
+ #endif /* ATTRIBUTE_HOT */
276
+
277
+ /* Attribute 'no_sanitize_undefined' was valid as of gcc 4.9. */
278
+ #ifndef ATTRIBUTE_NO_SANITIZE_UNDEFINED
279
+ # if (GCC_VERSION >= 4009)
280
+ # define ATTRIBUTE_NO_SANITIZE_UNDEFINED __attribute__ ((no_sanitize_undefined))
281
+ # else
282
+ # define ATTRIBUTE_NO_SANITIZE_UNDEFINED
283
+ # endif /* GNUC >= 4.9 */
284
+ #endif /* ATTRIBUTE_NO_SANITIZE_UNDEFINED */
285
+
286
+ /* We use __extension__ in some places to suppress -pedantic warnings
287
+ about GCC extensions. This feature didn't work properly before
288
+ gcc 2.8. */
289
+ #if GCC_VERSION < 2008
290
+ #define __extension__
291
+ #endif
292
+
293
+ /* This is used to declare a const variable which should be visible
294
+ outside of the current compilation unit. Use it as
295
+ EXPORTED_CONST int i = 1;
296
+ This is because the semantics of const are different in C and C++.
297
+ "extern const" is permitted in C but it looks strange, and gcc
298
+ warns about it when -Wc++-compat is not used. */
299
+ #ifdef __cplusplus
300
+ #define EXPORTED_CONST extern const
301
+ #else
302
+ #define EXPORTED_CONST const
303
+ #endif
304
+
305
+ /* Be conservative and only use enum bitfields with C++ or GCC.
306
+ FIXME: provide a complete autoconf test for buggy enum bitfields. */
307
+
308
+ #ifdef __cplusplus
309
+ #define ENUM_BITFIELD(TYPE) enum TYPE
310
+ #elif (GCC_VERSION > 2000)
311
+ #define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
312
+ #else
313
+ #define ENUM_BITFIELD(TYPE) unsigned int
314
+ #endif
315
+
316
+ /* This is used to mark a class or virtual function as final. */
317
+ #if __cplusplus >= 201103L
318
+ #define GCC_FINAL final
319
+ #elif GCC_VERSION >= 4007
320
+ #define GCC_FINAL __final
321
+ #else
322
+ #define GCC_FINAL
323
+ #endif
324
+
325
+ #ifdef __cplusplus
326
+ }
327
+ #endif
328
+
329
+ #endif /* ansidecl.h */
hardware/tools/avr/i686-w64-mingw32/avr/include/bfd.h ADDED
The diff for this file is too large to render. See raw diff
 
hardware/tools/avr/i686-w64-mingw32/avr/include/bfdlink.h ADDED
@@ -0,0 +1,881 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* bfdlink.h -- header file for BFD link routines
2
+ Copyright (C) 1993-2015 Free Software Foundation, Inc.
3
+ Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support.
4
+
5
+ This file is part of BFD, the Binary File Descriptor library.
6
+
7
+ This program is free software; you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation; either version 3 of the License, or
10
+ (at your option) any later version.
11
+
12
+ This program is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with this program; if not, write to the Free Software
19
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
20
+ MA 02110-1301, USA. */
21
+
22
+ #ifndef BFDLINK_H
23
+ #define BFDLINK_H
24
+
25
+ /* Which symbols to strip during a link. */
26
+ enum bfd_link_strip
27
+ {
28
+ strip_none, /* Don't strip any symbols. */
29
+ strip_debugger, /* Strip debugging symbols. */
30
+ strip_some, /* keep_hash is the list of symbols to keep. */
31
+ strip_all /* Strip all symbols. */
32
+ };
33
+
34
+ /* Which local symbols to discard during a link. This is irrelevant
35
+ if strip_all is used. */
36
+ enum bfd_link_discard
37
+ {
38
+ discard_sec_merge, /* Discard local temporary symbols in SEC_MERGE
39
+ sections. */
40
+ discard_none, /* Don't discard any locals. */
41
+ discard_l, /* Discard local temporary symbols. */
42
+ discard_all /* Discard all locals. */
43
+ };
44
+
45
+ /* Describes the type of hash table entry structure being used.
46
+ Different hash table structure have different fields and so
47
+ support different linking features. */
48
+ enum bfd_link_hash_table_type
49
+ {
50
+ bfd_link_generic_hash_table,
51
+ bfd_link_elf_hash_table
52
+ };
53
+
54
+ /* These are the possible types of an entry in the BFD link hash
55
+ table. */
56
+
57
+ enum bfd_link_hash_type
58
+ {
59
+ bfd_link_hash_new, /* Symbol is new. */
60
+ bfd_link_hash_undefined, /* Symbol seen before, but undefined. */
61
+ bfd_link_hash_undefweak, /* Symbol is weak and undefined. */
62
+ bfd_link_hash_defined, /* Symbol is defined. */
63
+ bfd_link_hash_defweak, /* Symbol is weak and defined. */
64
+ bfd_link_hash_common, /* Symbol is common. */
65
+ bfd_link_hash_indirect, /* Symbol is an indirect link. */
66
+ bfd_link_hash_warning /* Like indirect, but warn if referenced. */
67
+ };
68
+
69
+ enum bfd_link_common_skip_ar_symbols
70
+ {
71
+ bfd_link_common_skip_none,
72
+ bfd_link_common_skip_text,
73
+ bfd_link_common_skip_data,
74
+ bfd_link_common_skip_all
75
+ };
76
+
77
+ struct bfd_link_hash_common_entry
78
+ {
79
+ unsigned int alignment_power; /* Alignment. */
80
+ asection *section; /* Symbol section. */
81
+ };
82
+
83
+ /* The linking routines use a hash table which uses this structure for
84
+ its elements. */
85
+
86
+ struct bfd_link_hash_entry
87
+ {
88
+ /* Base hash table entry structure. */
89
+ struct bfd_hash_entry root;
90
+
91
+ /* Type of this entry. */
92
+ ENUM_BITFIELD (bfd_link_hash_type) type : 8;
93
+
94
+ /* Symbol is referenced in a normal object file, as distict from a LTO
95
+ IR object file. */
96
+ unsigned int non_ir_ref : 1;
97
+
98
+ /* Symbol is a built-in define. These will be overridden by PROVIDE
99
+ in a linker script. */
100
+ unsigned int linker_def : 1;
101
+
102
+ /* A union of information depending upon the type. */
103
+ union
104
+ {
105
+ /* Nothing is kept for bfd_hash_new. */
106
+ /* bfd_link_hash_undefined, bfd_link_hash_undefweak. */
107
+ struct
108
+ {
109
+ /* Undefined and common symbols are kept in a linked list through
110
+ this field. This field is present in all of the union element
111
+ so that we don't need to remove entries from the list when we
112
+ change their type. Removing entries would either require the
113
+ list to be doubly linked, which would waste more memory, or
114
+ require a traversal. When an undefined or common symbol is
115
+ created, it should be added to this list, the head of which is in
116
+ the link hash table itself. As symbols are defined, they need
117
+ not be removed from the list; anything which reads the list must
118
+ doublecheck the symbol type.
119
+
120
+ Weak symbols are not kept on this list.
121
+
122
+ Defined and defweak symbols use this field as a reference marker.
123
+ If the field is not NULL, or this structure is the tail of the
124
+ undefined symbol list, the symbol has been referenced. If the
125
+ symbol is undefined and becomes defined, this field will
126
+ automatically be non-NULL since the symbol will have been on the
127
+ undefined symbol list. */
128
+ struct bfd_link_hash_entry *next;
129
+ bfd *abfd; /* BFD symbol was found in. */
130
+ } undef;
131
+ /* bfd_link_hash_defined, bfd_link_hash_defweak. */
132
+ struct
133
+ {
134
+ struct bfd_link_hash_entry *next;
135
+ asection *section; /* Symbol section. */
136
+ bfd_vma value; /* Symbol value. */
137
+ } def;
138
+ /* bfd_link_hash_indirect, bfd_link_hash_warning. */
139
+ struct
140
+ {
141
+ struct bfd_link_hash_entry *next;
142
+ struct bfd_link_hash_entry *link; /* Real symbol. */
143
+ const char *warning; /* Warning (bfd_link_hash_warning only). */
144
+ } i;
145
+ /* bfd_link_hash_common. */
146
+ struct
147
+ {
148
+ struct bfd_link_hash_entry *next;
149
+ /* The linker needs to know three things about common
150
+ symbols: the size, the alignment, and the section in
151
+ which the symbol should be placed. We store the size
152
+ here, and we allocate a small structure to hold the
153
+ section and the alignment. The alignment is stored as a
154
+ power of two. We don't store all the information
155
+ directly because we don't want to increase the size of
156
+ the union; this structure is a major space user in the
157
+ linker. */
158
+ struct bfd_link_hash_common_entry *p;
159
+ bfd_size_type size; /* Common symbol size. */
160
+ } c;
161
+ } u;
162
+ };
163
+
164
+ /* This is the link hash table. It is a derived class of
165
+ bfd_hash_table. */
166
+
167
+ struct bfd_link_hash_table
168
+ {
169
+ /* The hash table itself. */
170
+ struct bfd_hash_table table;
171
+ /* A linked list of undefined and common symbols, linked through the
172
+ next field in the bfd_link_hash_entry structure. */
173
+ struct bfd_link_hash_entry *undefs;
174
+ /* Entries are added to the tail of the undefs list. */
175
+ struct bfd_link_hash_entry *undefs_tail;
176
+ /* Function to free the hash table on closing BFD. */
177
+ void (*hash_table_free) (bfd *);
178
+ /* The type of the link hash table. */
179
+ enum bfd_link_hash_table_type type;
180
+ };
181
+
182
+ /* Look up an entry in a link hash table. If FOLLOW is TRUE, this
183
+ follows bfd_link_hash_indirect and bfd_link_hash_warning links to
184
+ the real symbol. */
185
+ extern struct bfd_link_hash_entry *bfd_link_hash_lookup
186
+ (struct bfd_link_hash_table *, const char *, bfd_boolean create,
187
+ bfd_boolean copy, bfd_boolean follow);
188
+
189
+ /* Look up an entry in the main linker hash table if the symbol might
190
+ be wrapped. This should only be used for references to an
191
+ undefined symbol, not for definitions of a symbol. */
192
+
193
+ extern struct bfd_link_hash_entry *bfd_wrapped_link_hash_lookup
194
+ (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
195
+ bfd_boolean, bfd_boolean);
196
+
197
+ /* If H is a wrapped symbol, ie. the symbol name starts with "__wrap_"
198
+ and the remainder is found in wrap_hash, return the real symbol. */
199
+
200
+ extern struct bfd_link_hash_entry *unwrap_hash_lookup
201
+ (struct bfd_link_info *, bfd *, struct bfd_link_hash_entry *);
202
+
203
+ /* Traverse a link hash table. */
204
+ extern void bfd_link_hash_traverse
205
+ (struct bfd_link_hash_table *,
206
+ bfd_boolean (*) (struct bfd_link_hash_entry *, void *),
207
+ void *);
208
+
209
+ /* Add an entry to the undefs list. */
210
+ extern void bfd_link_add_undef
211
+ (struct bfd_link_hash_table *, struct bfd_link_hash_entry *);
212
+
213
+ /* Remove symbols from the undefs list that don't belong there. */
214
+ extern void bfd_link_repair_undef_list
215
+ (struct bfd_link_hash_table *table);
216
+
217
+ /* Read symbols and cache symbol pointer array in outsymbols. */
218
+ extern bfd_boolean bfd_generic_link_read_symbols (bfd *);
219
+
220
+ struct bfd_sym_chain
221
+ {
222
+ struct bfd_sym_chain *next;
223
+ const char *name;
224
+ };
225
+
226
+ /* How to handle unresolved symbols.
227
+ There are four possibilities which are enumerated below: */
228
+ enum report_method
229
+ {
230
+ /* This is the initial value when then link_info structure is created.
231
+ It allows the various stages of the linker to determine whether they
232
+ allowed to set the value. */
233
+ RM_NOT_YET_SET = 0,
234
+ RM_IGNORE,
235
+ RM_GENERATE_WARNING,
236
+ RM_GENERATE_ERROR
237
+ };
238
+
239
+ typedef enum {with_flags, without_flags} flag_type;
240
+
241
+ /* A section flag list. */
242
+ struct flag_info_list
243
+ {
244
+ flag_type with;
245
+ const char *name;
246
+ bfd_boolean valid;
247
+ struct flag_info_list *next;
248
+ };
249
+
250
+ /* Section flag info. */
251
+ struct flag_info
252
+ {
253
+ flagword only_with_flags;
254
+ flagword not_with_flags;
255
+ struct flag_info_list *flag_list;
256
+ bfd_boolean flags_initialized;
257
+ };
258
+
259
+ struct bfd_elf_dynamic_list;
260
+ struct bfd_elf_version_tree;
261
+
262
+ /* Types of output. */
263
+
264
+ enum output_type
265
+ {
266
+ type_pde,
267
+ type_pie,
268
+ type_relocatable,
269
+ type_dll,
270
+ };
271
+
272
+ #define bfd_link_pde(info) ((info)->type == type_pde)
273
+ #define bfd_link_dll(info) ((info)->type == type_dll)
274
+ #define bfd_link_relocatable(info) ((info)->type == type_relocatable)
275
+ #define bfd_link_pie(info) ((info)->type == type_pie)
276
+ #define bfd_link_executable(info) (bfd_link_pde (info) || bfd_link_pie (info))
277
+ #define bfd_link_pic(info) (bfd_link_dll (info) || bfd_link_pie (info))
278
+
279
+ /* This structure holds all the information needed to communicate
280
+ between BFD and the linker when doing a link. */
281
+
282
+ struct bfd_link_info
283
+ {
284
+ /* Output type. */
285
+ ENUM_BITFIELD (output_type) type : 2;
286
+
287
+ /* TRUE if BFD should pre-bind symbols in a shared object. */
288
+ unsigned int symbolic: 1;
289
+
290
+ /* TRUE if executable should not contain copy relocs.
291
+ Setting this true may result in a non-sharable text segment. */
292
+ unsigned int nocopyreloc: 1;
293
+
294
+ /* TRUE if BFD should export all symbols in the dynamic symbol table
295
+ of an executable, rather than only those used. */
296
+ unsigned int export_dynamic: 1;
297
+
298
+ /* TRUE if a default symbol version should be created and used for
299
+ exported symbols. */
300
+ unsigned int create_default_symver: 1;
301
+
302
+ /* TRUE if unreferenced sections should be removed. */
303
+ unsigned int gc_sections: 1;
304
+
305
+ /* TRUE if every symbol should be reported back via the notice
306
+ callback. */
307
+ unsigned int notice_all: 1;
308
+
309
+ /* TRUE if the LTO plugin is active. */
310
+ unsigned int lto_plugin_active: 1;
311
+
312
+ /* TRUE if global symbols in discarded sections should be stripped. */
313
+ unsigned int strip_discarded: 1;
314
+
315
+ /* TRUE if all data symbols should be dynamic. */
316
+ unsigned int dynamic_data: 1;
317
+
318
+ /* Which symbols to strip. */
319
+ ENUM_BITFIELD (bfd_link_strip) strip : 2;
320
+
321
+ /* Which local symbols to discard. */
322
+ ENUM_BITFIELD (bfd_link_discard) discard : 2;
323
+
324
+ /* Criteria for skipping symbols when determining
325
+ whether to include an object from an archive. */
326
+ ENUM_BITFIELD (bfd_link_common_skip_ar_symbols) common_skip_ar_symbols : 2;
327
+
328
+ /* What to do with unresolved symbols in an object file.
329
+ When producing executables the default is GENERATE_ERROR.
330
+ When producing shared libraries the default is IGNORE. The
331
+ assumption with shared libraries is that the reference will be
332
+ resolved at load/execution time. */
333
+ ENUM_BITFIELD (report_method) unresolved_syms_in_objects : 2;
334
+
335
+ /* What to do with unresolved symbols in a shared library.
336
+ The same defaults apply. */
337
+ ENUM_BITFIELD (report_method) unresolved_syms_in_shared_libs : 2;
338
+
339
+ /* TRUE if shared objects should be linked directly, not shared. */
340
+ unsigned int static_link: 1;
341
+
342
+ /* TRUE if symbols should be retained in memory, FALSE if they
343
+ should be freed and reread. */
344
+ unsigned int keep_memory: 1;
345
+
346
+ /* TRUE if BFD should generate relocation information in the final
347
+ executable. */
348
+ unsigned int emitrelocations: 1;
349
+
350
+ /* TRUE if PT_GNU_RELRO segment should be created. */
351
+ unsigned int relro: 1;
352
+
353
+ /* Nonzero if .eh_frame_hdr section and PT_GNU_EH_FRAME ELF segment
354
+ should be created. 1 for DWARF2 tables, 2 for compact tables. */
355
+ unsigned int eh_frame_hdr_type: 2;
356
+
357
+ /* TRUE if we should warn when adding a DT_TEXTREL to a shared object. */
358
+ unsigned int warn_shared_textrel: 1;
359
+
360
+ /* TRUE if we should error when adding a DT_TEXTREL. */
361
+ unsigned int error_textrel: 1;
362
+
363
+ /* TRUE if .hash section should be created. */
364
+ unsigned int emit_hash: 1;
365
+
366
+ /* TRUE if .gnu.hash section should be created. */
367
+ unsigned int emit_gnu_hash: 1;
368
+
369
+ /* If TRUE reduce memory overheads, at the expense of speed. This will
370
+ cause map file generation to use an O(N^2) algorithm and disable
371
+ caching ELF symbol buffer. */
372
+ unsigned int reduce_memory_overheads: 1;
373
+
374
+ /* TRUE if the output file should be in a traditional format. This
375
+ is equivalent to the setting of the BFD_TRADITIONAL_FORMAT flag
376
+ on the output file, but may be checked when reading the input
377
+ files. */
378
+ unsigned int traditional_format: 1;
379
+
380
+ /* TRUE if non-PLT relocs should be merged into one reloc section
381
+ and sorted so that relocs against the same symbol come together. */
382
+ unsigned int combreloc: 1;
383
+
384
+ /* TRUE if a default symbol version should be created and used for
385
+ imported symbols. */
386
+ unsigned int default_imported_symver: 1;
387
+
388
+ /* TRUE if the new ELF dynamic tags are enabled. */
389
+ unsigned int new_dtags: 1;
390
+
391
+ /* FALSE if .eh_frame unwind info should be generated for PLT and other
392
+ linker created sections, TRUE if it should be omitted. */
393
+ unsigned int no_ld_generated_unwind_info: 1;
394
+
395
+ /* TRUE if BFD should generate a "task linked" object file,
396
+ similar to relocatable but also with globals converted to
397
+ statics. */
398
+ unsigned int task_link: 1;
399
+
400
+ /* TRUE if ok to have multiple definition. */
401
+ unsigned int allow_multiple_definition: 1;
402
+
403
+ /* TRUE if ok to have version with no definition. */
404
+ unsigned int allow_undefined_version: 1;
405
+
406
+ /* TRUE if some symbols have to be dynamic, controlled by
407
+ --dynamic-list command line options. */
408
+ unsigned int dynamic: 1;
409
+
410
+ /* TRUE if PT_GNU_STACK segment should be created with PF_R|PF_W|PF_X
411
+ flags. */
412
+ unsigned int execstack: 1;
413
+
414
+ /* TRUE if PT_GNU_STACK segment should be created with PF_R|PF_W
415
+ flags. */
416
+ unsigned int noexecstack: 1;
417
+
418
+ /* TRUE if we want to produced optimized output files. This might
419
+ need much more time and therefore must be explicitly selected. */
420
+ unsigned int optimize: 1;
421
+
422
+ /* TRUE if user should be informed of removed unreferenced sections. */
423
+ unsigned int print_gc_sections: 1;
424
+
425
+ /* TRUE if we should warn alternate ELF machine code. */
426
+ unsigned int warn_alternate_em: 1;
427
+
428
+ /* TRUE if the linker script contained an explicit PHDRS command. */
429
+ unsigned int user_phdrs: 1;
430
+
431
+ /* TRUE if BND prefix in PLT entries is always generated. */
432
+ unsigned int bndplt: 1;
433
+
434
+ /* TRUE if generation of .interp/PT_INTERP should be suppressed. */
435
+ unsigned int nointerp: 1;
436
+
437
+ /* TRUE if generate a 1-byte NOP as suffix for x86 call instruction. */
438
+ unsigned int call_nop_as_suffix : 1;
439
+
440
+ /* The 1-byte NOP for x86 call instruction. */
441
+ char call_nop_byte;
442
+
443
+ /* Char that may appear as the first char of a symbol, but should be
444
+ skipped (like symbol_leading_char) when looking up symbols in
445
+ wrap_hash. Used by PowerPC Linux for 'dot' symbols. */
446
+ char wrap_char;
447
+
448
+ /* Separator between archive and filename in linker script filespecs. */
449
+ char path_separator;
450
+
451
+ /* Compress DWARF debug sections. */
452
+ enum compressed_debug_section_type compress_debug;
453
+
454
+ /* Default stack size. Zero means default (often zero itself), -1
455
+ means explicitly zero-sized. */
456
+ bfd_signed_vma stacksize;
457
+
458
+ /* Enable or disable target specific optimizations.
459
+
460
+ Not all targets have optimizations to enable.
461
+
462
+ Normally these optimizations are disabled by default but some targets
463
+ prefer to enable them by default. So this field is a tri-state variable.
464
+ The values are:
465
+
466
+ zero: Enable the optimizations (either from --relax being specified on
467
+ the command line or the backend's before_allocation emulation function.
468
+
469
+ positive: The user has requested that these optimizations be disabled.
470
+ (Via the --no-relax command line option).
471
+
472
+ negative: The optimizations are disabled. (Set when initializing the
473
+ args_type structure in ldmain.c:main. */
474
+ signed int disable_target_specific_optimizations;
475
+
476
+ /* Function callbacks. */
477
+ const struct bfd_link_callbacks *callbacks;
478
+
479
+ /* Hash table handled by BFD. */
480
+ struct bfd_link_hash_table *hash;
481
+
482
+ /* Hash table of symbols to keep. This is NULL unless strip is
483
+ strip_some. */
484
+ struct bfd_hash_table *keep_hash;
485
+
486
+ /* Hash table of symbols to report back via the notice callback. If
487
+ this is NULL, and notice_all is FALSE, then no symbols are
488
+ reported back. */
489
+ struct bfd_hash_table *notice_hash;
490
+
491
+ /* Hash table of symbols which are being wrapped (the --wrap linker
492
+ option). If this is NULL, no symbols are being wrapped. */
493
+ struct bfd_hash_table *wrap_hash;
494
+
495
+ /* Hash table of symbols which may be left unresolved during
496
+ a link. If this is NULL, no symbols can be left unresolved. */
497
+ struct bfd_hash_table *ignore_hash;
498
+
499
+ /* The output BFD. */
500
+ bfd *output_bfd;
501
+
502
+ /* The list of input BFD's involved in the link. These are chained
503
+ together via the link.next field. */
504
+ bfd *input_bfds;
505
+ bfd **input_bfds_tail;
506
+
507
+ /* If a symbol should be created for each input BFD, this is section
508
+ where those symbols should be placed. It must be a section in
509
+ the output BFD. It may be NULL, in which case no such symbols
510
+ will be created. This is to support CREATE_OBJECT_SYMBOLS in the
511
+ linker command language. */
512
+ asection *create_object_symbols_section;
513
+
514
+ /* List of global symbol names that are starting points for marking
515
+ sections against garbage collection. */
516
+ struct bfd_sym_chain *gc_sym_list;
517
+
518
+ /* If a base output file is wanted, then this points to it */
519
+ void *base_file;
520
+
521
+ /* The function to call when the executable or shared object is
522
+ loaded. */
523
+ const char *init_function;
524
+
525
+ /* The function to call when the executable or shared object is
526
+ unloaded. */
527
+ const char *fini_function;
528
+
529
+ /* Number of relaxation passes. Usually only one relaxation pass
530
+ is needed. But a backend can have as many relaxation passes as
531
+ necessary. During bfd_relax_section call, it is set to the
532
+ current pass, starting from 0. */
533
+ int relax_pass;
534
+
535
+ /* Number of relaxation trips. This number is incremented every
536
+ time the relaxation pass is restarted due to a previous
537
+ relaxation returning true in *AGAIN. */
538
+ int relax_trip;
539
+
540
+ /* > 0 to treat protected data defined in the shared library as
541
+ reference external. 0 to treat it as internal. -1 to let
542
+ backend to decide. */
543
+ int extern_protected_data;
544
+
545
+ /* Non-zero if auto-import thunks for DATA items in pei386 DLLs
546
+ should be generated/linked against. Set to 1 if this feature
547
+ is explicitly requested by the user, -1 if enabled by default. */
548
+ int pei386_auto_import;
549
+
550
+ /* Non-zero if runtime relocs for DATA items with non-zero addends
551
+ in pei386 DLLs should be generated. Set to 1 if this feature
552
+ is explicitly requested by the user, -1 if enabled by default. */
553
+ int pei386_runtime_pseudo_reloc;
554
+
555
+ /* How many spare .dynamic DT_NULL entries should be added? */
556
+ unsigned int spare_dynamic_tags;
557
+
558
+ /* May be used to set DT_FLAGS for ELF. */
559
+ bfd_vma flags;
560
+
561
+ /* May be used to set DT_FLAGS_1 for ELF. */
562
+ bfd_vma flags_1;
563
+
564
+ /* Start and end of RELRO region. */
565
+ bfd_vma relro_start, relro_end;
566
+
567
+ /* List of symbols should be dynamic. */
568
+ struct bfd_elf_dynamic_list *dynamic_list;
569
+
570
+ /* The version information. */
571
+ struct bfd_elf_version_tree *version_info;
572
+ };
573
+
574
+ /* This structures holds a set of callback functions. These are called
575
+ by the BFD linker routines. Except for the info functions, the first
576
+ argument to each callback function is the bfd_link_info structure
577
+ being used and each function returns a boolean value. If the
578
+ function returns FALSE, then the BFD function which called it should
579
+ return with a failure indication. */
580
+
581
+ struct bfd_link_callbacks
582
+ {
583
+ /* A function which is called when an object is added from an
584
+ archive. ABFD is the archive element being added. NAME is the
585
+ name of the symbol which caused the archive element to be pulled
586
+ in. This function may set *SUBSBFD to point to an alternative
587
+ BFD from which symbols should in fact be added in place of the
588
+ original BFD's symbols. */
589
+ bfd_boolean (*add_archive_element)
590
+ (struct bfd_link_info *, bfd *abfd, const char *name, bfd **subsbfd);
591
+ /* A function which is called when a symbol is found with multiple
592
+ definitions. H is the symbol which is defined multiple times.
593
+ NBFD is the new BFD, NSEC is the new section, and NVAL is the new
594
+ value. NSEC may be bfd_com_section or bfd_ind_section. */
595
+ bfd_boolean (*multiple_definition)
596
+ (struct bfd_link_info *, struct bfd_link_hash_entry *h,
597
+ bfd *nbfd, asection *nsec, bfd_vma nval);
598
+ /* A function which is called when a common symbol is defined
599
+ multiple times. H is the symbol appearing multiple times.
600
+ NBFD is the BFD of the new symbol. NTYPE is the type of the new
601
+ symbol, one of bfd_link_hash_defined, bfd_link_hash_common, or
602
+ bfd_link_hash_indirect. If NTYPE is bfd_link_hash_common, NSIZE
603
+ is the size of the new symbol. */
604
+ bfd_boolean (*multiple_common)
605
+ (struct bfd_link_info *, struct bfd_link_hash_entry *h,
606
+ bfd *nbfd, enum bfd_link_hash_type ntype, bfd_vma nsize);
607
+ /* A function which is called to add a symbol to a set. ENTRY is
608
+ the link hash table entry for the set itself (e.g.,
609
+ __CTOR_LIST__). RELOC is the relocation to use for an entry in
610
+ the set when generating a relocatable file, and is also used to
611
+ get the size of the entry when generating an executable file.
612
+ ABFD, SEC and VALUE identify the value to add to the set. */
613
+ bfd_boolean (*add_to_set)
614
+ (struct bfd_link_info *, struct bfd_link_hash_entry *entry,
615
+ bfd_reloc_code_real_type reloc, bfd *abfd, asection *sec, bfd_vma value);
616
+ /* A function which is called when the name of a g++ constructor or
617
+ destructor is found. This is only called by some object file
618
+ formats. CONSTRUCTOR is TRUE for a constructor, FALSE for a
619
+ destructor. This will use BFD_RELOC_CTOR when generating a
620
+ relocatable file. NAME is the name of the symbol found. ABFD,
621
+ SECTION and VALUE are the value of the symbol. */
622
+ bfd_boolean (*constructor)
623
+ (struct bfd_link_info *, bfd_boolean constructor, const char *name,
624
+ bfd *abfd, asection *sec, bfd_vma value);
625
+ /* A function which is called to issue a linker warning. For
626
+ example, this is called when there is a reference to a warning
627
+ symbol. WARNING is the warning to be issued. SYMBOL is the name
628
+ of the symbol which triggered the warning; it may be NULL if
629
+ there is none. ABFD, SECTION and ADDRESS identify the location
630
+ which trigerred the warning; either ABFD or SECTION or both may
631
+ be NULL if the location is not known. */
632
+ bfd_boolean (*warning)
633
+ (struct bfd_link_info *, const char *warning, const char *symbol,
634
+ bfd *abfd, asection *section, bfd_vma address);
635
+ /* A function which is called when a relocation is attempted against
636
+ an undefined symbol. NAME is the symbol which is undefined.
637
+ ABFD, SECTION and ADDRESS identify the location from which the
638
+ reference is made. IS_FATAL indicates whether an undefined symbol is
639
+ a fatal error or not. In some cases SECTION may be NULL. */
640
+ bfd_boolean (*undefined_symbol)
641
+ (struct bfd_link_info *, const char *name, bfd *abfd,
642
+ asection *section, bfd_vma address, bfd_boolean is_fatal);
643
+ /* A function which is called when a reloc overflow occurs. ENTRY is
644
+ the link hash table entry for the symbol the reloc is against.
645
+ NAME is the name of the local symbol or section the reloc is
646
+ against, RELOC_NAME is the name of the relocation, and ADDEND is
647
+ any addend that is used. ABFD, SECTION and ADDRESS identify the
648
+ location at which the overflow occurs; if this is the result of a
649
+ bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
650
+ ABFD will be NULL. */
651
+ bfd_boolean (*reloc_overflow)
652
+ (struct bfd_link_info *, struct bfd_link_hash_entry *entry,
653
+ const char *name, const char *reloc_name, bfd_vma addend,
654
+ bfd *abfd, asection *section, bfd_vma address);
655
+ /* A function which is called when a dangerous reloc is performed.
656
+ MESSAGE is an appropriate message.
657
+ ABFD, SECTION and ADDRESS identify the location at which the
658
+ problem occurred; if this is the result of a
659
+ bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
660
+ ABFD will be NULL. */
661
+ bfd_boolean (*reloc_dangerous)
662
+ (struct bfd_link_info *, const char *message,
663
+ bfd *abfd, asection *section, bfd_vma address);
664
+ /* A function which is called when a reloc is found to be attached
665
+ to a symbol which is not being written out. NAME is the name of
666
+ the symbol. ABFD, SECTION and ADDRESS identify the location of
667
+ the reloc; if this is the result of a
668
+ bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
669
+ ABFD will be NULL. */
670
+ bfd_boolean (*unattached_reloc)
671
+ (struct bfd_link_info *, const char *name,
672
+ bfd *abfd, asection *section, bfd_vma address);
673
+ /* A function which is called when a symbol in notice_hash is
674
+ defined or referenced. H is the symbol, INH the indirect symbol
675
+ if applicable. ABFD, SECTION and ADDRESS are the (new) value of
676
+ the symbol. If SECTION is bfd_und_section, this is a reference.
677
+ FLAGS are the symbol BSF_* flags. */
678
+ bfd_boolean (*notice)
679
+ (struct bfd_link_info *, struct bfd_link_hash_entry *h,
680
+ struct bfd_link_hash_entry *inh,
681
+ bfd *abfd, asection *section, bfd_vma address, flagword flags);
682
+ /* Error or warning link info message. */
683
+ void (*einfo)
684
+ (const char *fmt, ...);
685
+ /* General link info message. */
686
+ void (*info)
687
+ (const char *fmt, ...);
688
+ /* Message to be printed in linker map file. */
689
+ void (*minfo)
690
+ (const char *fmt, ...);
691
+ /* This callback provides a chance for users of the BFD library to
692
+ override its decision about whether to place two adjacent sections
693
+ into the same segment. */
694
+ bfd_boolean (*override_segment_assignment)
695
+ (struct bfd_link_info *, bfd * abfd,
696
+ asection * current_section, asection * previous_section,
697
+ bfd_boolean new_segment);
698
+ };
699
+
700
+ /* The linker builds link_order structures which tell the code how to
701
+ include input data in the output file. */
702
+
703
+ /* These are the types of link_order structures. */
704
+
705
+ enum bfd_link_order_type
706
+ {
707
+ bfd_undefined_link_order, /* Undefined. */
708
+ bfd_indirect_link_order, /* Built from a section. */
709
+ bfd_data_link_order, /* Set to explicit data. */
710
+ bfd_section_reloc_link_order, /* Relocate against a section. */
711
+ bfd_symbol_reloc_link_order /* Relocate against a symbol. */
712
+ };
713
+
714
+ /* This is the link_order structure itself. These form a chain
715
+ attached to the output section whose contents they are describing. */
716
+
717
+ struct bfd_link_order
718
+ {
719
+ /* Next link_order in chain. */
720
+ struct bfd_link_order *next;
721
+ /* Type of link_order. */
722
+ enum bfd_link_order_type type;
723
+ /* Offset within output section. */
724
+ bfd_vma offset;
725
+ /* Size within output section. */
726
+ bfd_size_type size;
727
+ /* Type specific information. */
728
+ union
729
+ {
730
+ struct
731
+ {
732
+ /* Section to include. If this is used, then
733
+ section->output_section must be the section the
734
+ link_order is attached to, section->output_offset must
735
+ equal the link_order offset field, and section->size
736
+ must equal the link_order size field. Maybe these
737
+ restrictions should be relaxed someday. */
738
+ asection *section;
739
+ } indirect;
740
+ struct
741
+ {
742
+ /* Size of contents, or zero when contents should be filled by
743
+ the architecture-dependent fill function.
744
+ A non-zero value allows filling of the output section
745
+ with an arbitrary repeated pattern. */
746
+ unsigned int size;
747
+ /* Data to put into file. */
748
+ bfd_byte *contents;
749
+ } data;
750
+ struct
751
+ {
752
+ /* Description of reloc to generate. Used for
753
+ bfd_section_reloc_link_order and
754
+ bfd_symbol_reloc_link_order. */
755
+ struct bfd_link_order_reloc *p;
756
+ } reloc;
757
+ } u;
758
+ };
759
+
760
+ /* A linker order of type bfd_section_reloc_link_order or
761
+ bfd_symbol_reloc_link_order means to create a reloc against a
762
+ section or symbol, respectively. This is used to implement -Ur to
763
+ generate relocs for the constructor tables. The
764
+ bfd_link_order_reloc structure describes the reloc that BFD should
765
+ create. It is similar to a arelent, but I didn't use arelent
766
+ because the linker does not know anything about most symbols, and
767
+ any asymbol structure it creates will be partially meaningless.
768
+ This information could logically be in the bfd_link_order struct,
769
+ but I didn't want to waste the space since these types of relocs
770
+ are relatively rare. */
771
+
772
+ struct bfd_link_order_reloc
773
+ {
774
+ /* Reloc type. */
775
+ bfd_reloc_code_real_type reloc;
776
+
777
+ union
778
+ {
779
+ /* For type bfd_section_reloc_link_order, this is the section
780
+ the reloc should be against. This must be a section in the
781
+ output BFD, not any of the input BFDs. */
782
+ asection *section;
783
+ /* For type bfd_symbol_reloc_link_order, this is the name of the
784
+ symbol the reloc should be against. */
785
+ const char *name;
786
+ } u;
787
+
788
+ /* Addend to use. The object file should contain zero. The BFD
789
+ backend is responsible for filling in the contents of the object
790
+ file correctly. For some object file formats (e.g., COFF) the
791
+ addend must be stored into in the object file, and for some
792
+ (e.g., SPARC a.out) it is kept in the reloc. */
793
+ bfd_vma addend;
794
+ };
795
+
796
+ /* Allocate a new link_order for a section. */
797
+ extern struct bfd_link_order *bfd_new_link_order (bfd *, asection *);
798
+
799
+ /* These structures are used to describe version information for the
800
+ ELF linker. These structures could be manipulated entirely inside
801
+ BFD, but it would be a pain. Instead, the regular linker sets up
802
+ these structures, and then passes them into BFD. */
803
+
804
+ /* Glob pattern for a version. */
805
+
806
+ struct bfd_elf_version_expr
807
+ {
808
+ /* Next glob pattern for this version. */
809
+ struct bfd_elf_version_expr *next;
810
+ /* Glob pattern. */
811
+ const char *pattern;
812
+ /* Set if pattern is not a glob. */
813
+ unsigned int literal : 1;
814
+ /* Defined by ".symver". */
815
+ unsigned int symver : 1;
816
+ /* Defined by version script. */
817
+ unsigned int script : 1;
818
+ /* Pattern type. */
819
+ #define BFD_ELF_VERSION_C_TYPE 1
820
+ #define BFD_ELF_VERSION_CXX_TYPE 2
821
+ #define BFD_ELF_VERSION_JAVA_TYPE 4
822
+ unsigned int mask : 3;
823
+ };
824
+
825
+ struct bfd_elf_version_expr_head
826
+ {
827
+ /* List of all patterns, both wildcards and non-wildcards. */
828
+ struct bfd_elf_version_expr *list;
829
+ /* Hash table for non-wildcards. */
830
+ void *htab;
831
+ /* Remaining patterns. */
832
+ struct bfd_elf_version_expr *remaining;
833
+ /* What kind of pattern types are present in list (bitmask). */
834
+ unsigned int mask;
835
+ };
836
+
837
+ /* Version dependencies. */
838
+
839
+ struct bfd_elf_version_deps
840
+ {
841
+ /* Next dependency for this version. */
842
+ struct bfd_elf_version_deps *next;
843
+ /* The version which this version depends upon. */
844
+ struct bfd_elf_version_tree *version_needed;
845
+ };
846
+
847
+ /* A node in the version tree. */
848
+
849
+ struct bfd_elf_version_tree
850
+ {
851
+ /* Next version. */
852
+ struct bfd_elf_version_tree *next;
853
+ /* Name of this version. */
854
+ const char *name;
855
+ /* Version number. */
856
+ unsigned int vernum;
857
+ /* Regular expressions for global symbols in this version. */
858
+ struct bfd_elf_version_expr_head globals;
859
+ /* Regular expressions for local symbols in this version. */
860
+ struct bfd_elf_version_expr_head locals;
861
+ /* List of versions which this version depends upon. */
862
+ struct bfd_elf_version_deps *deps;
863
+ /* Index of the version name. This is used within BFD. */
864
+ unsigned int name_indx;
865
+ /* Whether this version tree was used. This is used within BFD. */
866
+ int used;
867
+ /* Matching hook. */
868
+ struct bfd_elf_version_expr *(*match)
869
+ (struct bfd_elf_version_expr_head *head,
870
+ struct bfd_elf_version_expr *prev, const char *sym);
871
+ };
872
+
873
+ struct bfd_elf_dynamic_list
874
+ {
875
+ struct bfd_elf_version_expr_head head;
876
+ struct bfd_elf_version_expr *(*match)
877
+ (struct bfd_elf_version_expr_head *head,
878
+ struct bfd_elf_version_expr *prev, const char *sym);
879
+ };
880
+
881
+ #endif
hardware/tools/avr/i686-w64-mingw32/avr/include/dis-asm.h ADDED
@@ -0,0 +1,394 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Interface between the opcode library and its callers.
2
+
3
+ Copyright (C) 1999-2015 Free Software Foundation, Inc.
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 3, or (at your option)
8
+ any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin Street - Fifth Floor,
18
+ Boston, MA 02110-1301, USA.
19
+
20
+ Written by Cygnus Support, 1993.
21
+
22
+ The opcode library (libopcodes.a) provides instruction decoders for
23
+ a large variety of instruction sets, callable with an identical
24
+ interface, for making instruction-processing programs more independent
25
+ of the instruction set being processed. */
26
+
27
+ #ifndef DIS_ASM_H
28
+ #define DIS_ASM_H
29
+
30
+ #ifdef __cplusplus
31
+ extern "C" {
32
+ #endif
33
+
34
+ #include <stdio.h>
35
+ #include "bfd.h"
36
+
37
+ typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2;
38
+
39
+ enum dis_insn_type
40
+ {
41
+ dis_noninsn, /* Not a valid instruction. */
42
+ dis_nonbranch, /* Not a branch instruction. */
43
+ dis_branch, /* Unconditional branch. */
44
+ dis_condbranch, /* Conditional branch. */
45
+ dis_jsr, /* Jump to subroutine. */
46
+ dis_condjsr, /* Conditional jump to subroutine. */
47
+ dis_dref, /* Data reference instruction. */
48
+ dis_dref2 /* Two data references in instruction. */
49
+ };
50
+
51
+ /* This struct is passed into the instruction decoding routine,
52
+ and is passed back out into each callback. The various fields are used
53
+ for conveying information from your main routine into your callbacks,
54
+ for passing information into the instruction decoders (such as the
55
+ addresses of the callback functions), or for passing information
56
+ back from the instruction decoders to their callers.
57
+
58
+ It must be initialized before it is first passed; this can be done
59
+ by hand, or using one of the initialization macros below. */
60
+
61
+ typedef struct disassemble_info
62
+ {
63
+ fprintf_ftype fprintf_func;
64
+ void *stream;
65
+ void *application_data;
66
+
67
+ /* Target description. We could replace this with a pointer to the bfd,
68
+ but that would require one. There currently isn't any such requirement
69
+ so to avoid introducing one we record these explicitly. */
70
+ /* The bfd_flavour. This can be bfd_target_unknown_flavour. */
71
+ enum bfd_flavour flavour;
72
+ /* The bfd_arch value. */
73
+ enum bfd_architecture arch;
74
+ /* The bfd_mach value. */
75
+ unsigned long mach;
76
+ /* Endianness (for bi-endian cpus). Mono-endian cpus can ignore this. */
77
+ enum bfd_endian endian;
78
+ /* Endianness of code, for mixed-endian situations such as ARM BE8. */
79
+ enum bfd_endian endian_code;
80
+ /* An arch/mach-specific bitmask of selected instruction subsets, mainly
81
+ for processors with run-time-switchable instruction sets. The default,
82
+ zero, means that there is no constraint. CGEN-based opcodes ports
83
+ may use ISA_foo masks. */
84
+ void *insn_sets;
85
+
86
+ /* Some targets need information about the current section to accurately
87
+ display insns. If this is NULL, the target disassembler function
88
+ will have to make its best guess. */
89
+ asection *section;
90
+
91
+ /* An array of pointers to symbols either at the location being disassembled
92
+ or at the start of the function being disassembled. The array is sorted
93
+ so that the first symbol is intended to be the one used. The others are
94
+ present for any misc. purposes. This is not set reliably, but if it is
95
+ not NULL, it is correct. */
96
+ asymbol **symbols;
97
+ /* Number of symbols in array. */
98
+ int num_symbols;
99
+
100
+ /* Symbol table provided for targets that want to look at it. This is
101
+ used on Arm to find mapping symbols and determine Arm/Thumb code. */
102
+ asymbol **symtab;
103
+ int symtab_pos;
104
+ int symtab_size;
105
+
106
+ /* For use by the disassembler.
107
+ The top 16 bits are reserved for public use (and are documented here).
108
+ The bottom 16 bits are for the internal use of the disassembler. */
109
+ unsigned long flags;
110
+ /* Set if the disassembler has determined that there are one or more
111
+ relocations associated with the instruction being disassembled. */
112
+ #define INSN_HAS_RELOC (1 << 31)
113
+ /* Set if the user has requested the disassembly of data as well as code. */
114
+ #define DISASSEMBLE_DATA (1 << 30)
115
+ /* Set if the user has specifically set the machine type encoded in the
116
+ mach field of this structure. */
117
+ #define USER_SPECIFIED_MACHINE_TYPE (1 << 29)
118
+
119
+ /* Use internally by the target specific disassembly code. */
120
+ void *private_data;
121
+
122
+ /* Function used to get bytes to disassemble. MEMADDR is the
123
+ address of the stuff to be disassembled, MYADDR is the address to
124
+ put the bytes in, and LENGTH is the number of bytes to read.
125
+ INFO is a pointer to this struct.
126
+ Returns an errno value or 0 for success. */
127
+ int (*read_memory_func)
128
+ (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,
129
+ struct disassemble_info *dinfo);
130
+
131
+ /* Function which should be called if we get an error that we can't
132
+ recover from. STATUS is the errno value from read_memory_func and
133
+ MEMADDR is the address that we were trying to read. INFO is a
134
+ pointer to this struct. */
135
+ void (*memory_error_func)
136
+ (int status, bfd_vma memaddr, struct disassemble_info *dinfo);
137
+
138
+ /* Function called to print ADDR. */
139
+ void (*print_address_func)
140
+ (bfd_vma addr, struct disassemble_info *dinfo);
141
+
142
+ /* Function called to determine if there is a symbol at the given ADDR.
143
+ If there is, the function returns 1, otherwise it returns 0.
144
+ This is used by ports which support an overlay manager where
145
+ the overlay number is held in the top part of an address. In
146
+ some circumstances we want to include the overlay number in the
147
+ address, (normally because there is a symbol associated with
148
+ that address), but sometimes we want to mask out the overlay bits. */
149
+ int (* symbol_at_address_func)
150
+ (bfd_vma addr, struct disassemble_info *dinfo);
151
+
152
+ /* Function called to check if a SYMBOL is can be displayed to the user.
153
+ This is used by some ports that want to hide special symbols when
154
+ displaying debugging outout. */
155
+ bfd_boolean (* symbol_is_valid)
156
+ (asymbol *, struct disassemble_info *dinfo);
157
+
158
+ /* These are for buffer_read_memory. */
159
+ bfd_byte *buffer;
160
+ bfd_vma buffer_vma;
161
+ unsigned int buffer_length;
162
+
163
+ /* This variable may be set by the instruction decoder. It suggests
164
+ the number of bytes objdump should display on a single line. If
165
+ the instruction decoder sets this, it should always set it to
166
+ the same value in order to get reasonable looking output. */
167
+ int bytes_per_line;
168
+
169
+ /* The next two variables control the way objdump displays the raw data. */
170
+ /* For example, if bytes_per_line is 8 and bytes_per_chunk is 4, the */
171
+ /* output will look like this:
172
+ 00: 00000000 00000000
173
+ with the chunks displayed according to "display_endian". */
174
+ int bytes_per_chunk;
175
+ enum bfd_endian display_endian;
176
+
177
+ /* Number of octets per incremented target address
178
+ Normally one, but some DSPs have byte sizes of 16 or 32 bits. */
179
+ unsigned int octets_per_byte;
180
+
181
+ /* The number of zeroes we want to see at the end of a section before we
182
+ start skipping them. */
183
+ unsigned int skip_zeroes;
184
+
185
+ /* The number of zeroes to skip at the end of a section. If the number
186
+ of zeroes at the end is between SKIP_ZEROES_AT_END and SKIP_ZEROES,
187
+ they will be disassembled. If there are fewer than
188
+ SKIP_ZEROES_AT_END, they will be skipped. This is a heuristic
189
+ attempt to avoid disassembling zeroes inserted by section
190
+ alignment. */
191
+ unsigned int skip_zeroes_at_end;
192
+
193
+ /* Whether the disassembler always needs the relocations. */
194
+ bfd_boolean disassembler_needs_relocs;
195
+
196
+ /* Results from instruction decoders. Not all decoders yet support
197
+ this information. This info is set each time an instruction is
198
+ decoded, and is only valid for the last such instruction.
199
+
200
+ To determine whether this decoder supports this information, set
201
+ insn_info_valid to 0, decode an instruction, then check it. */
202
+
203
+ char insn_info_valid; /* Branch info has been set. */
204
+ char branch_delay_insns; /* How many sequential insn's will run before
205
+ a branch takes effect. (0 = normal) */
206
+ char data_size; /* Size of data reference in insn, in bytes */
207
+ enum dis_insn_type insn_type; /* Type of instruction */
208
+ bfd_vma target; /* Target address of branch or dref, if known;
209
+ zero if unknown. */
210
+ bfd_vma target2; /* Second target address for dref2 */
211
+
212
+ /* Command line options specific to the target disassembler. */
213
+ char * disassembler_options;
214
+
215
+ /* If non-zero then try not disassemble beyond this address, even if
216
+ there are values left in the buffer. This address is the address
217
+ of the nearest symbol forwards from the start of the disassembly,
218
+ and it is assumed that it lies on the boundary between instructions.
219
+ If an instruction spans this address then this is an error in the
220
+ file being disassembled. */
221
+ bfd_vma stop_vma;
222
+
223
+ } disassemble_info;
224
+
225
+
226
+ /* Standard disassemblers. Disassemble one instruction at the given
227
+ target address. Return number of octets processed. */
228
+ typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
229
+
230
+ extern int print_insn_aarch64 (bfd_vma, disassemble_info *);
231
+ extern int print_insn_alpha (bfd_vma, disassemble_info *);
232
+ extern int print_insn_avr (bfd_vma, disassemble_info *);
233
+ extern int print_insn_bfin (bfd_vma, disassemble_info *);
234
+ extern int print_insn_big_arm (bfd_vma, disassemble_info *);
235
+ extern int print_insn_big_mips (bfd_vma, disassemble_info *);
236
+ extern int print_insn_big_nios2 (bfd_vma, disassemble_info *);
237
+ extern int print_insn_big_powerpc (bfd_vma, disassemble_info *);
238
+ extern int print_insn_big_score (bfd_vma, disassemble_info *);
239
+ extern int print_insn_cr16 (bfd_vma, disassemble_info *);
240
+ extern int print_insn_crx (bfd_vma, disassemble_info *);
241
+ extern int print_insn_d10v (bfd_vma, disassemble_info *);
242
+ extern int print_insn_d30v (bfd_vma, disassemble_info *);
243
+ extern int print_insn_dlx (bfd_vma, disassemble_info *);
244
+ extern int print_insn_epiphany (bfd_vma, disassemble_info *);
245
+ extern int print_insn_fr30 (bfd_vma, disassemble_info *);
246
+ extern int print_insn_frv (bfd_vma, disassemble_info *);
247
+ extern int print_insn_ft32 (bfd_vma, disassemble_info *);
248
+ extern int print_insn_h8300 (bfd_vma, disassemble_info *);
249
+ extern int print_insn_h8300h (bfd_vma, disassemble_info *);
250
+ extern int print_insn_h8300s (bfd_vma, disassemble_info *);
251
+ extern int print_insn_h8500 (bfd_vma, disassemble_info *);
252
+ extern int print_insn_hppa (bfd_vma, disassemble_info *);
253
+ extern int print_insn_i370 (bfd_vma, disassemble_info *);
254
+ extern int print_insn_i386 (bfd_vma, disassemble_info *);
255
+ extern int print_insn_i386_att (bfd_vma, disassemble_info *);
256
+ extern int print_insn_i386_intel (bfd_vma, disassemble_info *);
257
+ extern int print_insn_i860 (bfd_vma, disassemble_info *);
258
+ extern int print_insn_i960 (bfd_vma, disassemble_info *);
259
+ extern int print_insn_ia64 (bfd_vma, disassemble_info *);
260
+ extern int print_insn_ip2k (bfd_vma, disassemble_info *);
261
+ extern int print_insn_iq2000 (bfd_vma, disassemble_info *);
262
+ extern int print_insn_little_arm (bfd_vma, disassemble_info *);
263
+ extern int print_insn_little_mips (bfd_vma, disassemble_info *);
264
+ extern int print_insn_little_nios2 (bfd_vma, disassemble_info *);
265
+ extern int print_insn_little_powerpc (bfd_vma, disassemble_info *);
266
+ extern int print_insn_little_score (bfd_vma, disassemble_info *);
267
+ extern int print_insn_lm32 (bfd_vma, disassemble_info *);
268
+ extern int print_insn_m32c (bfd_vma, disassemble_info *);
269
+ extern int print_insn_m32r (bfd_vma, disassemble_info *);
270
+ extern int print_insn_m68hc11 (bfd_vma, disassemble_info *);
271
+ extern int print_insn_m68hc12 (bfd_vma, disassemble_info *);
272
+ extern int print_insn_m9s12x (bfd_vma, disassemble_info *);
273
+ extern int print_insn_m9s12xg (bfd_vma, disassemble_info *);
274
+ extern int print_insn_m68k (bfd_vma, disassemble_info *);
275
+ extern int print_insn_m88k (bfd_vma, disassemble_info *);
276
+ extern int print_insn_mcore (bfd_vma, disassemble_info *);
277
+ extern int print_insn_mep (bfd_vma, disassemble_info *);
278
+ extern int print_insn_metag (bfd_vma, disassemble_info *);
279
+ extern int print_insn_microblaze (bfd_vma, disassemble_info *);
280
+ extern int print_insn_mmix (bfd_vma, disassemble_info *);
281
+ extern int print_insn_mn10200 (bfd_vma, disassemble_info *);
282
+ extern int print_insn_mn10300 (bfd_vma, disassemble_info *);
283
+ extern int print_insn_moxie (bfd_vma, disassemble_info *);
284
+ extern int print_insn_msp430 (bfd_vma, disassemble_info *);
285
+ extern int print_insn_mt (bfd_vma, disassemble_info *);
286
+ extern int print_insn_nds32 (bfd_vma, disassemble_info *);
287
+ extern int print_insn_ns32k (bfd_vma, disassemble_info *);
288
+ extern int print_insn_or1k (bfd_vma, disassemble_info *);
289
+ extern int print_insn_pdp11 (bfd_vma, disassemble_info *);
290
+ extern int print_insn_pj (bfd_vma, disassemble_info *);
291
+ extern int print_insn_rs6000 (bfd_vma, disassemble_info *);
292
+ extern int print_insn_s390 (bfd_vma, disassemble_info *);
293
+ extern int print_insn_sh (bfd_vma, disassemble_info *);
294
+ extern int print_insn_sh64 (bfd_vma, disassemble_info *);
295
+ extern int print_insn_sh64x_media (bfd_vma, disassemble_info *);
296
+ extern int print_insn_sparc (bfd_vma, disassemble_info *);
297
+ extern int print_insn_spu (bfd_vma, disassemble_info *);
298
+ extern int print_insn_tic30 (bfd_vma, disassemble_info *);
299
+ extern int print_insn_tic4x (bfd_vma, disassemble_info *);
300
+ extern int print_insn_tic54x (bfd_vma, disassemble_info *);
301
+ extern int print_insn_tic6x (bfd_vma, disassemble_info *);
302
+ extern int print_insn_tic80 (bfd_vma, disassemble_info *);
303
+ extern int print_insn_tilegx (bfd_vma, disassemble_info *);
304
+ extern int print_insn_tilepro (bfd_vma, disassemble_info *);
305
+ extern int print_insn_v850 (bfd_vma, disassemble_info *);
306
+ extern int print_insn_vax (bfd_vma, disassemble_info *);
307
+ extern int print_insn_visium (bfd_vma, disassemble_info *);
308
+ extern int print_insn_w65 (bfd_vma, disassemble_info *);
309
+ extern int print_insn_xc16x (bfd_vma, disassemble_info *);
310
+ extern int print_insn_xgate (bfd_vma, disassemble_info *);
311
+ extern int print_insn_xstormy16 (bfd_vma, disassemble_info *);
312
+ extern int print_insn_xtensa (bfd_vma, disassemble_info *);
313
+ extern int print_insn_z80 (bfd_vma, disassemble_info *);
314
+ extern int print_insn_z8001 (bfd_vma, disassemble_info *);
315
+ extern int print_insn_z8002 (bfd_vma, disassemble_info *);
316
+ extern int print_insn_rx (bfd_vma, disassemble_info *);
317
+ extern int print_insn_rl78 (bfd_vma, disassemble_info *);
318
+ extern int print_insn_rl78_g10 (bfd_vma, disassemble_info *);
319
+ extern int print_insn_rl78_g13 (bfd_vma, disassemble_info *);
320
+ extern int print_insn_rl78_g14 (bfd_vma, disassemble_info *);
321
+
322
+ extern disassembler_ftype arc_get_disassembler (bfd *);
323
+ extern disassembler_ftype cris_get_disassembler (bfd *);
324
+ extern disassembler_ftype rl78_get_disassembler (bfd *);
325
+
326
+ extern void print_aarch64_disassembler_options (FILE *);
327
+ extern void print_i386_disassembler_options (FILE *);
328
+ extern void print_mips_disassembler_options (FILE *);
329
+ extern void print_ppc_disassembler_options (FILE *);
330
+ extern void print_arm_disassembler_options (FILE *);
331
+ extern void parse_arm_disassembler_option (char *);
332
+ extern void print_s390_disassembler_options (FILE *);
333
+ extern int get_arm_regname_num_options (void);
334
+ extern int set_arm_regname_option (int);
335
+ extern int get_arm_regnames (int, const char **, const char **, const char *const **);
336
+ extern bfd_boolean aarch64_symbol_is_valid (asymbol *, struct disassemble_info *);
337
+ extern bfd_boolean arm_symbol_is_valid (asymbol *, struct disassemble_info *);
338
+ extern void disassemble_init_powerpc (struct disassemble_info *);
339
+
340
+ /* Fetch the disassembler for a given BFD, if that support is available. */
341
+ extern disassembler_ftype disassembler (bfd *);
342
+
343
+ /* Amend the disassemble_info structure as necessary for the target architecture.
344
+ Should only be called after initialising the info->arch field. */
345
+ extern void disassemble_init_for_target (struct disassemble_info * dinfo);
346
+
347
+ /* Document any target specific options available from the disassembler. */
348
+ extern void disassembler_usage (FILE *);
349
+
350
+
351
+ /* This block of definitions is for particular callers who read instructions
352
+ into a buffer before calling the instruction decoder. */
353
+
354
+ /* Here is a function which callers may wish to use for read_memory_func.
355
+ It gets bytes from a buffer. */
356
+ extern int buffer_read_memory
357
+ (bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *);
358
+
359
+ /* This function goes with buffer_read_memory.
360
+ It prints a message using info->fprintf_func and info->stream. */
361
+ extern void perror_memory (int, bfd_vma, struct disassemble_info *);
362
+
363
+
364
+ /* Just print the address in hex. This is included for completeness even
365
+ though both GDB and objdump provide their own (to print symbolic
366
+ addresses). */
367
+ extern void generic_print_address
368
+ (bfd_vma, struct disassemble_info *);
369
+
370
+ /* Always true. */
371
+ extern int generic_symbol_at_address
372
+ (bfd_vma, struct disassemble_info *);
373
+
374
+ /* Also always true. */
375
+ extern bfd_boolean generic_symbol_is_valid
376
+ (asymbol *, struct disassemble_info *);
377
+
378
+ /* Method to initialize a disassemble_info struct. This should be
379
+ called by all applications creating such a struct. */
380
+ extern void init_disassemble_info (struct disassemble_info *dinfo, void *stream,
381
+ fprintf_ftype fprintf_func);
382
+
383
+ /* For compatibility with existing code. */
384
+ #define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
385
+ init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
386
+ #define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
387
+ init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
388
+
389
+
390
+ #ifdef __cplusplus
391
+ }
392
+ #endif
393
+
394
+ #endif /* ! defined (DIS_ASM_H) */
hardware/tools/avr/i686-w64-mingw32/avr/include/plugin-api.h ADDED
@@ -0,0 +1,432 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* plugin-api.h -- External linker plugin API. */
2
+
3
+ /* Copyright (C) 2009-2015 Free Software Foundation, Inc.
4
+ Written by Cary Coutant <ccoutant@google.com>.
5
+
6
+ This file is part of binutils.
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
10
+ the Free Software Foundation; either version 3 of the License, or
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
20
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21
+ MA 02110-1301, USA. */
22
+
23
+ /* This file defines the interface for writing a linker plugin, which is
24
+ described at < http://gcc.gnu.org/wiki/whopr/driver >. */
25
+
26
+ #ifndef PLUGIN_API_H
27
+ #define PLUGIN_API_H
28
+
29
+ #ifdef HAVE_STDINT_H
30
+ #include <stdint.h>
31
+ #elif defined(HAVE_INTTYPES_H)
32
+ #include <inttypes.h>
33
+ #endif
34
+ #include <sys/types.h>
35
+ #if !defined(HAVE_STDINT_H) && !defined(HAVE_INTTYPES_H) && \
36
+ !defined(UINT64_MAX) && !defined(uint64_t)
37
+ #error can not find uint64_t type
38
+ #endif
39
+
40
+ #ifdef __cplusplus
41
+ extern "C"
42
+ {
43
+ #endif
44
+
45
+ /* Status code returned by most API routines. */
46
+
47
+ enum ld_plugin_status
48
+ {
49
+ LDPS_OK = 0,
50
+ LDPS_NO_SYMS, /* Attempt to get symbols that haven't been added. */
51
+ LDPS_BAD_HANDLE, /* No claimed object associated with given handle. */
52
+ LDPS_ERR
53
+ /* Additional Error codes TBD. */
54
+ };
55
+
56
+ /* The version of the API specification. */
57
+
58
+ enum ld_plugin_api_version
59
+ {
60
+ LD_PLUGIN_API_VERSION = 1
61
+ };
62
+
63
+ /* The type of output file being generated by the linker. */
64
+
65
+ enum ld_plugin_output_file_type
66
+ {
67
+ LDPO_REL,
68
+ LDPO_EXEC,
69
+ LDPO_DYN,
70
+ LDPO_PIE
71
+ };
72
+
73
+ /* An input file managed by the plugin library. */
74
+
75
+ struct ld_plugin_input_file
76
+ {
77
+ const char *name;
78
+ int fd;
79
+ off_t offset;
80
+ off_t filesize;
81
+ void *handle;
82
+ };
83
+
84
+ /* A symbol belonging to an input file managed by the plugin library. */
85
+
86
+ struct ld_plugin_symbol
87
+ {
88
+ char *name;
89
+ char *version;
90
+ int def;
91
+ int visibility;
92
+ uint64_t size;
93
+ char *comdat_key;
94
+ int resolution;
95
+ };
96
+
97
+ /* An object's section. */
98
+
99
+ struct ld_plugin_section
100
+ {
101
+ const void* handle;
102
+ unsigned int shndx;
103
+ };
104
+
105
+ /* Whether the symbol is a definition, reference, or common, weak or not. */
106
+
107
+ enum ld_plugin_symbol_kind
108
+ {
109
+ LDPK_DEF,
110
+ LDPK_WEAKDEF,
111
+ LDPK_UNDEF,
112
+ LDPK_WEAKUNDEF,
113
+ LDPK_COMMON
114
+ };
115
+
116
+ /* The visibility of the symbol. */
117
+
118
+ enum ld_plugin_symbol_visibility
119
+ {
120
+ LDPV_DEFAULT,
121
+ LDPV_PROTECTED,
122
+ LDPV_INTERNAL,
123
+ LDPV_HIDDEN
124
+ };
125
+
126
+ /* How a symbol is resolved. */
127
+
128
+ enum ld_plugin_symbol_resolution
129
+ {
130
+ LDPR_UNKNOWN = 0,
131
+
132
+ /* Symbol is still undefined at this point. */
133
+ LDPR_UNDEF,
134
+
135
+ /* This is the prevailing definition of the symbol, with references from
136
+ regular object code. */
137
+ LDPR_PREVAILING_DEF,
138
+
139
+ /* This is the prevailing definition of the symbol, with no
140
+ references from regular objects. It is only referenced from IR
141
+ code. */
142
+ LDPR_PREVAILING_DEF_IRONLY,
143
+
144
+ /* This definition was pre-empted by a definition in a regular
145
+ object file. */
146
+ LDPR_PREEMPTED_REG,
147
+
148
+ /* This definition was pre-empted by a definition in another IR file. */
149
+ LDPR_PREEMPTED_IR,
150
+
151
+ /* This symbol was resolved by a definition in another IR file. */
152
+ LDPR_RESOLVED_IR,
153
+
154
+ /* This symbol was resolved by a definition in a regular object
155
+ linked into the main executable. */
156
+ LDPR_RESOLVED_EXEC,
157
+
158
+ /* This symbol was resolved by a definition in a shared object. */
159
+ LDPR_RESOLVED_DYN,
160
+
161
+ /* This is the prevailing definition of the symbol, with no
162
+ references from regular objects. It is only referenced from IR
163
+ code, but the symbol is exported and may be referenced from
164
+ a dynamic object (not seen at link time). */
165
+ LDPR_PREVAILING_DEF_IRONLY_EXP
166
+ };
167
+
168
+ /* The plugin library's "claim file" handler. */
169
+
170
+ typedef
171
+ enum ld_plugin_status
172
+ (*ld_plugin_claim_file_handler) (
173
+ const struct ld_plugin_input_file *file, int *claimed);
174
+
175
+ /* The plugin library's "all symbols read" handler. */
176
+
177
+ typedef
178
+ enum ld_plugin_status
179
+ (*ld_plugin_all_symbols_read_handler) (void);
180
+
181
+ /* The plugin library's cleanup handler. */
182
+
183
+ typedef
184
+ enum ld_plugin_status
185
+ (*ld_plugin_cleanup_handler) (void);
186
+
187
+ /* The linker's interface for registering the "claim file" handler. */
188
+
189
+ typedef
190
+ enum ld_plugin_status
191
+ (*ld_plugin_register_claim_file) (ld_plugin_claim_file_handler handler);
192
+
193
+ /* The linker's interface for registering the "all symbols read" handler. */
194
+
195
+ typedef
196
+ enum ld_plugin_status
197
+ (*ld_plugin_register_all_symbols_read) (
198
+ ld_plugin_all_symbols_read_handler handler);
199
+
200
+ /* The linker's interface for registering the cleanup handler. */
201
+
202
+ typedef
203
+ enum ld_plugin_status
204
+ (*ld_plugin_register_cleanup) (ld_plugin_cleanup_handler handler);
205
+
206
+ /* The linker's interface for adding symbols from a claimed input file. */
207
+
208
+ typedef
209
+ enum ld_plugin_status
210
+ (*ld_plugin_add_symbols) (void *handle, int nsyms,
211
+ const struct ld_plugin_symbol *syms);
212
+
213
+ /* The linker's interface for getting the input file information with
214
+ an open (possibly re-opened) file descriptor. */
215
+
216
+ typedef
217
+ enum ld_plugin_status
218
+ (*ld_plugin_get_input_file) (const void *handle,
219
+ struct ld_plugin_input_file *file);
220
+
221
+ typedef
222
+ enum ld_plugin_status
223
+ (*ld_plugin_get_view) (const void *handle, const void **viewp);
224
+
225
+ /* The linker's interface for releasing the input file. */
226
+
227
+ typedef
228
+ enum ld_plugin_status
229
+ (*ld_plugin_release_input_file) (const void *handle);
230
+
231
+ /* The linker's interface for retrieving symbol resolution information. */
232
+
233
+ typedef
234
+ enum ld_plugin_status
235
+ (*ld_plugin_get_symbols) (const void *handle, int nsyms,
236
+ struct ld_plugin_symbol *syms);
237
+
238
+ /* The linker's interface for adding a compiled input file. */
239
+
240
+ typedef
241
+ enum ld_plugin_status
242
+ (*ld_plugin_add_input_file) (const char *pathname);
243
+
244
+ /* The linker's interface for adding a library that should be searched. */
245
+
246
+ typedef
247
+ enum ld_plugin_status
248
+ (*ld_plugin_add_input_library) (const char *libname);
249
+
250
+ /* The linker's interface for adding a library path that should be searched. */
251
+
252
+ typedef
253
+ enum ld_plugin_status
254
+ (*ld_plugin_set_extra_library_path) (const char *path);
255
+
256
+ /* The linker's interface for issuing a warning or error message. */
257
+
258
+ typedef
259
+ enum ld_plugin_status
260
+ (*ld_plugin_message) (int level, const char *format, ...);
261
+
262
+ /* The linker's interface for retrieving the number of sections in an object.
263
+ The handle is obtained in the claim_file handler. This interface should
264
+ only be invoked in the claim_file handler. This function sets *COUNT to
265
+ the number of sections in the object. */
266
+
267
+ typedef
268
+ enum ld_plugin_status
269
+ (*ld_plugin_get_input_section_count) (const void* handle, unsigned int *count);
270
+
271
+ /* The linker's interface for retrieving the section type of a specific
272
+ section in an object. This interface should only be invoked in the
273
+ claim_file handler. This function sets *TYPE to an ELF SHT_xxx value. */
274
+
275
+ typedef
276
+ enum ld_plugin_status
277
+ (*ld_plugin_get_input_section_type) (const struct ld_plugin_section section,
278
+ unsigned int *type);
279
+
280
+ /* The linker's interface for retrieving the name of a specific section in
281
+ an object. This interface should only be invoked in the claim_file handler.
282
+ This function sets *SECTION_NAME_PTR to a null-terminated buffer allocated
283
+ by malloc. The plugin must free *SECTION_NAME_PTR. */
284
+
285
+ typedef
286
+ enum ld_plugin_status
287
+ (*ld_plugin_get_input_section_name) (const struct ld_plugin_section section,
288
+ char **section_name_ptr);
289
+
290
+ /* The linker's interface for retrieving the contents of a specific section
291
+ in an object. This interface should only be invoked in the claim_file
292
+ handler. This function sets *SECTION_CONTENTS to point to a buffer that is
293
+ valid until clam_file handler returns. It sets *LEN to the size of the
294
+ buffer. */
295
+
296
+ typedef
297
+ enum ld_plugin_status
298
+ (*ld_plugin_get_input_section_contents) (const struct ld_plugin_section section,
299
+ const unsigned char **section_contents,
300
+ size_t* len);
301
+
302
+ /* The linker's interface for specifying the desired order of sections.
303
+ The sections should be specifed using the array SECTION_LIST in the
304
+ order in which they should appear in the final layout. NUM_SECTIONS
305
+ specifies the number of entries in each array. This should be invoked
306
+ in the all_symbols_read handler. */
307
+
308
+ typedef
309
+ enum ld_plugin_status
310
+ (*ld_plugin_update_section_order) (const struct ld_plugin_section *section_list,
311
+ unsigned int num_sections);
312
+
313
+ /* The linker's interface for specifying that reordering of sections is
314
+ desired so that the linker can prepare for it. This should be invoked
315
+ before update_section_order, preferably in the claim_file handler. */
316
+
317
+ typedef
318
+ enum ld_plugin_status
319
+ (*ld_plugin_allow_section_ordering) (void);
320
+
321
+ /* The linker's interface for specifying that a subset of sections is
322
+ to be mapped to a unique segment. If the plugin wants to call
323
+ unique_segment_for_sections, it must call this function from a
324
+ claim_file_handler or when it is first loaded. */
325
+
326
+ typedef
327
+ enum ld_plugin_status
328
+ (*ld_plugin_allow_unique_segment_for_sections) (void);
329
+
330
+ /* The linker's interface for specifying that a specific set of sections
331
+ must be mapped to a unique segment. ELF segments do not have names
332
+ and the NAME is used as the name of the newly created output section
333
+ that is then placed in the unique PT_LOAD segment. FLAGS is used to
334
+ specify if any additional segment flags need to be set. For instance,
335
+ a specific segment flag can be set to identify this segment. Unsetting
336
+ segment flags that would be set by default is not possible. The
337
+ parameter SEGMENT_ALIGNMENT when non-zero will override the default. */
338
+
339
+ typedef
340
+ enum ld_plugin_status
341
+ (*ld_plugin_unique_segment_for_sections) (
342
+ const char* segment_name,
343
+ uint64_t segment_flags,
344
+ uint64_t segment_alignment,
345
+ const struct ld_plugin_section * section_list,
346
+ unsigned int num_sections);
347
+
348
+ enum ld_plugin_level
349
+ {
350
+ LDPL_INFO,
351
+ LDPL_WARNING,
352
+ LDPL_ERROR,
353
+ LDPL_FATAL
354
+ };
355
+
356
+ /* Values for the tv_tag field of the transfer vector. */
357
+
358
+ enum ld_plugin_tag
359
+ {
360
+ LDPT_NULL = 0,
361
+ LDPT_API_VERSION = 1,
362
+ LDPT_GOLD_VERSION = 2,
363
+ LDPT_LINKER_OUTPUT = 3,
364
+ LDPT_OPTION = 4,
365
+ LDPT_REGISTER_CLAIM_FILE_HOOK = 5,
366
+ LDPT_REGISTER_ALL_SYMBOLS_READ_HOOK = 6,
367
+ LDPT_REGISTER_CLEANUP_HOOK = 7,
368
+ LDPT_ADD_SYMBOLS = 8,
369
+ LDPT_GET_SYMBOLS = 9,
370
+ LDPT_ADD_INPUT_FILE = 10,
371
+ LDPT_MESSAGE = 11,
372
+ LDPT_GET_INPUT_FILE = 12,
373
+ LDPT_RELEASE_INPUT_FILE = 13,
374
+ LDPT_ADD_INPUT_LIBRARY = 14,
375
+ LDPT_OUTPUT_NAME = 15,
376
+ LDPT_SET_EXTRA_LIBRARY_PATH = 16,
377
+ LDPT_GNU_LD_VERSION = 17,
378
+ LDPT_GET_VIEW = 18,
379
+ LDPT_GET_INPUT_SECTION_COUNT = 19,
380
+ LDPT_GET_INPUT_SECTION_TYPE = 20,
381
+ LDPT_GET_INPUT_SECTION_NAME = 21,
382
+ LDPT_GET_INPUT_SECTION_CONTENTS = 22,
383
+ LDPT_UPDATE_SECTION_ORDER = 23,
384
+ LDPT_ALLOW_SECTION_ORDERING = 24,
385
+ LDPT_GET_SYMBOLS_V2 = 25,
386
+ LDPT_ALLOW_UNIQUE_SEGMENT_FOR_SECTIONS = 26,
387
+ LDPT_UNIQUE_SEGMENT_FOR_SECTIONS = 27
388
+ };
389
+
390
+ /* The plugin transfer vector. */
391
+
392
+ struct ld_plugin_tv
393
+ {
394
+ enum ld_plugin_tag tv_tag;
395
+ union
396
+ {
397
+ int tv_val;
398
+ const char *tv_string;
399
+ ld_plugin_register_claim_file tv_register_claim_file;
400
+ ld_plugin_register_all_symbols_read tv_register_all_symbols_read;
401
+ ld_plugin_register_cleanup tv_register_cleanup;
402
+ ld_plugin_add_symbols tv_add_symbols;
403
+ ld_plugin_get_symbols tv_get_symbols;
404
+ ld_plugin_add_input_file tv_add_input_file;
405
+ ld_plugin_message tv_message;
406
+ ld_plugin_get_input_file tv_get_input_file;
407
+ ld_plugin_get_view tv_get_view;
408
+ ld_plugin_release_input_file tv_release_input_file;
409
+ ld_plugin_add_input_library tv_add_input_library;
410
+ ld_plugin_set_extra_library_path tv_set_extra_library_path;
411
+ ld_plugin_get_input_section_count tv_get_input_section_count;
412
+ ld_plugin_get_input_section_type tv_get_input_section_type;
413
+ ld_plugin_get_input_section_name tv_get_input_section_name;
414
+ ld_plugin_get_input_section_contents tv_get_input_section_contents;
415
+ ld_plugin_update_section_order tv_update_section_order;
416
+ ld_plugin_allow_section_ordering tv_allow_section_ordering;
417
+ ld_plugin_allow_unique_segment_for_sections tv_allow_unique_segment_for_sections;
418
+ ld_plugin_unique_segment_for_sections tv_unique_segment_for_sections;
419
+ } tv_u;
420
+ };
421
+
422
+ /* The plugin library's "onload" entry point. */
423
+
424
+ typedef
425
+ enum ld_plugin_status
426
+ (*ld_plugin_onload) (struct ld_plugin_tv *tv);
427
+
428
+ #ifdef __cplusplus
429
+ }
430
+ #endif
431
+
432
+ #endif /* !defined(PLUGIN_API_H) */
hardware/tools/avr/i686-w64-mingw32/avr/include/symcat.h ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Symbol concatenation utilities.
2
+
3
+ Copyright (C) 1998-2015 Free Software Foundation, Inc.
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License along
16
+ with this program; if not, write to the Free Software Foundation, Inc.,
17
+ 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
18
+
19
+ #ifndef SYM_CAT_H
20
+ #define SYM_CAT_H
21
+
22
+ #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
23
+ #define CONCAT2(a,b) a##b
24
+ #define CONCAT3(a,b,c) a##b##c
25
+ #define CONCAT4(a,b,c,d) a##b##c##d
26
+ #define CONCAT5(a,b,c,d,e) a##b##c##d##e
27
+ #define CONCAT6(a,b,c,d,e,f) a##b##c##d##e##f
28
+ #define STRINGX(s) #s
29
+ #else
30
+ /* Note one should never pass extra whitespace to the CONCATn macros,
31
+ e.g. CONCAT2(foo, bar) because traditonal C will keep the space between
32
+ the two labels instead of concatenating them. Instead, make sure to
33
+ write CONCAT2(foo,bar). */
34
+ #define CONCAT2(a,b) a/**/b
35
+ #define CONCAT3(a,b,c) a/**/b/**/c
36
+ #define CONCAT4(a,b,c,d) a/**/b/**/c/**/d
37
+ #define CONCAT5(a,b,c,d,e) a/**/b/**/c/**/d/**/e
38
+ #define CONCAT6(a,b,c,d,e,f) a/**/b/**/c/**/d/**/e/**/f
39
+ #define STRINGX(s) "s"
40
+ #endif
41
+
42
+ #define XCONCAT2(a,b) CONCAT2(a,b)
43
+ #define XCONCAT3(a,b,c) CONCAT3(a,b,c)
44
+ #define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d)
45
+ #define XCONCAT5(a,b,c,d,e) CONCAT5(a,b,c,d,e)
46
+ #define XCONCAT6(a,b,c,d,e,f) CONCAT6(a,b,c,d,e,f)
47
+
48
+ /* Note the layer of indirection here is typically used to allow
49
+ stringification of the expansion of macros. I.e. "#define foo
50
+ bar", "XSTRING(foo)", to yield "bar". Be aware that this only
51
+ works for __STDC__, not for traditional C which will still resolve
52
+ to "foo". */
53
+ #define XSTRING(s) STRINGX(s)
54
+
55
+ #endif /* SYM_CAT_H */
hardware/tools/avr/i686-w64-mingw32/avr/lib/libbfd.a ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16e242fe74081f6b9689716c65108699452ce0a302ca93316596c389e465f24c
3
+ size 652208
hardware/tools/avr/i686-w64-mingw32/avr/lib/libbfd.la ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # libbfd.la - a libtool library file
2
+ # Generated by libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
3
+ #
4
+ # Please DO NOT delete this file!
5
+ # It is necessary for linking the library.
6
+
7
+ # The name that we can dlopen(3).
8
+ dlname=''
9
+
10
+ # Names of this library.
11
+ library_names=''
12
+
13
+ # The name of the static archive.
14
+ old_library='libbfd.a'
15
+
16
+ # Linker flags that can not go in dependency_libs.
17
+ inherited_linker_flags=''
18
+
19
+ # Libraries that this one depends upon.
20
+ dependency_libs=' -L/home/jenkins-mingw32/workspace/avr-gcc-staging/label/Ubuntu14.04x64-mingw32/binutils-build/zlib -lz'
21
+
22
+ # Names of additional weak libraries provided by this library
23
+ weak_library_names=''
24
+
25
+ # Version information for libbfd.
26
+ current=0
27
+ age=0
28
+ revision=0
29
+
30
+ # Is this an already installed library?
31
+ installed=yes
32
+
33
+ # Should we warn about portability when linking against -modules?
34
+ shouldnotlink=no
35
+
36
+ # Files to dlopen/dlpreopen
37
+ dlopen=''
38
+ dlpreopen=''
39
+
40
+ # Directory that this library needs to be installed in:
41
+ libdir='/home/jenkins-mingw32/workspace/avr-gcc-staging/label/Ubuntu14.04x64-mingw32/objdir/i686-w64-mingw32/avr/lib'
hardware/tools/avr/i686-w64-mingw32/avr/lib/libopcodes.a ADDED
Binary file (18.5 kB). View file
 
hardware/tools/avr/i686-w64-mingw32/avr/lib/libopcodes.la ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # libopcodes.la - a libtool library file
2
+ # Generated by libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
3
+ #
4
+ # Please DO NOT delete this file!
5
+ # It is necessary for linking the library.
6
+
7
+ # The name that we can dlopen(3).
8
+ dlname=''
9
+
10
+ # Names of this library.
11
+ library_names=''
12
+
13
+ # The name of the static archive.
14
+ old_library='libopcodes.a'
15
+
16
+ # Linker flags that can not go in dependency_libs.
17
+ inherited_linker_flags=''
18
+
19
+ # Libraries that this one depends upon.
20
+ dependency_libs=''
21
+
22
+ # Names of additional weak libraries provided by this library
23
+ weak_library_names=''
24
+
25
+ # Version information for libopcodes.
26
+ current=0
27
+ age=0
28
+ revision=0
29
+
30
+ # Is this an already installed library?
31
+ installed=yes
32
+
33
+ # Should we warn about portability when linking against -modules?
34
+ shouldnotlink=no
35
+
36
+ # Files to dlopen/dlpreopen
37
+ dlopen=''
38
+ dlpreopen=''
39
+
40
+ # Directory that this library needs to be installed in:
41
+ libdir='/home/jenkins-mingw32/workspace/avr-gcc-staging/label/Ubuntu14.04x64-mingw32/objdir/i686-w64-mingw32/avr/lib'
hardware/tools/avr/include/libiberty/demangle.h ADDED
@@ -0,0 +1,685 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Defs for interface to demanglers.
2
+ Copyright (C) 1992-2015 Free Software Foundation, Inc.
3
+
4
+ This program is free software; you can redistribute it and/or
5
+ modify it under the terms of the GNU Library General Public License
6
+ as published by the Free Software Foundation; either version 2, or
7
+ (at your option) any later version.
8
+
9
+ In addition to the permissions in the GNU Library General Public
10
+ License, the Free Software Foundation gives you unlimited
11
+ permission to link the compiled version of this file into
12
+ combinations with other programs, and to distribute those
13
+ combinations without any restriction coming from the use of this
14
+ file. (The Library Public License restrictions do apply in other
15
+ respects; for example, they cover modification of the file, and
16
+ distribution when not linked into a combined executable.)
17
+
18
+ This program is distributed in the hope that it will be useful, but
19
+ WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
+ Library General Public License for more details.
22
+
23
+ You should have received a copy of the GNU Library General Public
24
+ License along with this program; if not, write to the Free Software
25
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26
+ 02110-1301, USA. */
27
+
28
+
29
+ #if !defined (DEMANGLE_H)
30
+ #define DEMANGLE_H
31
+
32
+ #include "libiberty.h"
33
+
34
+ #ifdef __cplusplus
35
+ extern "C" {
36
+ #endif /* __cplusplus */
37
+
38
+ /* Options passed to cplus_demangle (in 2nd parameter). */
39
+
40
+ #define DMGL_NO_OPTS 0 /* For readability... */
41
+ #define DMGL_PARAMS (1 << 0) /* Include function args */
42
+ #define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
43
+ #define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
44
+ #define DMGL_VERBOSE (1 << 3) /* Include implementation details. */
45
+ #define DMGL_TYPES (1 << 4) /* Also try to demangle type encodings. */
46
+ #define DMGL_RET_POSTFIX (1 << 5) /* Print function return types (when
47
+ present) after function signature.
48
+ It applies only to the toplevel
49
+ function type. */
50
+ #define DMGL_RET_DROP (1 << 6) /* Suppress printing function return
51
+ types, even if present. It applies
52
+ only to the toplevel function type.
53
+ */
54
+
55
+ #define DMGL_AUTO (1 << 8)
56
+ #define DMGL_GNU (1 << 9)
57
+ #define DMGL_LUCID (1 << 10)
58
+ #define DMGL_ARM (1 << 11)
59
+ #define DMGL_HP (1 << 12) /* For the HP aCC compiler;
60
+ same as ARM except for
61
+ template arguments, etc. */
62
+ #define DMGL_EDG (1 << 13)
63
+ #define DMGL_GNU_V3 (1 << 14)
64
+ #define DMGL_GNAT (1 << 15)
65
+ #define DMGL_DLANG (1 << 16)
66
+
67
+ /* If none of these are set, use 'current_demangling_style' as the default. */
68
+ #define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG|DMGL_GNU_V3|DMGL_JAVA|DMGL_GNAT|DMGL_DLANG)
69
+
70
+ /* Enumeration of possible demangling styles.
71
+
72
+ Lucid and ARM styles are still kept logically distinct, even though
73
+ they now both behave identically. The resulting style is actual the
74
+ union of both. I.E. either style recognizes both "__pt__" and "__rf__"
75
+ for operator "->", even though the first is lucid style and the second
76
+ is ARM style. (FIXME?) */
77
+
78
+ extern enum demangling_styles
79
+ {
80
+ no_demangling = -1,
81
+ unknown_demangling = 0,
82
+ auto_demangling = DMGL_AUTO,
83
+ gnu_demangling = DMGL_GNU,
84
+ lucid_demangling = DMGL_LUCID,
85
+ arm_demangling = DMGL_ARM,
86
+ hp_demangling = DMGL_HP,
87
+ edg_demangling = DMGL_EDG,
88
+ gnu_v3_demangling = DMGL_GNU_V3,
89
+ java_demangling = DMGL_JAVA,
90
+ gnat_demangling = DMGL_GNAT,
91
+ dlang_demangling = DMGL_DLANG
92
+ } current_demangling_style;
93
+
94
+ /* Define string names for the various demangling styles. */
95
+
96
+ #define NO_DEMANGLING_STYLE_STRING "none"
97
+ #define AUTO_DEMANGLING_STYLE_STRING "auto"
98
+ #define GNU_DEMANGLING_STYLE_STRING "gnu"
99
+ #define LUCID_DEMANGLING_STYLE_STRING "lucid"
100
+ #define ARM_DEMANGLING_STYLE_STRING "arm"
101
+ #define HP_DEMANGLING_STYLE_STRING "hp"
102
+ #define EDG_DEMANGLING_STYLE_STRING "edg"
103
+ #define GNU_V3_DEMANGLING_STYLE_STRING "gnu-v3"
104
+ #define JAVA_DEMANGLING_STYLE_STRING "java"
105
+ #define GNAT_DEMANGLING_STYLE_STRING "gnat"
106
+ #define DLANG_DEMANGLING_STYLE_STRING "dlang"
107
+
108
+ /* Some macros to test what demangling style is active. */
109
+
110
+ #define CURRENT_DEMANGLING_STYLE current_demangling_style
111
+ #define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
112
+ #define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
113
+ #define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
114
+ #define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM)
115
+ #define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
116
+ #define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
117
+ #define GNU_V3_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU_V3)
118
+ #define JAVA_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_JAVA)
119
+ #define GNAT_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNAT)
120
+ #define DLANG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_DLANG)
121
+
122
+ /* Provide information about the available demangle styles. This code is
123
+ pulled from gdb into libiberty because it is useful to binutils also. */
124
+
125
+ extern const struct demangler_engine
126
+ {
127
+ const char *const demangling_style_name;
128
+ const enum demangling_styles demangling_style;
129
+ const char *const demangling_style_doc;
130
+ } libiberty_demanglers[];
131
+
132
+ extern char *
133
+ cplus_demangle (const char *mangled, int options);
134
+
135
+ extern int
136
+ cplus_demangle_opname (const char *opname, char *result, int options);
137
+
138
+ extern const char *
139
+ cplus_mangle_opname (const char *opname, int options);
140
+
141
+ /* Note: This sets global state. FIXME if you care about multi-threading. */
142
+
143
+ extern void
144
+ set_cplus_marker_for_demangling (int ch);
145
+
146
+ extern enum demangling_styles
147
+ cplus_demangle_set_style (enum demangling_styles style);
148
+
149
+ extern enum demangling_styles
150
+ cplus_demangle_name_to_style (const char *name);
151
+
152
+ /* Callback typedef for allocation-less demangler interfaces. */
153
+ typedef void (*demangle_callbackref) (const char *, size_t, void *);
154
+
155
+ /* V3 ABI demangling entry points, defined in cp-demangle.c. Callback
156
+ variants return non-zero on success, zero on error. char* variants
157
+ return a string allocated by malloc on success, NULL on error. */
158
+ extern int
159
+ cplus_demangle_v3_callback (const char *mangled, int options,
160
+ demangle_callbackref callback, void *opaque);
161
+
162
+ extern char*
163
+ cplus_demangle_v3 (const char *mangled, int options);
164
+
165
+ extern int
166
+ java_demangle_v3_callback (const char *mangled,
167
+ demangle_callbackref callback, void *opaque);
168
+
169
+ extern char*
170
+ java_demangle_v3 (const char *mangled);
171
+
172
+ char *
173
+ ada_demangle (const char *mangled, int options);
174
+
175
+ extern char *
176
+ dlang_demangle (const char *mangled, int options);
177
+
178
+ enum gnu_v3_ctor_kinds {
179
+ gnu_v3_complete_object_ctor = 1,
180
+ gnu_v3_base_object_ctor,
181
+ gnu_v3_complete_object_allocating_ctor,
182
+ /* These are not part of the V3 ABI. Unified constructors are generated
183
+ as a speed-for-space optimization when the -fdeclone-ctor-dtor option
184
+ is used, and are always internal symbols. */
185
+ gnu_v3_unified_ctor,
186
+ gnu_v3_object_ctor_group
187
+ };
188
+
189
+ /* Return non-zero iff NAME is the mangled form of a constructor name
190
+ in the G++ V3 ABI demangling style. Specifically, return an `enum
191
+ gnu_v3_ctor_kinds' value indicating what kind of constructor
192
+ it is. */
193
+ extern enum gnu_v3_ctor_kinds
194
+ is_gnu_v3_mangled_ctor (const char *name);
195
+
196
+
197
+ enum gnu_v3_dtor_kinds {
198
+ gnu_v3_deleting_dtor = 1,
199
+ gnu_v3_complete_object_dtor,
200
+ gnu_v3_base_object_dtor,
201
+ /* These are not part of the V3 ABI. Unified destructors are generated
202
+ as a speed-for-space optimization when the -fdeclone-ctor-dtor option
203
+ is used, and are always internal symbols. */
204
+ gnu_v3_unified_dtor,
205
+ gnu_v3_object_dtor_group
206
+ };
207
+
208
+ /* Return non-zero iff NAME is the mangled form of a destructor name
209
+ in the G++ V3 ABI demangling style. Specifically, return an `enum
210
+ gnu_v3_dtor_kinds' value, indicating what kind of destructor
211
+ it is. */
212
+ extern enum gnu_v3_dtor_kinds
213
+ is_gnu_v3_mangled_dtor (const char *name);
214
+
215
+ /* The V3 demangler works in two passes. The first pass builds a tree
216
+ representation of the mangled name, and the second pass turns the
217
+ tree representation into a demangled string. Here we define an
218
+ interface to permit a caller to build their own tree
219
+ representation, which they can pass to the demangler to get a
220
+ demangled string. This can be used to canonicalize user input into
221
+ something which the demangler might output. It could also be used
222
+ by other demanglers in the future. */
223
+
224
+ /* These are the component types which may be found in the tree. Many
225
+ component types have one or two subtrees, referred to as left and
226
+ right (a component type with only one subtree puts it in the left
227
+ subtree). */
228
+
229
+ enum demangle_component_type
230
+ {
231
+ /* A name, with a length and a pointer to a string. */
232
+ DEMANGLE_COMPONENT_NAME,
233
+ /* A qualified name. The left subtree is a class or namespace or
234
+ some such thing, and the right subtree is a name qualified by
235
+ that class. */
236
+ DEMANGLE_COMPONENT_QUAL_NAME,
237
+ /* A local name. The left subtree describes a function, and the
238
+ right subtree is a name which is local to that function. */
239
+ DEMANGLE_COMPONENT_LOCAL_NAME,
240
+ /* A typed name. The left subtree is a name, and the right subtree
241
+ describes that name as a function. */
242
+ DEMANGLE_COMPONENT_TYPED_NAME,
243
+ /* A template. The left subtree is a template name, and the right
244
+ subtree is a template argument list. */
245
+ DEMANGLE_COMPONENT_TEMPLATE,
246
+ /* A template parameter. This holds a number, which is the template
247
+ parameter index. */
248
+ DEMANGLE_COMPONENT_TEMPLATE_PARAM,
249
+ /* A function parameter. This holds a number, which is the index. */
250
+ DEMANGLE_COMPONENT_FUNCTION_PARAM,
251
+ /* A constructor. This holds a name and the kind of
252
+ constructor. */
253
+ DEMANGLE_COMPONENT_CTOR,
254
+ /* A destructor. This holds a name and the kind of destructor. */
255
+ DEMANGLE_COMPONENT_DTOR,
256
+ /* A vtable. This has one subtree, the type for which this is a
257
+ vtable. */
258
+ DEMANGLE_COMPONENT_VTABLE,
259
+ /* A VTT structure. This has one subtree, the type for which this
260
+ is a VTT. */
261
+ DEMANGLE_COMPONENT_VTT,
262
+ /* A construction vtable. The left subtree is the type for which
263
+ this is a vtable, and the right subtree is the derived type for
264
+ which this vtable is built. */
265
+ DEMANGLE_COMPONENT_CONSTRUCTION_VTABLE,
266
+ /* A typeinfo structure. This has one subtree, the type for which
267
+ this is the tpeinfo structure. */
268
+ DEMANGLE_COMPONENT_TYPEINFO,
269
+ /* A typeinfo name. This has one subtree, the type for which this
270
+ is the typeinfo name. */
271
+ DEMANGLE_COMPONENT_TYPEINFO_NAME,
272
+ /* A typeinfo function. This has one subtree, the type for which
273
+ this is the tpyeinfo function. */
274
+ DEMANGLE_COMPONENT_TYPEINFO_FN,
275
+ /* A thunk. This has one subtree, the name for which this is a
276
+ thunk. */
277
+ DEMANGLE_COMPONENT_THUNK,
278
+ /* A virtual thunk. This has one subtree, the name for which this
279
+ is a virtual thunk. */
280
+ DEMANGLE_COMPONENT_VIRTUAL_THUNK,
281
+ /* A covariant thunk. This has one subtree, the name for which this
282
+ is a covariant thunk. */
283
+ DEMANGLE_COMPONENT_COVARIANT_THUNK,
284
+ /* A Java class. This has one subtree, the type. */
285
+ DEMANGLE_COMPONENT_JAVA_CLASS,
286
+ /* A guard variable. This has one subtree, the name for which this
287
+ is a guard variable. */
288
+ DEMANGLE_COMPONENT_GUARD,
289
+ /* The init and wrapper functions for C++11 thread_local variables. */
290
+ DEMANGLE_COMPONENT_TLS_INIT,
291
+ DEMANGLE_COMPONENT_TLS_WRAPPER,
292
+ /* A reference temporary. This has one subtree, the name for which
293
+ this is a temporary. */
294
+ DEMANGLE_COMPONENT_REFTEMP,
295
+ /* A hidden alias. This has one subtree, the encoding for which it
296
+ is providing alternative linkage. */
297
+ DEMANGLE_COMPONENT_HIDDEN_ALIAS,
298
+ /* A standard substitution. This holds the name of the
299
+ substitution. */
300
+ DEMANGLE_COMPONENT_SUB_STD,
301
+ /* The restrict qualifier. The one subtree is the type which is
302
+ being qualified. */
303
+ DEMANGLE_COMPONENT_RESTRICT,
304
+ /* The volatile qualifier. The one subtree is the type which is
305
+ being qualified. */
306
+ DEMANGLE_COMPONENT_VOLATILE,
307
+ /* The const qualifier. The one subtree is the type which is being
308
+ qualified. */
309
+ DEMANGLE_COMPONENT_CONST,
310
+ /* The restrict qualifier modifying a member function. The one
311
+ subtree is the type which is being qualified. */
312
+ DEMANGLE_COMPONENT_RESTRICT_THIS,
313
+ /* The volatile qualifier modifying a member function. The one
314
+ subtree is the type which is being qualified. */
315
+ DEMANGLE_COMPONENT_VOLATILE_THIS,
316
+ /* The const qualifier modifying a member function. The one subtree
317
+ is the type which is being qualified. */
318
+ DEMANGLE_COMPONENT_CONST_THIS,
319
+ /* C++11 A reference modifying a member function. The one subtree is the
320
+ type which is being referenced. */
321
+ DEMANGLE_COMPONENT_REFERENCE_THIS,
322
+ /* C++11: An rvalue reference modifying a member function. The one
323
+ subtree is the type which is being referenced. */
324
+ DEMANGLE_COMPONENT_RVALUE_REFERENCE_THIS,
325
+ /* A vendor qualifier. The left subtree is the type which is being
326
+ qualified, and the right subtree is the name of the
327
+ qualifier. */
328
+ DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL,
329
+ /* A pointer. The one subtree is the type which is being pointed
330
+ to. */
331
+ DEMANGLE_COMPONENT_POINTER,
332
+ /* A reference. The one subtree is the type which is being
333
+ referenced. */
334
+ DEMANGLE_COMPONENT_REFERENCE,
335
+ /* C++0x: An rvalue reference. The one subtree is the type which is
336
+ being referenced. */
337
+ DEMANGLE_COMPONENT_RVALUE_REFERENCE,
338
+ /* A complex type. The one subtree is the base type. */
339
+ DEMANGLE_COMPONENT_COMPLEX,
340
+ /* An imaginary type. The one subtree is the base type. */
341
+ DEMANGLE_COMPONENT_IMAGINARY,
342
+ /* A builtin type. This holds the builtin type information. */
343
+ DEMANGLE_COMPONENT_BUILTIN_TYPE,
344
+ /* A vendor's builtin type. This holds the name of the type. */
345
+ DEMANGLE_COMPONENT_VENDOR_TYPE,
346
+ /* A function type. The left subtree is the return type. The right
347
+ subtree is a list of ARGLIST nodes. Either or both may be
348
+ NULL. */
349
+ DEMANGLE_COMPONENT_FUNCTION_TYPE,
350
+ /* An array type. The left subtree is the dimension, which may be
351
+ NULL, or a string (represented as DEMANGLE_COMPONENT_NAME), or an
352
+ expression. The right subtree is the element type. */
353
+ DEMANGLE_COMPONENT_ARRAY_TYPE,
354
+ /* A pointer to member type. The left subtree is the class type,
355
+ and the right subtree is the member type. CV-qualifiers appear
356
+ on the latter. */
357
+ DEMANGLE_COMPONENT_PTRMEM_TYPE,
358
+ /* A fixed-point type. */
359
+ DEMANGLE_COMPONENT_FIXED_TYPE,
360
+ /* A vector type. The left subtree is the number of elements,
361
+ the right subtree is the element type. */
362
+ DEMANGLE_COMPONENT_VECTOR_TYPE,
363
+ /* An argument list. The left subtree is the current argument, and
364
+ the right subtree is either NULL or another ARGLIST node. */
365
+ DEMANGLE_COMPONENT_ARGLIST,
366
+ /* A template argument list. The left subtree is the current
367
+ template argument, and the right subtree is either NULL or
368
+ another TEMPLATE_ARGLIST node. */
369
+ DEMANGLE_COMPONENT_TEMPLATE_ARGLIST,
370
+ /* An initializer list. The left subtree is either an explicit type or
371
+ NULL, and the right subtree is a DEMANGLE_COMPONENT_ARGLIST. */
372
+ DEMANGLE_COMPONENT_INITIALIZER_LIST,
373
+ /* An operator. This holds information about a standard
374
+ operator. */
375
+ DEMANGLE_COMPONENT_OPERATOR,
376
+ /* An extended operator. This holds the number of arguments, and
377
+ the name of the extended operator. */
378
+ DEMANGLE_COMPONENT_EXTENDED_OPERATOR,
379
+ /* A typecast, represented as a unary operator. The one subtree is
380
+ the type to which the argument should be cast. */
381
+ DEMANGLE_COMPONENT_CAST,
382
+ /* A nullary expression. The left subtree is the operator. */
383
+ DEMANGLE_COMPONENT_NULLARY,
384
+ /* A unary expression. The left subtree is the operator, and the
385
+ right subtree is the single argument. */
386
+ DEMANGLE_COMPONENT_UNARY,
387
+ /* A binary expression. The left subtree is the operator, and the
388
+ right subtree is a BINARY_ARGS. */
389
+ DEMANGLE_COMPONENT_BINARY,
390
+ /* Arguments to a binary expression. The left subtree is the first
391
+ argument, and the right subtree is the second argument. */
392
+ DEMANGLE_COMPONENT_BINARY_ARGS,
393
+ /* A trinary expression. The left subtree is the operator, and the
394
+ right subtree is a TRINARY_ARG1. */
395
+ DEMANGLE_COMPONENT_TRINARY,
396
+ /* Arguments to a trinary expression. The left subtree is the first
397
+ argument, and the right subtree is a TRINARY_ARG2. */
398
+ DEMANGLE_COMPONENT_TRINARY_ARG1,
399
+ /* More arguments to a trinary expression. The left subtree is the
400
+ second argument, and the right subtree is the third argument. */
401
+ DEMANGLE_COMPONENT_TRINARY_ARG2,
402
+ /* A literal. The left subtree is the type, and the right subtree
403
+ is the value, represented as a DEMANGLE_COMPONENT_NAME. */
404
+ DEMANGLE_COMPONENT_LITERAL,
405
+ /* A negative literal. Like LITERAL, but the value is negated.
406
+ This is a minor hack: the NAME used for LITERAL points directly
407
+ to the mangled string, but since negative numbers are mangled
408
+ using 'n' instead of '-', we want a way to indicate a negative
409
+ number which involves neither modifying the mangled string nor
410
+ allocating a new copy of the literal in memory. */
411
+ DEMANGLE_COMPONENT_LITERAL_NEG,
412
+ /* A libgcj compiled resource. The left subtree is the name of the
413
+ resource. */
414
+ DEMANGLE_COMPONENT_JAVA_RESOURCE,
415
+ /* A name formed by the concatenation of two parts. The left
416
+ subtree is the first part and the right subtree the second. */
417
+ DEMANGLE_COMPONENT_COMPOUND_NAME,
418
+ /* A name formed by a single character. */
419
+ DEMANGLE_COMPONENT_CHARACTER,
420
+ /* A number. */
421
+ DEMANGLE_COMPONENT_NUMBER,
422
+ /* A decltype type. */
423
+ DEMANGLE_COMPONENT_DECLTYPE,
424
+ /* Global constructors keyed to name. */
425
+ DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS,
426
+ /* Global destructors keyed to name. */
427
+ DEMANGLE_COMPONENT_GLOBAL_DESTRUCTORS,
428
+ /* A lambda closure type. */
429
+ DEMANGLE_COMPONENT_LAMBDA,
430
+ /* A default argument scope. */
431
+ DEMANGLE_COMPONENT_DEFAULT_ARG,
432
+ /* An unnamed type. */
433
+ DEMANGLE_COMPONENT_UNNAMED_TYPE,
434
+ /* A transactional clone. This has one subtree, the encoding for
435
+ which it is providing alternative linkage. */
436
+ DEMANGLE_COMPONENT_TRANSACTION_CLONE,
437
+ /* A non-transactional clone entry point. In the i386/x86_64 abi,
438
+ the unmangled symbol of a tm_callable becomes a thunk and the
439
+ non-transactional function version is mangled thus. */
440
+ DEMANGLE_COMPONENT_NONTRANSACTION_CLONE,
441
+ /* A pack expansion. */
442
+ DEMANGLE_COMPONENT_PACK_EXPANSION,
443
+ /* A name with an ABI tag. */
444
+ DEMANGLE_COMPONENT_TAGGED_NAME,
445
+ /* A cloned function. */
446
+ DEMANGLE_COMPONENT_CLONE
447
+ };
448
+
449
+ /* Types which are only used internally. */
450
+
451
+ struct demangle_operator_info;
452
+ struct demangle_builtin_type_info;
453
+
454
+ /* A node in the tree representation is an instance of a struct
455
+ demangle_component. Note that the field names of the struct are
456
+ not well protected against macros defined by the file including
457
+ this one. We can fix this if it ever becomes a problem. */
458
+
459
+ struct demangle_component
460
+ {
461
+ /* The type of this component. */
462
+ enum demangle_component_type type;
463
+
464
+ union
465
+ {
466
+ /* For DEMANGLE_COMPONENT_NAME. */
467
+ struct
468
+ {
469
+ /* A pointer to the name (which need not NULL terminated) and
470
+ its length. */
471
+ const char *s;
472
+ int len;
473
+ } s_name;
474
+
475
+ /* For DEMANGLE_COMPONENT_OPERATOR. */
476
+ struct
477
+ {
478
+ /* Operator. */
479
+ const struct demangle_operator_info *op;
480
+ } s_operator;
481
+
482
+ /* For DEMANGLE_COMPONENT_EXTENDED_OPERATOR. */
483
+ struct
484
+ {
485
+ /* Number of arguments. */
486
+ int args;
487
+ /* Name. */
488
+ struct demangle_component *name;
489
+ } s_extended_operator;
490
+
491
+ /* For DEMANGLE_COMPONENT_FIXED_TYPE. */
492
+ struct
493
+ {
494
+ /* The length, indicated by a C integer type name. */
495
+ struct demangle_component *length;
496
+ /* _Accum or _Fract? */
497
+ short accum;
498
+ /* Saturating or not? */
499
+ short sat;
500
+ } s_fixed;
501
+
502
+ /* For DEMANGLE_COMPONENT_CTOR. */
503
+ struct
504
+ {
505
+ /* Kind of constructor. */
506
+ enum gnu_v3_ctor_kinds kind;
507
+ /* Name. */
508
+ struct demangle_component *name;
509
+ } s_ctor;
510
+
511
+ /* For DEMANGLE_COMPONENT_DTOR. */
512
+ struct
513
+ {
514
+ /* Kind of destructor. */
515
+ enum gnu_v3_dtor_kinds kind;
516
+ /* Name. */
517
+ struct demangle_component *name;
518
+ } s_dtor;
519
+
520
+ /* For DEMANGLE_COMPONENT_BUILTIN_TYPE. */
521
+ struct
522
+ {
523
+ /* Builtin type. */
524
+ const struct demangle_builtin_type_info *type;
525
+ } s_builtin;
526
+
527
+ /* For DEMANGLE_COMPONENT_SUB_STD. */
528
+ struct
529
+ {
530
+ /* Standard substitution string. */
531
+ const char* string;
532
+ /* Length of string. */
533
+ int len;
534
+ } s_string;
535
+
536
+ /* For DEMANGLE_COMPONENT_*_PARAM. */
537
+ struct
538
+ {
539
+ /* Parameter index. */
540
+ long number;
541
+ } s_number;
542
+
543
+ /* For DEMANGLE_COMPONENT_CHARACTER. */
544
+ struct
545
+ {
546
+ int character;
547
+ } s_character;
548
+
549
+ /* For other types. */
550
+ struct
551
+ {
552
+ /* Left (or only) subtree. */
553
+ struct demangle_component *left;
554
+ /* Right subtree. */
555
+ struct demangle_component *right;
556
+ } s_binary;
557
+
558
+ struct
559
+ {
560
+ /* subtree, same place as d_left. */
561
+ struct demangle_component *sub;
562
+ /* integer. */
563
+ int num;
564
+ } s_unary_num;
565
+
566
+ } u;
567
+ };
568
+
569
+ /* People building mangled trees are expected to allocate instances of
570
+ struct demangle_component themselves. They can then call one of
571
+ the following functions to fill them in. */
572
+
573
+ /* Fill in most component types with a left subtree and a right
574
+ subtree. Returns non-zero on success, zero on failure, such as an
575
+ unrecognized or inappropriate component type. */
576
+
577
+ extern int
578
+ cplus_demangle_fill_component (struct demangle_component *fill,
579
+ enum demangle_component_type,
580
+ struct demangle_component *left,
581
+ struct demangle_component *right);
582
+
583
+ /* Fill in a DEMANGLE_COMPONENT_NAME. Returns non-zero on success,
584
+ zero for bad arguments. */
585
+
586
+ extern int
587
+ cplus_demangle_fill_name (struct demangle_component *fill,
588
+ const char *, int);
589
+
590
+ /* Fill in a DEMANGLE_COMPONENT_BUILTIN_TYPE, using the name of the
591
+ builtin type (e.g., "int", etc.). Returns non-zero on success,
592
+ zero if the type is not recognized. */
593
+
594
+ extern int
595
+ cplus_demangle_fill_builtin_type (struct demangle_component *fill,
596
+ const char *type_name);
597
+
598
+ /* Fill in a DEMANGLE_COMPONENT_OPERATOR, using the name of the
599
+ operator and the number of arguments which it takes (the latter is
600
+ used to disambiguate operators which can be both binary and unary,
601
+ such as '-'). Returns non-zero on success, zero if the operator is
602
+ not recognized. */
603
+
604
+ extern int
605
+ cplus_demangle_fill_operator (struct demangle_component *fill,
606
+ const char *opname, int args);
607
+
608
+ /* Fill in a DEMANGLE_COMPONENT_EXTENDED_OPERATOR, providing the
609
+ number of arguments and the name. Returns non-zero on success,
610
+ zero for bad arguments. */
611
+
612
+ extern int
613
+ cplus_demangle_fill_extended_operator (struct demangle_component *fill,
614
+ int numargs,
615
+ struct demangle_component *nm);
616
+
617
+ /* Fill in a DEMANGLE_COMPONENT_CTOR. Returns non-zero on success,
618
+ zero for bad arguments. */
619
+
620
+ extern int
621
+ cplus_demangle_fill_ctor (struct demangle_component *fill,
622
+ enum gnu_v3_ctor_kinds kind,
623
+ struct demangle_component *name);
624
+
625
+ /* Fill in a DEMANGLE_COMPONENT_DTOR. Returns non-zero on success,
626
+ zero for bad arguments. */
627
+
628
+ extern int
629
+ cplus_demangle_fill_dtor (struct demangle_component *fill,
630
+ enum gnu_v3_dtor_kinds kind,
631
+ struct demangle_component *name);
632
+
633
+ /* This function translates a mangled name into a struct
634
+ demangle_component tree. The first argument is the mangled name.
635
+ The second argument is DMGL_* options. This returns a pointer to a
636
+ tree on success, or NULL on failure. On success, the third
637
+ argument is set to a block of memory allocated by malloc. This
638
+ block should be passed to free when the tree is no longer
639
+ needed. */
640
+
641
+ extern struct demangle_component *
642
+ cplus_demangle_v3_components (const char *mangled, int options, void **mem);
643
+
644
+ /* This function takes a struct demangle_component tree and returns
645
+ the corresponding demangled string. The first argument is DMGL_*
646
+ options. The second is the tree to demangle. The third is a guess
647
+ at the length of the demangled string, used to initially allocate
648
+ the return buffer. The fourth is a pointer to a size_t. On
649
+ success, this function returns a buffer allocated by malloc(), and
650
+ sets the size_t pointed to by the fourth argument to the size of
651
+ the allocated buffer (not the length of the returned string). On
652
+ failure, this function returns NULL, and sets the size_t pointed to
653
+ by the fourth argument to 0 for an invalid tree, or to 1 for a
654
+ memory allocation error. */
655
+
656
+ extern char *
657
+ cplus_demangle_print (int options,
658
+ const struct demangle_component *tree,
659
+ int estimated_length,
660
+ size_t *p_allocated_size);
661
+
662
+ /* This function takes a struct demangle_component tree and passes back
663
+ a demangled string in one or more calls to a callback function.
664
+ The first argument is DMGL_* options. The second is the tree to
665
+ demangle. The third is a pointer to a callback function; on each call
666
+ this receives an element of the demangled string, its length, and an
667
+ opaque value. The fourth is the opaque value passed to the callback.
668
+ The callback is called once or more to return the full demangled
669
+ string. The demangled element string is always nul-terminated, though
670
+ its length is also provided for convenience. In contrast to
671
+ cplus_demangle_print(), this function does not allocate heap memory
672
+ to grow output strings (except perhaps where alloca() is implemented
673
+ by malloc()), and so is normally safe for use where the heap has been
674
+ corrupted. On success, this function returns 1; on failure, 0. */
675
+
676
+ extern int
677
+ cplus_demangle_print_callback (int options,
678
+ const struct demangle_component *tree,
679
+ demangle_callbackref callback, void *opaque);
680
+
681
+ #ifdef __cplusplus
682
+ }
683
+ #endif /* __cplusplus */
684
+
685
+ #endif /* DEMANGLE_H */
hardware/tools/avr/include/libiberty/dyn-string.h ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* An abstract string datatype.
2
+ Copyright (C) 1998-2015 Free Software Foundation, Inc.
3
+ Contributed by Mark Mitchell (mark@markmitchell.com).
4
+
5
+ This file is part of GCC.
6
+
7
+ GCC is free software; you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation; either version 2, or (at your option)
10
+ any later version.
11
+
12
+ GCC is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with GCC; see the file COPYING. If not, write to
19
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor,
20
+ Boston, MA 02110-1301, USA. */
21
+
22
+ #ifndef DYN_STRING_H
23
+ #define DYN_STRING_H
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ typedef struct dyn_string
30
+ {
31
+ int allocated; /* The amount of space allocated for the string. */
32
+ int length; /* The actual length of the string. */
33
+ char *s; /* The string itself, NUL-terminated. */
34
+ }* dyn_string_t;
35
+
36
+ /* The length STR, in bytes, not including the terminating NUL. */
37
+ #define dyn_string_length(STR) \
38
+ ((STR)->length)
39
+
40
+ /* The NTBS in which the contents of STR are stored. */
41
+ #define dyn_string_buf(STR) \
42
+ ((STR)->s)
43
+
44
+ /* Compare DS1 to DS2 with strcmp. */
45
+ #define dyn_string_compare(DS1, DS2) \
46
+ (strcmp ((DS1)->s, (DS2)->s))
47
+
48
+
49
+ extern int dyn_string_init (struct dyn_string *, int);
50
+ extern dyn_string_t dyn_string_new (int);
51
+ extern void dyn_string_delete (dyn_string_t);
52
+ extern char *dyn_string_release (dyn_string_t);
53
+ extern dyn_string_t dyn_string_resize (dyn_string_t, int);
54
+ extern void dyn_string_clear (dyn_string_t);
55
+ extern int dyn_string_copy (dyn_string_t, dyn_string_t);
56
+ extern int dyn_string_copy_cstr (dyn_string_t, const char *);
57
+ extern int dyn_string_prepend (dyn_string_t, dyn_string_t);
58
+ extern int dyn_string_prepend_cstr (dyn_string_t, const char *);
59
+ extern int dyn_string_insert (dyn_string_t, int, dyn_string_t);
60
+ extern int dyn_string_insert_cstr (dyn_string_t, int, const char *);
61
+ extern int dyn_string_insert_char (dyn_string_t, int, int);
62
+ extern int dyn_string_append (dyn_string_t, dyn_string_t);
63
+ extern int dyn_string_append_cstr (dyn_string_t, const char *);
64
+ extern int dyn_string_append_char (dyn_string_t, int);
65
+ extern int dyn_string_substring (dyn_string_t, dyn_string_t, int, int);
66
+ extern int dyn_string_eq (dyn_string_t, dyn_string_t);
67
+
68
+ #ifdef __cplusplus
69
+ }
70
+ #endif
71
+
72
+ #endif /* !defined (DYN_STRING_H) */
hardware/tools/avr/include/libiberty/fibheap.h ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* A Fibonacci heap datatype.
2
+ Copyright (C) 1998-2015 Free Software Foundation, Inc.
3
+ Contributed by Daniel Berlin (dan@cgsoftware.com).
4
+
5
+ This file is part of GCC.
6
+
7
+ GCC is free software; you can redistribute it and/or modify it
8
+ under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation; either version 2, or (at your option)
10
+ any later version.
11
+
12
+ GCC is distributed in the hope that it will be useful, but
13
+ WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with GCC; see the file COPYING. If not, write to
19
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor,
20
+ Boston, MA 02110-1301, USA. */
21
+
22
+ /* Fibonacci heaps are somewhat complex, but, there's an article in
23
+ DDJ that explains them pretty well:
24
+
25
+ http://www.ddj.com/articles/1997/9701/9701o/9701o.htm?topic=algoritms
26
+
27
+ Introduction to algorithms by Corman and Rivest also goes over them.
28
+
29
+ The original paper that introduced them is "Fibonacci heaps and their
30
+ uses in improved network optimization algorithms" by Tarjan and
31
+ Fredman (JACM 34(3), July 1987).
32
+
33
+ Amortized and real worst case time for operations:
34
+
35
+ ExtractMin: O(lg n) amortized. O(n) worst case.
36
+ DecreaseKey: O(1) amortized. O(lg n) worst case.
37
+ Insert: O(2) amortized. O(1) actual.
38
+ Union: O(1) amortized. O(1) actual. */
39
+
40
+ #ifndef _FIBHEAP_H_
41
+ #define _FIBHEAP_H_
42
+
43
+ #include "ansidecl.h"
44
+
45
+ #ifdef __cplusplus
46
+ extern "C" {
47
+ #endif
48
+
49
+ typedef long fibheapkey_t;
50
+
51
+ typedef struct fibheap
52
+ {
53
+ size_t nodes;
54
+ struct fibnode *min;
55
+ struct fibnode *root;
56
+ } *fibheap_t;
57
+
58
+ typedef struct fibnode
59
+ {
60
+ struct fibnode *parent;
61
+ struct fibnode *child;
62
+ struct fibnode *left;
63
+ struct fibnode *right;
64
+ fibheapkey_t key;
65
+ void *data;
66
+ #if defined (__GNUC__) && (!defined (SIZEOF_INT) || SIZEOF_INT < 4)
67
+ __extension__ unsigned long int degree : 31;
68
+ __extension__ unsigned long int mark : 1;
69
+ #else
70
+ unsigned int degree : 31;
71
+ unsigned int mark : 1;
72
+ #endif
73
+ } *fibnode_t;
74
+
75
+ extern fibheap_t fibheap_new (void);
76
+ extern fibnode_t fibheap_insert (fibheap_t, fibheapkey_t, void *);
77
+ extern int fibheap_empty (fibheap_t);
78
+ extern fibheapkey_t fibheap_min_key (fibheap_t);
79
+ extern fibheapkey_t fibheap_replace_key (fibheap_t, fibnode_t,
80
+ fibheapkey_t);
81
+ extern void *fibheap_replace_key_data (fibheap_t, fibnode_t,
82
+ fibheapkey_t, void *);
83
+ extern void *fibheap_extract_min (fibheap_t);
84
+ extern void *fibheap_min (fibheap_t);
85
+ extern void *fibheap_replace_data (fibheap_t, fibnode_t, void *);
86
+ extern void *fibheap_delete_node (fibheap_t, fibnode_t);
87
+ extern void fibheap_delete (fibheap_t);
88
+ extern fibheap_t fibheap_union (fibheap_t, fibheap_t);
89
+
90
+ #ifdef __cplusplus
91
+ }
92
+ #endif
93
+
94
+ #endif /* _FIBHEAP_H_ */
hardware/tools/avr/include/libiberty/floatformat.h ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* IEEE floating point support declarations, for GDB, the GNU Debugger.
2
+ Copyright (C) 1991-2015 Free Software Foundation, Inc.
3
+
4
+ This file is part of GDB.
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 2 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, MA 02110-1301, USA. */
19
+
20
+ #if !defined (FLOATFORMAT_H)
21
+ #define FLOATFORMAT_H 1
22
+
23
+ #include "ansidecl.h"
24
+
25
+ #ifdef __cplusplus
26
+ extern "C" {
27
+ #endif
28
+
29
+ /* A floatformat consists of a sign bit, an exponent and a mantissa. Once the
30
+ bytes are concatenated according to the byteorder flag, then each of those
31
+ fields is contiguous. We number the bits with 0 being the most significant
32
+ (i.e. BITS_BIG_ENDIAN type numbering), and specify which bits each field
33
+ contains with the *_start and *_len fields. */
34
+
35
+ /* What is the order of the bytes? */
36
+
37
+ enum floatformat_byteorders {
38
+ /* Standard little endian byte order.
39
+ EX: 1.2345678e10 => 00 00 80 c5 e0 fe 06 42 */
40
+ floatformat_little,
41
+
42
+ /* Standard big endian byte order.
43
+ EX: 1.2345678e10 => 42 06 fe e0 c5 80 00 00 */
44
+ floatformat_big,
45
+
46
+ /* Little endian byte order but big endian word order.
47
+ EX: 1.2345678e10 => e0 fe 06 42 00 00 80 c5 */
48
+ floatformat_littlebyte_bigword,
49
+
50
+ /* VAX byte order. Little endian byte order with 16-bit words. The
51
+ following example is an illustration of the byte order only; VAX
52
+ doesn't have a fully IEEE compliant floating-point format.
53
+ EX: 1.2345678e10 => 80 c5 00 00 06 42 e0 fe */
54
+ floatformat_vax
55
+ };
56
+
57
+ enum floatformat_intbit { floatformat_intbit_yes, floatformat_intbit_no };
58
+
59
+ struct floatformat
60
+ {
61
+ enum floatformat_byteorders byteorder;
62
+ unsigned int totalsize; /* Total size of number in bits */
63
+
64
+ /* Sign bit is always one bit long. 1 means negative, 0 means positive. */
65
+ unsigned int sign_start;
66
+
67
+ unsigned int exp_start;
68
+ unsigned int exp_len;
69
+ /* Bias added to a "true" exponent to form the biased exponent. It
70
+ is intentionally signed as, otherwize, -exp_bias can turn into a
71
+ very large number (e.g., given the exp_bias of 0x3fff and a 64
72
+ bit long, the equation (long)(1 - exp_bias) evaluates to
73
+ 4294950914) instead of -16382). */
74
+ int exp_bias;
75
+ /* Exponent value which indicates NaN. This is the actual value stored in
76
+ the float, not adjusted by the exp_bias. This usually consists of all
77
+ one bits. */
78
+ unsigned int exp_nan;
79
+
80
+ unsigned int man_start;
81
+ unsigned int man_len;
82
+
83
+ /* Is the integer bit explicit or implicit? */
84
+ enum floatformat_intbit intbit;
85
+
86
+ /* Internal name for debugging. */
87
+ const char *name;
88
+
89
+ /* Validator method. */
90
+ int (*is_valid) (const struct floatformat *fmt, const void *from);
91
+
92
+ /* Is the format actually the sum of two smaller floating point
93
+ formats (IBM long double, as described in
94
+ gcc/config/rs6000/darwin-ldouble-format)? If so, this is the
95
+ smaller format in question, and the fields sign_start through
96
+ intbit describe the first half. If not, this is NULL. */
97
+ const struct floatformat *split_half;
98
+ };
99
+
100
+ /* floatformats for IEEE single and double, big and little endian. */
101
+
102
+ extern const struct floatformat floatformat_ieee_half_big;
103
+ extern const struct floatformat floatformat_ieee_half_little;
104
+ extern const struct floatformat floatformat_ieee_single_big;
105
+ extern const struct floatformat floatformat_ieee_single_little;
106
+ extern const struct floatformat floatformat_ieee_double_big;
107
+ extern const struct floatformat floatformat_ieee_double_little;
108
+
109
+ /* floatformat for ARM IEEE double, little endian bytes and big endian words */
110
+
111
+ extern const struct floatformat floatformat_ieee_double_littlebyte_bigword;
112
+
113
+ /* floatformats for VAX. */
114
+
115
+ extern const struct floatformat floatformat_vax_f;
116
+ extern const struct floatformat floatformat_vax_d;
117
+ extern const struct floatformat floatformat_vax_g;
118
+
119
+ /* floatformats for various extendeds. */
120
+
121
+ extern const struct floatformat floatformat_i387_ext;
122
+ extern const struct floatformat floatformat_m68881_ext;
123
+ extern const struct floatformat floatformat_i960_ext;
124
+ extern const struct floatformat floatformat_m88110_ext;
125
+ extern const struct floatformat floatformat_m88110_harris_ext;
126
+ extern const struct floatformat floatformat_arm_ext_big;
127
+ extern const struct floatformat floatformat_arm_ext_littlebyte_bigword;
128
+ /* IA-64 Floating Point register spilt into memory. */
129
+ extern const struct floatformat floatformat_ia64_spill_big;
130
+ extern const struct floatformat floatformat_ia64_spill_little;
131
+ extern const struct floatformat floatformat_ia64_quad_big;
132
+ extern const struct floatformat floatformat_ia64_quad_little;
133
+ /* IBM long double (double+double). */
134
+ extern const struct floatformat floatformat_ibm_long_double_big;
135
+ extern const struct floatformat floatformat_ibm_long_double_little;
136
+
137
+ /* Convert from FMT to a double.
138
+ FROM is the address of the extended float.
139
+ Store the double in *TO. */
140
+
141
+ extern void
142
+ floatformat_to_double (const struct floatformat *, const void *, double *);
143
+
144
+ /* The converse: convert the double *FROM to FMT
145
+ and store where TO points. */
146
+
147
+ extern void
148
+ floatformat_from_double (const struct floatformat *, const double *, void *);
149
+
150
+ /* Return non-zero iff the data at FROM is a valid number in format FMT. */
151
+
152
+ extern int
153
+ floatformat_is_valid (const struct floatformat *fmt, const void *from);
154
+
155
+ #ifdef __cplusplus
156
+ }
157
+ #endif
158
+
159
+ #endif /* defined (FLOATFORMAT_H) */
hardware/tools/avr/include/libiberty/hashtab.h ADDED
@@ -0,0 +1,204 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* An expandable hash tables datatype.
2
+ Copyright (C) 1999-2015 Free Software Foundation, Inc.
3
+ Contributed by Vladimir Makarov (vmakarov@cygnus.com).
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
18
+
19
+ /* This package implements basic hash table functionality. It is possible
20
+ to search for an entry, create an entry and destroy an entry.
21
+
22
+ Elements in the table are generic pointers.
23
+
24
+ The size of the table is not fixed; if the occupancy of the table
25
+ grows too high the hash table will be expanded.
26
+
27
+ The abstract data implementation is based on generalized Algorithm D
28
+ from Knuth's book "The art of computer programming". Hash table is
29
+ expanded by creation of new hash table and transferring elements from
30
+ the old table to the new table. */
31
+
32
+ #ifndef __HASHTAB_H__
33
+ #define __HASHTAB_H__
34
+
35
+ #ifdef __cplusplus
36
+ extern "C" {
37
+ #endif /* __cplusplus */
38
+
39
+ #include "ansidecl.h"
40
+
41
+ /* The type for a hash code. */
42
+ typedef unsigned int hashval_t;
43
+
44
+ /* Callback function pointer types. */
45
+
46
+ /* Calculate hash of a table entry. */
47
+ typedef hashval_t (*htab_hash) (const void *);
48
+
49
+ /* Compare a table entry with a possible entry. The entry already in
50
+ the table always comes first, so the second element can be of a
51
+ different type (but in this case htab_find and htab_find_slot
52
+ cannot be used; instead the variants that accept a hash value
53
+ must be used). */
54
+ typedef int (*htab_eq) (const void *, const void *);
55
+
56
+ /* Cleanup function called whenever a live element is removed from
57
+ the hash table. */
58
+ typedef void (*htab_del) (void *);
59
+
60
+ /* Function called by htab_traverse for each live element. The first
61
+ arg is the slot of the element (which can be passed to htab_clear_slot
62
+ if desired), the second arg is the auxiliary pointer handed to
63
+ htab_traverse. Return 1 to continue scan, 0 to stop. */
64
+ typedef int (*htab_trav) (void **, void *);
65
+
66
+ /* Memory-allocation function, with the same functionality as calloc().
67
+ Iff it returns NULL, the hash table implementation will pass an error
68
+ code back to the user, so if your code doesn't handle errors,
69
+ best if you use xcalloc instead. */
70
+ typedef void *(*htab_alloc) (size_t, size_t);
71
+
72
+ /* We also need a free() routine. */
73
+ typedef void (*htab_free) (void *);
74
+
75
+ /* Memory allocation and deallocation; variants which take an extra
76
+ argument. */
77
+ typedef void *(*htab_alloc_with_arg) (void *, size_t, size_t);
78
+ typedef void (*htab_free_with_arg) (void *, void *);
79
+
80
+ /* This macro defines reserved value for empty table entry. */
81
+
82
+ #define HTAB_EMPTY_ENTRY ((PTR) 0)
83
+
84
+ /* This macro defines reserved value for table entry which contained
85
+ a deleted element. */
86
+
87
+ #define HTAB_DELETED_ENTRY ((PTR) 1)
88
+
89
+ /* Hash tables are of the following type. The structure
90
+ (implementation) of this type is not needed for using the hash
91
+ tables. All work with hash table should be executed only through
92
+ functions mentioned below. The size of this structure is subject to
93
+ change. */
94
+
95
+ struct htab {
96
+ /* Pointer to hash function. */
97
+ htab_hash hash_f;
98
+
99
+ /* Pointer to comparison function. */
100
+ htab_eq eq_f;
101
+
102
+ /* Pointer to cleanup function. */
103
+ htab_del del_f;
104
+
105
+ /* Table itself. */
106
+ void **entries;
107
+
108
+ /* Current size (in entries) of the hash table. */
109
+ size_t size;
110
+
111
+ /* Current number of elements including also deleted elements. */
112
+ size_t n_elements;
113
+
114
+ /* Current number of deleted elements in the table. */
115
+ size_t n_deleted;
116
+
117
+ /* The following member is used for debugging. Its value is number
118
+ of all calls of `htab_find_slot' for the hash table. */
119
+ unsigned int searches;
120
+
121
+ /* The following member is used for debugging. Its value is number
122
+ of collisions fixed for time of work with the hash table. */
123
+ unsigned int collisions;
124
+
125
+ /* Pointers to allocate/free functions. */
126
+ htab_alloc alloc_f;
127
+ htab_free free_f;
128
+
129
+ /* Alternate allocate/free functions, which take an extra argument. */
130
+ void *alloc_arg;
131
+ htab_alloc_with_arg alloc_with_arg_f;
132
+ htab_free_with_arg free_with_arg_f;
133
+
134
+ /* Current size (in entries) of the hash table, as an index into the
135
+ table of primes. */
136
+ unsigned int size_prime_index;
137
+ };
138
+
139
+ typedef struct htab *htab_t;
140
+
141
+ /* An enum saying whether we insert into the hash table or not. */
142
+ enum insert_option {NO_INSERT, INSERT};
143
+
144
+ /* The prototypes of the package functions. */
145
+
146
+ extern htab_t htab_create_alloc (size_t, htab_hash,
147
+ htab_eq, htab_del,
148
+ htab_alloc, htab_free);
149
+
150
+ extern htab_t htab_create_alloc_ex (size_t, htab_hash,
151
+ htab_eq, htab_del,
152
+ void *, htab_alloc_with_arg,
153
+ htab_free_with_arg);
154
+
155
+ extern htab_t htab_create_typed_alloc (size_t, htab_hash, htab_eq, htab_del,
156
+ htab_alloc, htab_alloc, htab_free);
157
+
158
+ /* Backward-compatibility functions. */
159
+ extern htab_t htab_create (size_t, htab_hash, htab_eq, htab_del);
160
+ extern htab_t htab_try_create (size_t, htab_hash, htab_eq, htab_del);
161
+
162
+ extern void htab_set_functions_ex (htab_t, htab_hash,
163
+ htab_eq, htab_del,
164
+ void *, htab_alloc_with_arg,
165
+ htab_free_with_arg);
166
+
167
+ extern void htab_delete (htab_t);
168
+ extern void htab_empty (htab_t);
169
+
170
+ extern void * htab_find (htab_t, const void *);
171
+ extern void ** htab_find_slot (htab_t, const void *, enum insert_option);
172
+ extern void * htab_find_with_hash (htab_t, const void *, hashval_t);
173
+ extern void ** htab_find_slot_with_hash (htab_t, const void *,
174
+ hashval_t, enum insert_option);
175
+ extern void htab_clear_slot (htab_t, void **);
176
+ extern void htab_remove_elt (htab_t, void *);
177
+ extern void htab_remove_elt_with_hash (htab_t, void *, hashval_t);
178
+
179
+ extern void htab_traverse (htab_t, htab_trav, void *);
180
+ extern void htab_traverse_noresize (htab_t, htab_trav, void *);
181
+
182
+ extern size_t htab_size (htab_t);
183
+ extern size_t htab_elements (htab_t);
184
+ extern double htab_collisions (htab_t);
185
+
186
+ /* A hash function for pointers. */
187
+ extern htab_hash htab_hash_pointer;
188
+
189
+ /* An equality function for pointers. */
190
+ extern htab_eq htab_eq_pointer;
191
+
192
+ /* A hash function for null-terminated strings. */
193
+ extern hashval_t htab_hash_string (const void *);
194
+
195
+ /* An iterative hash function for arbitrary data. */
196
+ extern hashval_t iterative_hash (const void *, size_t, hashval_t);
197
+ /* Shorthand for hashing something with an intrinsic size. */
198
+ #define iterative_hash_object(OB,INIT) iterative_hash (&OB, sizeof (OB), INIT)
199
+
200
+ #ifdef __cplusplus
201
+ }
202
+ #endif /* __cplusplus */
203
+
204
+ #endif /* __HASHTAB_H */
hardware/tools/avr/include/libiberty/libiberty.h ADDED
@@ -0,0 +1,739 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Function declarations for libiberty.
2
+
3
+ Copyright (C) 1997-2015 Free Software Foundation, Inc.
4
+
5
+ Note - certain prototypes declared in this header file are for
6
+ functions whoes implementation copyright does not belong to the
7
+ FSF. Those prototypes are present in this file for reference
8
+ purposes only and their presence in this file should not construed
9
+ as an indication of ownership by the FSF of the implementation of
10
+ those functions in any way or form whatsoever.
11
+
12
+ This program is free software; you can redistribute it and/or modify
13
+ it under the terms of the GNU General Public License as published by
14
+ the Free Software Foundation; either version 2, or (at your option)
15
+ any later version.
16
+
17
+ This program is distributed in the hope that it will be useful,
18
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
19
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
+ GNU General Public License for more details.
21
+
22
+ You should have received a copy of the GNU General Public License
23
+ along with this program; if not, write to the Free Software
24
+ Foundation, Inc., 51 Franklin Street - Fifth Floor,
25
+ Boston, MA 02110-1301, USA.
26
+
27
+ Written by Cygnus Support, 1994.
28
+
29
+ The libiberty library provides a number of functions which are
30
+ missing on some operating systems. We do not declare those here,
31
+ to avoid conflicts with the system header files on operating
32
+ systems that do support those functions. In this file we only
33
+ declare those functions which are specific to libiberty. */
34
+
35
+ #ifndef LIBIBERTY_H
36
+ #define LIBIBERTY_H
37
+
38
+ #ifdef __cplusplus
39
+ extern "C" {
40
+ #endif
41
+
42
+ #include "ansidecl.h"
43
+
44
+ /* Get a definition for size_t. */
45
+ #include <stddef.h>
46
+ /* Get a definition for va_list. */
47
+ #include <stdarg.h>
48
+
49
+ #include <stdio.h>
50
+
51
+ /* If the OS supports it, ensure that the supplied stream is setup to
52
+ avoid any multi-threaded locking. Otherwise leave the FILE pointer
53
+ unchanged. If the stream is NULL do nothing. */
54
+
55
+ extern void unlock_stream (FILE *);
56
+
57
+ /* If the OS supports it, ensure that the standard I/O streams, stdin,
58
+ stdout and stderr are setup to avoid any multi-threaded locking.
59
+ Otherwise do nothing. */
60
+
61
+ extern void unlock_std_streams (void);
62
+
63
+ /* Open and return a FILE pointer. If the OS supports it, ensure that
64
+ the stream is setup to avoid any multi-threaded locking. Otherwise
65
+ return the FILE pointer unchanged. */
66
+
67
+ extern FILE *fopen_unlocked (const char *, const char *);
68
+ extern FILE *fdopen_unlocked (int, const char *);
69
+ extern FILE *freopen_unlocked (const char *, const char *, FILE *);
70
+
71
+ /* Build an argument vector from a string. Allocates memory using
72
+ malloc. Use freeargv to free the vector. */
73
+
74
+ extern char **buildargv (const char *) ATTRIBUTE_MALLOC;
75
+
76
+ /* Free a vector returned by buildargv. */
77
+
78
+ extern void freeargv (char **);
79
+
80
+ /* Duplicate an argument vector. Allocates memory using malloc. Use
81
+ freeargv to free the vector. */
82
+
83
+ extern char **dupargv (char **) ATTRIBUTE_MALLOC;
84
+
85
+ /* Expand "@file" arguments in argv. */
86
+
87
+ extern void expandargv (int *, char ***);
88
+
89
+ /* Write argv to an @-file, inserting necessary quoting. */
90
+
91
+ extern int writeargv (char **, FILE *);
92
+
93
+ /* Return the number of elements in argv. */
94
+
95
+ extern int countargv (char**);
96
+
97
+ /* Return the last component of a path name. Note that we can't use a
98
+ prototype here because the parameter is declared inconsistently
99
+ across different systems, sometimes as "char *" and sometimes as
100
+ "const char *" */
101
+
102
+ /* HAVE_DECL_* is a three-state macro: undefined, 0 or 1. If it is
103
+ undefined, we haven't run the autoconf check so provide the
104
+ declaration without arguments. If it is 0, we checked and failed
105
+ to find the declaration so provide a fully prototyped one. If it
106
+ is 1, we found it so don't provide any declaration at all. */
107
+ #if !HAVE_DECL_BASENAME
108
+ #if defined (__GNU_LIBRARY__ ) || defined (__linux__) \
109
+ || defined (__FreeBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) \
110
+ || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) \
111
+ || defined (__DragonFly__) || defined (HAVE_DECL_BASENAME)
112
+ extern char *basename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
113
+ #else
114
+ /* Do not allow basename to be used if there is no prototype seen. We
115
+ either need to use the above prototype or have one from
116
+ autoconf which would result in HAVE_DECL_BASENAME being set. */
117
+ #define basename basename_cannot_be_used_without_a_prototype
118
+ #endif
119
+ #endif
120
+
121
+ /* A well-defined basename () that is always compiled in. */
122
+
123
+ extern const char *lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
124
+
125
+ /* Same, but assumes DOS semantics (drive name, backslash is also a
126
+ dir separator) regardless of host. */
127
+
128
+ extern const char *dos_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
129
+
130
+ /* Same, but assumes Unix semantics (absolute paths always start with
131
+ a slash, only forward slash is accepted as dir separator)
132
+ regardless of host. */
133
+
134
+ extern const char *unix_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
135
+
136
+ /* A well-defined realpath () that is always compiled in. */
137
+
138
+ extern char *lrealpath (const char *);
139
+
140
+ /* Concatenate an arbitrary number of strings. You must pass NULL as
141
+ the last argument of this function, to terminate the list of
142
+ strings. Allocates memory using xmalloc. */
143
+
144
+ extern char *concat (const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
145
+
146
+ /* Concatenate an arbitrary number of strings. You must pass NULL as
147
+ the last argument of this function, to terminate the list of
148
+ strings. Allocates memory using xmalloc. The first argument is
149
+ not one of the strings to be concatenated, but if not NULL is a
150
+ pointer to be freed after the new string is created, similar to the
151
+ way xrealloc works. */
152
+
153
+ extern char *reconcat (char *, const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
154
+
155
+ /* Determine the length of concatenating an arbitrary number of
156
+ strings. You must pass NULL as the last argument of this function,
157
+ to terminate the list of strings. */
158
+
159
+ extern unsigned long concat_length (const char *, ...) ATTRIBUTE_SENTINEL;
160
+
161
+ /* Concatenate an arbitrary number of strings into a SUPPLIED area of
162
+ memory. You must pass NULL as the last argument of this function,
163
+ to terminate the list of strings. The supplied memory is assumed
164
+ to be large enough. */
165
+
166
+ extern char *concat_copy (char *, const char *, ...) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1) ATTRIBUTE_SENTINEL;
167
+
168
+ /* Concatenate an arbitrary number of strings into a GLOBAL area of
169
+ memory. You must pass NULL as the last argument of this function,
170
+ to terminate the list of strings. The supplied memory is assumed
171
+ to be large enough. */
172
+
173
+ extern char *concat_copy2 (const char *, ...) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_SENTINEL;
174
+
175
+ /* This is the global area used by concat_copy2. */
176
+
177
+ extern char *libiberty_concat_ptr;
178
+
179
+ /* Concatenate an arbitrary number of strings. You must pass NULL as
180
+ the last argument of this function, to terminate the list of
181
+ strings. Allocates memory using alloca. The arguments are
182
+ evaluated twice! */
183
+ #define ACONCAT(ACONCAT_PARAMS) \
184
+ (libiberty_concat_ptr = (char *) alloca (concat_length ACONCAT_PARAMS + 1), \
185
+ concat_copy2 ACONCAT_PARAMS)
186
+
187
+ /* Check whether two file descriptors refer to the same file. */
188
+
189
+ extern int fdmatch (int fd1, int fd2);
190
+
191
+ /* Return the position of the first bit set in the argument. */
192
+ /* Prototypes vary from system to system, so we only provide a
193
+ prototype on systems where we know that we need it. */
194
+ #if defined (HAVE_DECL_FFS) && !HAVE_DECL_FFS
195
+ extern int ffs(int);
196
+ #endif
197
+
198
+ /* Get the working directory. The result is cached, so don't call
199
+ chdir() between calls to getpwd(). */
200
+
201
+ extern char * getpwd (void);
202
+
203
+ /* Get the current time. */
204
+ /* Prototypes vary from system to system, so we only provide a
205
+ prototype on systems where we know that we need it. */
206
+ #ifdef __MINGW32__
207
+ /* Forward declaration to avoid #include <sys/time.h>. */
208
+ struct timeval;
209
+ extern int gettimeofday (struct timeval *, void *);
210
+ #endif
211
+
212
+ /* Get the amount of time the process has run, in microseconds. */
213
+
214
+ extern long get_run_time (void);
215
+
216
+ /* Generate a relocated path to some installation directory. Allocates
217
+ return value using malloc. */
218
+
219
+ extern char *make_relative_prefix (const char *, const char *,
220
+ const char *) ATTRIBUTE_MALLOC;
221
+
222
+ /* Generate a relocated path to some installation directory without
223
+ attempting to follow any soft links. Allocates
224
+ return value using malloc. */
225
+
226
+ extern char *make_relative_prefix_ignore_links (const char *, const char *,
227
+ const char *) ATTRIBUTE_MALLOC;
228
+
229
+ /* Returns a pointer to a directory path suitable for creating temporary
230
+ files in. */
231
+
232
+ extern const char *choose_tmpdir (void) ATTRIBUTE_RETURNS_NONNULL;
233
+
234
+ /* Choose a temporary directory to use for scratch files. */
235
+
236
+ extern char *choose_temp_base (void) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
237
+
238
+ /* Return a temporary file name or NULL if unable to create one. */
239
+
240
+ extern char *make_temp_file (const char *) ATTRIBUTE_MALLOC;
241
+
242
+ /* Remove a link to a file unless it is special. */
243
+
244
+ extern int unlink_if_ordinary (const char *);
245
+
246
+ /* Allocate memory filled with spaces. Allocates using malloc. */
247
+
248
+ extern const char *spaces (int count);
249
+
250
+ /* Return the maximum error number for which strerror will return a
251
+ string. */
252
+
253
+ extern int errno_max (void);
254
+
255
+ /* Return the name of an errno value (e.g., strerrno (EINVAL) returns
256
+ "EINVAL"). */
257
+
258
+ extern const char *strerrno (int);
259
+
260
+ /* Given the name of an errno value, return the value. */
261
+
262
+ extern int strtoerrno (const char *);
263
+
264
+ /* ANSI's strerror(), but more robust. */
265
+
266
+ extern char *xstrerror (int) ATTRIBUTE_RETURNS_NONNULL;
267
+
268
+ /* Return the maximum signal number for which strsignal will return a
269
+ string. */
270
+
271
+ extern int signo_max (void);
272
+
273
+ /* Return a signal message string for a signal number
274
+ (e.g., strsignal (SIGHUP) returns something like "Hangup"). */
275
+ /* This is commented out as it can conflict with one in system headers.
276
+ We still document its existence though. */
277
+
278
+ /*extern const char *strsignal (int);*/
279
+
280
+ /* Return the name of a signal number (e.g., strsigno (SIGHUP) returns
281
+ "SIGHUP"). */
282
+
283
+ extern const char *strsigno (int);
284
+
285
+ /* Given the name of a signal, return its number. */
286
+
287
+ extern int strtosigno (const char *);
288
+
289
+ /* Register a function to be run by xexit. Returns 0 on success. */
290
+
291
+ extern int xatexit (void (*fn) (void));
292
+
293
+ /* Exit, calling all the functions registered with xatexit. */
294
+
295
+ extern void xexit (int status) ATTRIBUTE_NORETURN;
296
+
297
+ /* Set the program name used by xmalloc. */
298
+
299
+ extern void xmalloc_set_program_name (const char *);
300
+
301
+ /* Report an allocation failure. */
302
+ extern void xmalloc_failed (size_t) ATTRIBUTE_NORETURN;
303
+
304
+ /* Allocate memory without fail. If malloc fails, this will print a
305
+ message to stderr (using the name set by xmalloc_set_program_name,
306
+ if any) and then call xexit. */
307
+
308
+ extern void *xmalloc (size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
309
+
310
+ /* Reallocate memory without fail. This works like xmalloc. Note,
311
+ realloc type functions are not suitable for attribute malloc since
312
+ they may return the same address across multiple calls. */
313
+
314
+ extern void *xrealloc (void *, size_t) ATTRIBUTE_RETURNS_NONNULL;
315
+
316
+ /* Allocate memory without fail and set it to zero. This works like
317
+ xmalloc. */
318
+
319
+ extern void *xcalloc (size_t, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
320
+
321
+ /* Copy a string into a memory buffer without fail. */
322
+
323
+ extern char *xstrdup (const char *) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
324
+
325
+ /* Copy at most N characters from string into a buffer without fail. */
326
+
327
+ extern char *xstrndup (const char *, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
328
+
329
+ /* Copy an existing memory buffer to a new memory buffer without fail. */
330
+
331
+ extern void *xmemdup (const void *, size_t, size_t) ATTRIBUTE_MALLOC ATTRIBUTE_RETURNS_NONNULL;
332
+
333
+ /* Physical memory routines. Return values are in BYTES. */
334
+ extern double physmem_total (void);
335
+ extern double physmem_available (void);
336
+
337
+ /* Compute the 32-bit CRC of a block of memory. */
338
+ extern unsigned int xcrc32 (const unsigned char *, int, unsigned int);
339
+
340
+ /* These macros provide a K&R/C89/C++-friendly way of allocating structures
341
+ with nice encapsulation. The XDELETE*() macros are technically
342
+ superfluous, but provided here for symmetry. Using them consistently
343
+ makes it easier to update client code to use different allocators such
344
+ as new/delete and new[]/delete[]. */
345
+
346
+ /* Scalar allocators. */
347
+
348
+ #define XALLOCA(T) ((T *) alloca (sizeof (T)))
349
+ #define XNEW(T) ((T *) xmalloc (sizeof (T)))
350
+ #define XCNEW(T) ((T *) xcalloc (1, sizeof (T)))
351
+ #define XDUP(T, P) ((T *) xmemdup ((P), sizeof (T), sizeof (T)))
352
+ #define XDELETE(P) free ((void*) (P))
353
+
354
+ /* Array allocators. */
355
+
356
+ #define XALLOCAVEC(T, N) ((T *) alloca (sizeof (T) * (N)))
357
+ #define XNEWVEC(T, N) ((T *) xmalloc (sizeof (T) * (N)))
358
+ #define XCNEWVEC(T, N) ((T *) xcalloc ((N), sizeof (T)))
359
+ #define XDUPVEC(T, P, N) ((T *) xmemdup ((P), sizeof (T) * (N), sizeof (T) * (N)))
360
+ #define XRESIZEVEC(T, P, N) ((T *) xrealloc ((void *) (P), sizeof (T) * (N)))
361
+ #define XDELETEVEC(P) free ((void*) (P))
362
+
363
+ /* Allocators for variable-sized structures and raw buffers. */
364
+
365
+ #define XALLOCAVAR(T, S) ((T *) alloca ((S)))
366
+ #define XNEWVAR(T, S) ((T *) xmalloc ((S)))
367
+ #define XCNEWVAR(T, S) ((T *) xcalloc (1, (S)))
368
+ #define XDUPVAR(T, P, S1, S2) ((T *) xmemdup ((P), (S1), (S2)))
369
+ #define XRESIZEVAR(T, P, S) ((T *) xrealloc ((P), (S)))
370
+
371
+ /* Type-safe obstack allocator. */
372
+
373
+ #define XOBNEW(O, T) ((T *) obstack_alloc ((O), sizeof (T)))
374
+ #define XOBNEWVEC(O, T, N) ((T *) obstack_alloc ((O), sizeof (T) * (N)))
375
+ #define XOBNEWVAR(O, T, S) ((T *) obstack_alloc ((O), (S)))
376
+ #define XOBFINISH(O, T) ((T) obstack_finish ((O)))
377
+
378
+ /* hex character manipulation routines */
379
+
380
+ #define _hex_array_size 256
381
+ #define _hex_bad 99
382
+ extern const unsigned char _hex_value[_hex_array_size];
383
+ extern void hex_init (void);
384
+ #define hex_p(c) (hex_value (c) != _hex_bad)
385
+ /* If you change this, note well: Some code relies on side effects in
386
+ the argument being performed exactly once. */
387
+ #define hex_value(c) ((unsigned int) _hex_value[(unsigned char) (c)])
388
+
389
+ /* Flags for pex_init. These are bits to be or'ed together. */
390
+
391
+ /* Record subprocess times, if possible. */
392
+ #define PEX_RECORD_TIMES 0x1
393
+
394
+ /* Use pipes for communication between processes, if possible. */
395
+ #define PEX_USE_PIPES 0x2
396
+
397
+ /* Save files used for communication between processes. */
398
+ #define PEX_SAVE_TEMPS 0x4
399
+
400
+ /* Prepare to execute one or more programs, with standard output of
401
+ each program fed to standard input of the next.
402
+ FLAGS As above.
403
+ PNAME The name of the program to report in error messages.
404
+ TEMPBASE A base name to use for temporary files; may be NULL to
405
+ use a random name.
406
+ Returns NULL on error. */
407
+
408
+ extern struct pex_obj *pex_init (int flags, const char *pname,
409
+ const char *tempbase) ATTRIBUTE_RETURNS_NONNULL;
410
+
411
+ /* Flags for pex_run. These are bits to be or'ed together. */
412
+
413
+ /* Last program in pipeline. Standard output of program goes to
414
+ OUTNAME, or, if OUTNAME is NULL, to standard output of caller. Do
415
+ not set this if you want to call pex_read_output. After this is
416
+ set, pex_run may no longer be called with the same struct
417
+ pex_obj. */
418
+ #define PEX_LAST 0x1
419
+
420
+ /* Search for program in executable search path. */
421
+ #define PEX_SEARCH 0x2
422
+
423
+ /* OUTNAME is a suffix. */
424
+ #define PEX_SUFFIX 0x4
425
+
426
+ /* Send program's standard error to standard output. */
427
+ #define PEX_STDERR_TO_STDOUT 0x8
428
+
429
+ /* Input file should be opened in binary mode. This flag is ignored
430
+ on Unix. */
431
+ #define PEX_BINARY_INPUT 0x10
432
+
433
+ /* Output file should be opened in binary mode. This flag is ignored
434
+ on Unix. For proper behaviour PEX_BINARY_INPUT and
435
+ PEX_BINARY_OUTPUT have to match appropriately--i.e., a call using
436
+ PEX_BINARY_OUTPUT should be followed by a call using
437
+ PEX_BINARY_INPUT. */
438
+ #define PEX_BINARY_OUTPUT 0x20
439
+
440
+ /* Capture stderr to a pipe. The output can be read by
441
+ calling pex_read_err and reading from the returned
442
+ FILE object. This flag may be specified only for
443
+ the last program in a pipeline.
444
+
445
+ This flag is supported only on Unix and Windows. */
446
+ #define PEX_STDERR_TO_PIPE 0x40
447
+
448
+ /* Capture stderr in binary mode. This flag is ignored
449
+ on Unix. */
450
+ #define PEX_BINARY_ERROR 0x80
451
+
452
+ /* Append stdout to existing file instead of truncating it. */
453
+ #define PEX_STDOUT_APPEND 0x100
454
+
455
+ /* Thes same as PEX_STDOUT_APPEND, but for STDERR. */
456
+ #define PEX_STDERR_APPEND 0x200
457
+
458
+ /* Execute one program. Returns NULL on success. On error returns an
459
+ error string (typically just the name of a system call); the error
460
+ string is statically allocated.
461
+
462
+ OBJ Returned by pex_init.
463
+
464
+ FLAGS As above.
465
+
466
+ EXECUTABLE The program to execute.
467
+
468
+ ARGV NULL terminated array of arguments to pass to the program.
469
+
470
+ OUTNAME Sets the output file name as follows:
471
+
472
+ PEX_SUFFIX set (OUTNAME may not be NULL):
473
+ TEMPBASE parameter to pex_init not NULL:
474
+ Output file name is the concatenation of TEMPBASE
475
+ and OUTNAME.
476
+ TEMPBASE is NULL:
477
+ Output file name is a random file name ending in
478
+ OUTNAME.
479
+ PEX_SUFFIX not set:
480
+ OUTNAME not NULL:
481
+ Output file name is OUTNAME.
482
+ OUTNAME NULL, TEMPBASE not NULL:
483
+ Output file name is randomly chosen using
484
+ TEMPBASE.
485
+ OUTNAME NULL, TEMPBASE NULL:
486
+ Output file name is randomly chosen.
487
+
488
+ If PEX_LAST is not set, the output file name is the
489
+ name to use for a temporary file holding stdout, if
490
+ any (there will not be a file if PEX_USE_PIPES is set
491
+ and the system supports pipes). If a file is used, it
492
+ will be removed when no longer needed unless
493
+ PEX_SAVE_TEMPS is set.
494
+
495
+ If PEX_LAST is set, and OUTNAME is not NULL, standard
496
+ output is written to the output file name. The file
497
+ will not be removed. If PEX_LAST and PEX_SUFFIX are
498
+ both set, TEMPBASE may not be NULL.
499
+
500
+ ERRNAME If not NULL, this is the name of a file to which
501
+ standard error is written. If NULL, standard error of
502
+ the program is standard error of the caller.
503
+
504
+ ERR On an error return, *ERR is set to an errno value, or
505
+ to 0 if there is no relevant errno.
506
+ */
507
+
508
+ extern const char *pex_run (struct pex_obj *obj, int flags,
509
+ const char *executable, char * const *argv,
510
+ const char *outname, const char *errname,
511
+ int *err);
512
+
513
+ /* As for pex_run (), but takes an extra parameter to enable the
514
+ environment for the child process to be specified.
515
+
516
+ ENV The environment for the child process, specified as
517
+ an array of character pointers. Each element of the
518
+ array should point to a string of the form VAR=VALUE,
519
+ with the exception of the last element which must be
520
+ a null pointer.
521
+ */
522
+
523
+ extern const char *pex_run_in_environment (struct pex_obj *obj, int flags,
524
+ const char *executable,
525
+ char * const *argv,
526
+ char * const *env,
527
+ const char *outname,
528
+ const char *errname, int *err);
529
+
530
+ /* Return a stream for a temporary file to pass to the first program
531
+ in the pipeline as input. The file name is chosen as for pex_run.
532
+ pex_run closes the file automatically; don't close it yourself. */
533
+
534
+ extern FILE *pex_input_file (struct pex_obj *obj, int flags,
535
+ const char *in_name);
536
+
537
+ /* Return a stream for a pipe connected to the standard input of the
538
+ first program in the pipeline. You must have passed
539
+ `PEX_USE_PIPES' to `pex_init'. Close the returned stream
540
+ yourself. */
541
+
542
+ extern FILE *pex_input_pipe (struct pex_obj *obj, int binary);
543
+
544
+ /* Read the standard output of the last program to be executed.
545
+ pex_run can not be called after this. BINARY should be non-zero if
546
+ the file should be opened in binary mode; this is ignored on Unix.
547
+ Returns NULL on error. Don't call fclose on the returned FILE; it
548
+ will be closed by pex_free. */
549
+
550
+ extern FILE *pex_read_output (struct pex_obj *, int binary);
551
+
552
+ /* Read the standard error of the last program to be executed.
553
+ pex_run can not be called after this. BINARY should be non-zero if
554
+ the file should be opened in binary mode; this is ignored on Unix.
555
+ Returns NULL on error. Don't call fclose on the returned FILE; it
556
+ will be closed by pex_free. */
557
+
558
+ extern FILE *pex_read_err (struct pex_obj *, int binary);
559
+
560
+ /* Return exit status of all programs in VECTOR. COUNT indicates the
561
+ size of VECTOR. The status codes in the vector are in the order of
562
+ the calls to pex_run. Returns 0 on error, 1 on success. */
563
+
564
+ extern int pex_get_status (struct pex_obj *, int count, int *vector);
565
+
566
+ /* Return times of all programs in VECTOR. COUNT indicates the size
567
+ of VECTOR. struct pex_time is really just struct timeval, but that
568
+ is not portable to all systems. Returns 0 on error, 1 on
569
+ success. */
570
+
571
+ struct pex_time
572
+ {
573
+ unsigned long user_seconds;
574
+ unsigned long user_microseconds;
575
+ unsigned long system_seconds;
576
+ unsigned long system_microseconds;
577
+ };
578
+
579
+ extern int pex_get_times (struct pex_obj *, int count,
580
+ struct pex_time *vector);
581
+
582
+ /* Clean up a pex_obj. If you have not called pex_get_times or
583
+ pex_get_status, this will try to kill the subprocesses. */
584
+
585
+ extern void pex_free (struct pex_obj *);
586
+
587
+ /* Just execute one program. Return value is as for pex_run.
588
+ FLAGS Combination of PEX_SEARCH and PEX_STDERR_TO_STDOUT.
589
+ EXECUTABLE As for pex_run.
590
+ ARGV As for pex_run.
591
+ PNAME As for pex_init.
592
+ OUTNAME As for pex_run when PEX_LAST is set.
593
+ ERRNAME As for pex_run.
594
+ STATUS Set to exit status on success.
595
+ ERR As for pex_run.
596
+ */
597
+
598
+ extern const char *pex_one (int flags, const char *executable,
599
+ char * const *argv, const char *pname,
600
+ const char *outname, const char *errname,
601
+ int *status, int *err);
602
+
603
+ /* pexecute and pwait are the old pexecute interface, still here for
604
+ backward compatibility. Don't use these for new code. Instead,
605
+ use pex_init/pex_run/pex_get_status/pex_free, or pex_one. */
606
+
607
+ /* Definitions used by the pexecute routine. */
608
+
609
+ #define PEXECUTE_FIRST 1
610
+ #define PEXECUTE_LAST 2
611
+ #define PEXECUTE_ONE (PEXECUTE_FIRST + PEXECUTE_LAST)
612
+ #define PEXECUTE_SEARCH 4
613
+ #define PEXECUTE_VERBOSE 8
614
+
615
+ /* Execute a program. */
616
+
617
+ extern int pexecute (const char *, char * const *, const char *,
618
+ const char *, char **, char **, int);
619
+
620
+ /* Wait for pexecute to finish. */
621
+
622
+ extern int pwait (int, int *, int);
623
+
624
+ #if defined(HAVE_DECL_ASPRINTF) && !HAVE_DECL_ASPRINTF
625
+ /* Like sprintf but provides a pointer to malloc'd storage, which must
626
+ be freed by the caller. */
627
+
628
+ extern int asprintf (char **, const char *, ...) ATTRIBUTE_PRINTF_2;
629
+ #endif
630
+
631
+ /* Like asprintf but allocates memory without fail. This works like
632
+ xmalloc. */
633
+
634
+ extern char *xasprintf (const char *, ...) ATTRIBUTE_MALLOC ATTRIBUTE_PRINTF_1;
635
+
636
+ #if !HAVE_DECL_VASPRINTF
637
+ /* Like vsprintf but provides a pointer to malloc'd storage, which
638
+ must be freed by the caller. */
639
+
640
+ extern int vasprintf (char **, const char *, va_list) ATTRIBUTE_PRINTF(2,0);
641
+ #endif
642
+
643
+ /* Like vasprintf but allocates memory without fail. This works like
644
+ xmalloc. */
645
+
646
+ extern char *xvasprintf (const char *, va_list) ATTRIBUTE_MALLOC ATTRIBUTE_PRINTF(1,0);
647
+
648
+ #if defined(HAVE_DECL_SNPRINTF) && !HAVE_DECL_SNPRINTF
649
+ /* Like sprintf but prints at most N characters. */
650
+ extern int snprintf (char *, size_t, const char *, ...) ATTRIBUTE_PRINTF_3;
651
+ #endif
652
+
653
+ #if defined(HAVE_DECL_VSNPRINTF) && !HAVE_DECL_VSNPRINTF
654
+ /* Like vsprintf but prints at most N characters. */
655
+ extern int vsnprintf (char *, size_t, const char *, va_list) ATTRIBUTE_PRINTF(3,0);
656
+ #endif
657
+
658
+ #if defined (HAVE_DECL_STRNLEN) && !HAVE_DECL_STRNLEN
659
+ extern size_t strnlen (const char *, size_t);
660
+ #endif
661
+
662
+ #if defined(HAVE_DECL_STRVERSCMP) && !HAVE_DECL_STRVERSCMP
663
+ /* Compare version strings. */
664
+ extern int strverscmp (const char *, const char *);
665
+ #endif
666
+
667
+ #if defined(HAVE_DECL_STRTOL) && !HAVE_DECL_STRTOL
668
+ extern long int strtol (const char *nptr,
669
+ char **endptr, int base);
670
+ #endif
671
+
672
+ #if defined(HAVE_DECL_STRTOUL) && !HAVE_DECL_STRTOUL
673
+ extern unsigned long int strtoul (const char *nptr,
674
+ char **endptr, int base);
675
+ #endif
676
+
677
+ #if defined(HAVE_LONG_LONG) && defined(HAVE_DECL_STRTOLL) && !HAVE_DECL_STRTOLL
678
+ __extension__
679
+ extern long long int strtoll (const char *nptr,
680
+ char **endptr, int base);
681
+ #endif
682
+
683
+ #if defined(HAVE_LONG_LONG) && defined(HAVE_DECL_STRTOULL) && !HAVE_DECL_STRTOULL
684
+ __extension__
685
+ extern unsigned long long int strtoull (const char *nptr,
686
+ char **endptr, int base);
687
+ #endif
688
+
689
+ #if defined(HAVE_DECL_STRVERSCMP) && !HAVE_DECL_STRVERSCMP
690
+ /* Compare version strings. */
691
+ extern int strverscmp (const char *, const char *);
692
+ #endif
693
+
694
+ /* Set the title of a process */
695
+ extern void setproctitle (const char *name, ...);
696
+
697
+ /* Increase stack limit if possible. */
698
+ extern void stack_limit_increase (unsigned long);
699
+
700
+ #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
701
+
702
+ /* Drastically simplified alloca configurator. If we're using GCC,
703
+ we use __builtin_alloca; otherwise we use the C alloca. The C
704
+ alloca is always available. You can override GCC by defining
705
+ USE_C_ALLOCA yourself. The canonical autoconf macro C_ALLOCA is
706
+ also set/unset as it is often used to indicate whether code needs
707
+ to call alloca(0). */
708
+ extern void *C_alloca (size_t) ATTRIBUTE_MALLOC;
709
+ #undef alloca
710
+ #if GCC_VERSION >= 2000 && !defined USE_C_ALLOCA
711
+ # define alloca(x) __builtin_alloca(x)
712
+ # undef C_ALLOCA
713
+ # define ASTRDUP(X) \
714
+ (__extension__ ({ const char *const libiberty_optr = (X); \
715
+ const unsigned long libiberty_len = strlen (libiberty_optr) + 1; \
716
+ char *const libiberty_nptr = (char *const) alloca (libiberty_len); \
717
+ (char *) memcpy (libiberty_nptr, libiberty_optr, libiberty_len); }))
718
+ #else
719
+ # define alloca(x) C_alloca(x)
720
+ # undef USE_C_ALLOCA
721
+ # define USE_C_ALLOCA 1
722
+ # undef C_ALLOCA
723
+ # define C_ALLOCA 1
724
+ extern const char *libiberty_optr;
725
+ extern char *libiberty_nptr;
726
+ extern unsigned long libiberty_len;
727
+ # define ASTRDUP(X) \
728
+ (libiberty_optr = (X), \
729
+ libiberty_len = strlen (libiberty_optr) + 1, \
730
+ libiberty_nptr = (char *) alloca (libiberty_len), \
731
+ (char *) memcpy (libiberty_nptr, libiberty_optr, libiberty_len))
732
+ #endif
733
+
734
+ #ifdef __cplusplus
735
+ }
736
+ #endif
737
+
738
+
739
+ #endif /* ! defined (LIBIBERTY_H) */
hardware/tools/avr/include/libiberty/objalloc.h ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* objalloc.h -- routines to allocate memory for objects
2
+ Copyright (C) 1997-2015 Free Software Foundation, Inc.
3
+ Written by Ian Lance Taylor, Cygnus Solutions.
4
+
5
+ This program is free software; you can redistribute it and/or modify it
6
+ under the terms of the GNU General Public License as published by the
7
+ Free Software Foundation; either version 2, or (at your option) any
8
+ later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, 51 Franklin Street - Fifth Floor,
18
+ Boston, MA 02110-1301, USA. */
19
+
20
+ #ifndef OBJALLOC_H
21
+ #define OBJALLOC_H
22
+
23
+ #include "ansidecl.h"
24
+
25
+ /* These routines allocate space for an object. The assumption is
26
+ that the object will want to allocate space as it goes along, but
27
+ will never want to free any particular block. There is a function
28
+ to free a block, which also frees all more recently allocated
29
+ blocks. There is also a function to free all the allocated space.
30
+
31
+ This is essentially a specialization of obstacks. The main
32
+ difference is that a block may not be allocated a bit at a time.
33
+ Another difference is that these routines are always built on top
34
+ of malloc, and always pass an malloc failure back to the caller,
35
+ unlike more recent versions of obstacks. */
36
+
37
+ /* This is what an objalloc structure looks like. Callers should not
38
+ refer to these fields, nor should they allocate these structure
39
+ themselves. Instead, they should only create them via
40
+ objalloc_init, and only access them via the functions and macros
41
+ listed below. The structure is only defined here so that we can
42
+ access it via macros. */
43
+
44
+ struct objalloc
45
+ {
46
+ char *current_ptr;
47
+ unsigned int current_space;
48
+ void *chunks;
49
+ };
50
+
51
+ /* Work out the required alignment. */
52
+
53
+ struct objalloc_align { char x; double d; };
54
+
55
+ #if defined (__STDC__) && __STDC__
56
+ #ifndef offsetof
57
+ #include <stddef.h>
58
+ #endif
59
+ #endif
60
+ #ifndef offsetof
61
+ #define offsetof(TYPE, MEMBER) ((unsigned long) &((TYPE *)0)->MEMBER)
62
+ #endif
63
+ #define OBJALLOC_ALIGN offsetof (struct objalloc_align, d)
64
+
65
+ /* Create an objalloc structure. Returns NULL if malloc fails. */
66
+
67
+ extern struct objalloc *objalloc_create (void);
68
+
69
+ /* Allocate space from an objalloc structure. Returns NULL if malloc
70
+ fails. */
71
+
72
+ extern void *_objalloc_alloc (struct objalloc *, unsigned long);
73
+
74
+ /* The macro version of objalloc_alloc. We only define this if using
75
+ gcc, because otherwise we would have to evaluate the arguments
76
+ multiple times, or use a temporary field as obstack.h does. */
77
+
78
+ #if defined (__GNUC__) && defined (__STDC__) && __STDC__
79
+
80
+ /* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
81
+ does not implement __extension__. But that compiler doesn't define
82
+ __GNUC_MINOR__. */
83
+ #if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
84
+ #define __extension__
85
+ #endif
86
+
87
+ #define objalloc_alloc(o, l) \
88
+ __extension__ \
89
+ ({ struct objalloc *__o = (o); \
90
+ unsigned long __len = (l); \
91
+ if (__len == 0) \
92
+ __len = 1; \
93
+ __len = (__len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); \
94
+ (__len != 0 && __len <= __o->current_space \
95
+ ? (__o->current_ptr += __len, \
96
+ __o->current_space -= __len, \
97
+ (void *) (__o->current_ptr - __len)) \
98
+ : _objalloc_alloc (__o, __len)); })
99
+
100
+ #else /* ! __GNUC__ */
101
+
102
+ #define objalloc_alloc(o, l) _objalloc_alloc ((o), (l))
103
+
104
+ #endif /* ! __GNUC__ */
105
+
106
+ /* Free an entire objalloc structure. */
107
+
108
+ extern void objalloc_free (struct objalloc *);
109
+
110
+ /* Free a block allocated by objalloc_alloc. This also frees all more
111
+ recently allocated blocks. */
112
+
113
+ extern void objalloc_free_block (struct objalloc *, void *);
114
+
115
+ #endif /* OBJALLOC_H */
hardware/tools/avr/include/libiberty/partition.h ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* List implementation of a partition of consecutive integers.
2
+ Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
3
+ Contributed by CodeSourcery, LLC.
4
+
5
+ This file is part of GCC.
6
+
7
+ GCC is free software; you can redistribute it and/or modify
8
+ it under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation; either version 2, or (at your option)
10
+ any later version.
11
+
12
+ GCC is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ GNU General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with GCC; see the file COPYING. If not, write to
19
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor,
20
+ Boston, MA 02110-1301, USA. */
21
+
22
+ /* This package implements a partition of consecutive integers. The
23
+ elements are partitioned into classes. Each class is represented
24
+ by one of its elements, the canonical element, which is chosen
25
+ arbitrarily from elements in the class. The principal operations
26
+ on a partition are FIND, which takes an element, determines its
27
+ class, and returns the canonical element for that class, and UNION,
28
+ which unites the two classes that contain two given elements into a
29
+ single class.
30
+
31
+ The list implementation used here provides constant-time finds. By
32
+ storing the size of each class with the class's canonical element,
33
+ it is able to perform unions over all the classes in the partition
34
+ in O (N log N) time. */
35
+
36
+ #ifndef _PARTITION_H
37
+ #define _PARTITION_H
38
+
39
+ #ifdef __cplusplus
40
+ extern "C" {
41
+ #endif /* __cplusplus */
42
+
43
+ #include "ansidecl.h"
44
+ #include <stdio.h>
45
+
46
+ struct partition_elem
47
+ {
48
+ /* The next element in this class. Elements in each class form a
49
+ circular list. */
50
+ struct partition_elem* next;
51
+ /* The canonical element that represents the class containing this
52
+ element. */
53
+ int class_element;
54
+ /* The number of elements in this class. Valid only if this is the
55
+ canonical element for its class. */
56
+ unsigned class_count;
57
+ };
58
+
59
+ typedef struct partition_def
60
+ {
61
+ /* The number of elements in this partition. */
62
+ int num_elements;
63
+ /* The elements in the partition. */
64
+ struct partition_elem elements[1];
65
+ } *partition;
66
+
67
+ extern partition partition_new (int);
68
+ extern void partition_delete (partition);
69
+ extern int partition_union (partition, int, int);
70
+ extern void partition_print (partition, FILE*);
71
+
72
+ /* Returns the canonical element corresponding to the class containing
73
+ ELEMENT__ in PARTITION__. */
74
+
75
+ #define partition_find(partition__, element__) \
76
+ ((partition__)->elements[(element__)].class_element)
77
+
78
+ #ifdef __cplusplus
79
+ }
80
+ #endif /* __cplusplus */
81
+
82
+ #endif /* _PARTITION_H */
hardware/tools/avr/include/libiberty/safe-ctype.h ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* <ctype.h> replacement macros.
2
+
3
+ Copyright (C) 2000-2015 Free Software Foundation, Inc.
4
+ Contributed by Zack Weinberg <zackw@stanford.edu>.
5
+
6
+ This file is part of the libiberty library.
7
+ Libiberty is free software; you can redistribute it and/or
8
+ modify it under the terms of the GNU Library General Public
9
+ License as published by the Free Software Foundation; either
10
+ version 2 of the License, or (at your option) any later version.
11
+
12
+ Libiberty is distributed in the hope that it will be useful,
13
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ Library General Public License for more details.
16
+
17
+ You should have received a copy of the GNU Library General Public
18
+ License along with libiberty; see the file COPYING.LIB. If
19
+ not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
20
+ Boston, MA 02110-1301, USA. */
21
+
22
+ /* This is a compatible replacement of the standard C library's <ctype.h>
23
+ with the following properties:
24
+
25
+ - Implements all isxxx() macros required by C99.
26
+ - Also implements some character classes useful when
27
+ parsing C-like languages.
28
+ - Does not change behavior depending on the current locale.
29
+ - Behaves properly for all values in the range of a signed or
30
+ unsigned char.
31
+
32
+ To avoid conflicts, this header defines the isxxx functions in upper
33
+ case, e.g. ISALPHA not isalpha. */
34
+
35
+ #ifndef SAFE_CTYPE_H
36
+ #define SAFE_CTYPE_H
37
+
38
+ /* Determine host character set. */
39
+ #define HOST_CHARSET_UNKNOWN 0
40
+ #define HOST_CHARSET_ASCII 1
41
+ #define HOST_CHARSET_EBCDIC 2
42
+
43
+ #if '\n' == 0x0A && ' ' == 0x20 && '0' == 0x30 \
44
+ && 'A' == 0x41 && 'a' == 0x61 && '!' == 0x21
45
+ # define HOST_CHARSET HOST_CHARSET_ASCII
46
+ #else
47
+ # if '\n' == 0x15 && ' ' == 0x40 && '0' == 0xF0 \
48
+ && 'A' == 0xC1 && 'a' == 0x81 && '!' == 0x5A
49
+ # define HOST_CHARSET HOST_CHARSET_EBCDIC
50
+ # else
51
+ # define HOST_CHARSET HOST_CHARSET_UNKNOWN
52
+ # endif
53
+ #endif
54
+
55
+ /* Categories. */
56
+
57
+ enum {
58
+ /* In C99 */
59
+ _sch_isblank = 0x0001, /* space \t */
60
+ _sch_iscntrl = 0x0002, /* nonprinting characters */
61
+ _sch_isdigit = 0x0004, /* 0-9 */
62
+ _sch_islower = 0x0008, /* a-z */
63
+ _sch_isprint = 0x0010, /* any printing character including ' ' */
64
+ _sch_ispunct = 0x0020, /* all punctuation */
65
+ _sch_isspace = 0x0040, /* space \t \n \r \f \v */
66
+ _sch_isupper = 0x0080, /* A-Z */
67
+ _sch_isxdigit = 0x0100, /* 0-9A-Fa-f */
68
+
69
+ /* Extra categories useful to cpplib. */
70
+ _sch_isidst = 0x0200, /* A-Za-z_ */
71
+ _sch_isvsp = 0x0400, /* \n \r */
72
+ _sch_isnvsp = 0x0800, /* space \t \f \v \0 */
73
+
74
+ /* Combinations of the above. */
75
+ _sch_isalpha = _sch_isupper|_sch_islower, /* A-Za-z */
76
+ _sch_isalnum = _sch_isalpha|_sch_isdigit, /* A-Za-z0-9 */
77
+ _sch_isidnum = _sch_isidst|_sch_isdigit, /* A-Za-z0-9_ */
78
+ _sch_isgraph = _sch_isalnum|_sch_ispunct, /* isprint and not space */
79
+ _sch_iscppsp = _sch_isvsp|_sch_isnvsp, /* isspace + \0 */
80
+ _sch_isbasic = _sch_isprint|_sch_iscppsp /* basic charset of ISO C
81
+ (plus ` and @) */
82
+ };
83
+
84
+ /* Character classification. */
85
+ extern const unsigned short _sch_istable[256];
86
+
87
+ #define _sch_test(c, bit) (_sch_istable[(c) & 0xff] & (unsigned short)(bit))
88
+
89
+ #define ISALPHA(c) _sch_test(c, _sch_isalpha)
90
+ #define ISALNUM(c) _sch_test(c, _sch_isalnum)
91
+ #define ISBLANK(c) _sch_test(c, _sch_isblank)
92
+ #define ISCNTRL(c) _sch_test(c, _sch_iscntrl)
93
+ #define ISDIGIT(c) _sch_test(c, _sch_isdigit)
94
+ #define ISGRAPH(c) _sch_test(c, _sch_isgraph)
95
+ #define ISLOWER(c) _sch_test(c, _sch_islower)
96
+ #define ISPRINT(c) _sch_test(c, _sch_isprint)
97
+ #define ISPUNCT(c) _sch_test(c, _sch_ispunct)
98
+ #define ISSPACE(c) _sch_test(c, _sch_isspace)
99
+ #define ISUPPER(c) _sch_test(c, _sch_isupper)
100
+ #define ISXDIGIT(c) _sch_test(c, _sch_isxdigit)
101
+
102
+ #define ISIDNUM(c) _sch_test(c, _sch_isidnum)
103
+ #define ISIDST(c) _sch_test(c, _sch_isidst)
104
+ #define IS_ISOBASIC(c) _sch_test(c, _sch_isbasic)
105
+ #define IS_VSPACE(c) _sch_test(c, _sch_isvsp)
106
+ #define IS_NVSPACE(c) _sch_test(c, _sch_isnvsp)
107
+ #define IS_SPACE_OR_NUL(c) _sch_test(c, _sch_iscppsp)
108
+
109
+ /* Character transformation. */
110
+ extern const unsigned char _sch_toupper[256];
111
+ extern const unsigned char _sch_tolower[256];
112
+ #define TOUPPER(c) _sch_toupper[(c) & 0xff]
113
+ #define TOLOWER(c) _sch_tolower[(c) & 0xff]
114
+
115
+ /* Prevent the users of safe-ctype.h from accidently using the routines
116
+ from ctype.h. Initially, the approach was to produce an error when
117
+ detecting that ctype.h has been included. But this was causing
118
+ trouble as ctype.h might get indirectly included as a result of
119
+ including another system header (for instance gnulib's stdint.h).
120
+ So we include ctype.h here and then immediately redefine its macros. */
121
+
122
+ #include <ctype.h>
123
+ #undef isalpha
124
+ #define isalpha(c) do_not_use_isalpha_with_safe_ctype
125
+ #undef isalnum
126
+ #define isalnum(c) do_not_use_isalnum_with_safe_ctype
127
+ #undef iscntrl
128
+ #define iscntrl(c) do_not_use_iscntrl_with_safe_ctype
129
+ #undef isdigit
130
+ #define isdigit(c) do_not_use_isdigit_with_safe_ctype
131
+ #undef isgraph
132
+ #define isgraph(c) do_not_use_isgraph_with_safe_ctype
133
+ #undef islower
134
+ #define islower(c) do_not_use_islower_with_safe_ctype
135
+ #undef isprint
136
+ #define isprint(c) do_not_use_isprint_with_safe_ctype
137
+ #undef ispunct
138
+ #define ispunct(c) do_not_use_ispunct_with_safe_ctype
139
+ #undef isspace
140
+ #define isspace(c) do_not_use_isspace_with_safe_ctype
141
+ #undef isupper
142
+ #define isupper(c) do_not_use_isupper_with_safe_ctype
143
+ #undef isxdigit
144
+ #define isxdigit(c) do_not_use_isxdigit_with_safe_ctype
145
+ #undef toupper
146
+ #define toupper(c) do_not_use_toupper_with_safe_ctype
147
+ #undef tolower
148
+ #define tolower(c) do_not_use_tolower_with_safe_ctype
149
+
150
+ #endif /* SAFE_CTYPE_H */
hardware/tools/avr/include/libiberty/sort.h ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Sorting algorithms.
2
+ Copyright (C) 2000-2015 Free Software Foundation, Inc.
3
+ Contributed by Mark Mitchell <mark@codesourcery.com>.
4
+
5
+ This file is part of GCC.
6
+
7
+ GCC is free software; you can redistribute it and/or modify it
8
+ under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation; either version 2, or (at your option)
10
+ any later version.
11
+
12
+ GCC is distributed in the hope that it will be useful, but
13
+ WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with GCC; see the file COPYING. If not, write to
19
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor,
20
+ Boston, MA 02110-1301, USA. */
21
+
22
+ #ifndef SORT_H
23
+ #define SORT_H
24
+
25
+ #include <sys/types.h> /* For size_t */
26
+ #ifdef __STDC__
27
+ #include <stddef.h>
28
+ #endif /* __STDC__ */
29
+
30
+ #ifdef __cplusplus
31
+ extern "C" {
32
+ #endif /* __cplusplus */
33
+
34
+ #include "ansidecl.h"
35
+
36
+ /* Sort an array of pointers. */
37
+
38
+ extern void sort_pointers (size_t, void **, void **);
39
+
40
+ #ifdef __cplusplus
41
+ }
42
+ #endif /* __cplusplus */
43
+
44
+ #endif /* SORT_H */
45
+
46
+
47
+
48
+
hardware/tools/avr/include/libiberty/splay-tree.h ADDED
@@ -0,0 +1,156 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* A splay-tree datatype.
2
+ Copyright (C) 1998-2015 Free Software Foundation, Inc.
3
+ Contributed by Mark Mitchell (mark@markmitchell.com).
4
+
5
+ This file is part of GCC.
6
+
7
+ GCC is free software; you can redistribute it and/or modify it
8
+ under the terms of the GNU General Public License as published by
9
+ the Free Software Foundation; either version 2, or (at your option)
10
+ any later version.
11
+
12
+ GCC is distributed in the hope that it will be useful, but
13
+ WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
+ General Public License for more details.
16
+
17
+ You should have received a copy of the GNU General Public License
18
+ along with GCC; see the file COPYING. If not, write to
19
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor,
20
+ Boston, MA 02110-1301, USA. */
21
+
22
+ /* For an easily readable description of splay-trees, see:
23
+
24
+ Lewis, Harry R. and Denenberg, Larry. Data Structures and Their
25
+ Algorithms. Harper-Collins, Inc. 1991.
26
+
27
+ The major feature of splay trees is that all basic tree operations
28
+ are amortized O(log n) time for a tree with n nodes. */
29
+
30
+ #ifndef _SPLAY_TREE_H
31
+ #define _SPLAY_TREE_H
32
+
33
+ #ifdef __cplusplus
34
+ extern "C" {
35
+ #endif /* __cplusplus */
36
+
37
+ #include "ansidecl.h"
38
+
39
+ #ifdef HAVE_STDINT_H
40
+ #include <stdint.h>
41
+ #endif
42
+ #ifdef HAVE_INTTYPES_H
43
+ #include <inttypes.h>
44
+ #endif
45
+
46
+ /* Use typedefs for the key and data types to facilitate changing
47
+ these types, if necessary. These types should be sufficiently wide
48
+ that any pointer or scalar can be cast to these types, and then
49
+ cast back, without loss of precision. */
50
+ typedef uintptr_t splay_tree_key;
51
+ typedef uintptr_t splay_tree_value;
52
+
53
+ /* Forward declaration for a node in the tree. */
54
+ typedef struct splay_tree_node_s *splay_tree_node;
55
+
56
+ /* The type of a function which compares two splay-tree keys. The
57
+ function should return values as for qsort. */
58
+ typedef int (*splay_tree_compare_fn) (splay_tree_key, splay_tree_key);
59
+
60
+ /* The type of a function used to deallocate any resources associated
61
+ with the key. */
62
+ typedef void (*splay_tree_delete_key_fn) (splay_tree_key);
63
+
64
+ /* The type of a function used to deallocate any resources associated
65
+ with the value. */
66
+ typedef void (*splay_tree_delete_value_fn) (splay_tree_value);
67
+
68
+ /* The type of a function used to iterate over the tree. */
69
+ typedef int (*splay_tree_foreach_fn) (splay_tree_node, void*);
70
+
71
+ /* The type of a function used to allocate memory for tree root and
72
+ node structures. The first argument is the number of bytes needed;
73
+ the second is a data pointer the splay tree functions pass through
74
+ to the allocator. This function must never return zero. */
75
+ typedef void *(*splay_tree_allocate_fn) (int, void *);
76
+
77
+ /* The type of a function used to free memory allocated using the
78
+ corresponding splay_tree_allocate_fn. The first argument is the
79
+ memory to be freed; the latter is a data pointer the splay tree
80
+ functions pass through to the freer. */
81
+ typedef void (*splay_tree_deallocate_fn) (void *, void *);
82
+
83
+ /* The nodes in the splay tree. */
84
+ struct splay_tree_node_s {
85
+ /* The key. */
86
+ splay_tree_key key;
87
+
88
+ /* The value. */
89
+ splay_tree_value value;
90
+
91
+ /* The left and right children, respectively. */
92
+ splay_tree_node left;
93
+ splay_tree_node right;
94
+ };
95
+
96
+ /* The splay tree itself. */
97
+ struct splay_tree_s {
98
+ /* The root of the tree. */
99
+ splay_tree_node root;
100
+
101
+ /* The comparision function. */
102
+ splay_tree_compare_fn comp;
103
+
104
+ /* The deallocate-key function. NULL if no cleanup is necessary. */
105
+ splay_tree_delete_key_fn delete_key;
106
+
107
+ /* The deallocate-value function. NULL if no cleanup is necessary. */
108
+ splay_tree_delete_value_fn delete_value;
109
+
110
+ /* Node allocate function. Takes allocate_data as a parameter. */
111
+ splay_tree_allocate_fn allocate;
112
+
113
+ /* Free function for nodes and trees. Takes allocate_data as a parameter. */
114
+ splay_tree_deallocate_fn deallocate;
115
+
116
+ /* Parameter for allocate/free functions. */
117
+ void *allocate_data;
118
+ };
119
+
120
+ typedef struct splay_tree_s *splay_tree;
121
+
122
+ extern splay_tree splay_tree_new (splay_tree_compare_fn,
123
+ splay_tree_delete_key_fn,
124
+ splay_tree_delete_value_fn);
125
+ extern splay_tree splay_tree_new_with_allocator (splay_tree_compare_fn,
126
+ splay_tree_delete_key_fn,
127
+ splay_tree_delete_value_fn,
128
+ splay_tree_allocate_fn,
129
+ splay_tree_deallocate_fn,
130
+ void *);
131
+ extern splay_tree splay_tree_new_typed_alloc (splay_tree_compare_fn,
132
+ splay_tree_delete_key_fn,
133
+ splay_tree_delete_value_fn,
134
+ splay_tree_allocate_fn,
135
+ splay_tree_allocate_fn,
136
+ splay_tree_deallocate_fn,
137
+ void *);
138
+ extern void splay_tree_delete (splay_tree);
139
+ extern splay_tree_node splay_tree_insert (splay_tree,
140
+ splay_tree_key,
141
+ splay_tree_value);
142
+ extern void splay_tree_remove (splay_tree, splay_tree_key);
143
+ extern splay_tree_node splay_tree_lookup (splay_tree, splay_tree_key);
144
+ extern splay_tree_node splay_tree_predecessor (splay_tree, splay_tree_key);
145
+ extern splay_tree_node splay_tree_successor (splay_tree, splay_tree_key);
146
+ extern splay_tree_node splay_tree_max (splay_tree);
147
+ extern splay_tree_node splay_tree_min (splay_tree);
148
+ extern int splay_tree_foreach (splay_tree, splay_tree_foreach_fn, void*);
149
+ extern int splay_tree_compare_ints (splay_tree_key, splay_tree_key);
150
+ extern int splay_tree_compare_pointers (splay_tree_key, splay_tree_key);
151
+
152
+ #ifdef __cplusplus
153
+ }
154
+ #endif /* __cplusplus */
155
+
156
+ #endif /* _SPLAY_TREE_H */
hardware/tools/avr/include/libiberty/timeval-utils.h ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Basic struct timeval utilities.
2
+ Copyright (C) 2011-2015 Free Software Foundation, Inc.
3
+
4
+ This file is part of the libiberty library.
5
+ Libiberty is free software; you can redistribute it and/or
6
+ modify it under the terms of the GNU Library General Public
7
+ License as published by the Free Software Foundation; either
8
+ version 2 of the License, or (at your option) any later version.
9
+
10
+ Libiberty is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ Library General Public License for more details.
14
+
15
+ You should have received a copy of the GNU Library General Public
16
+ License along with libiberty; see the file COPYING.LIB. If not,
17
+ write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
18
+ Boston, MA 02110-1301, USA. */
19
+
20
+ #ifndef TIMEVAL_UTILS_H
21
+ #define TIMEVAL_UTILS_H
22
+
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif /* __cplusplus */
26
+
27
+ /* forward decl */
28
+ struct timeval;
29
+
30
+ extern void timeval_add (struct timeval *result,
31
+ const struct timeval *a, const struct timeval *b);
32
+
33
+ extern void timeval_sub (struct timeval *result,
34
+ const struct timeval *a, const struct timeval *b);
35
+
36
+ #ifdef __cplusplus
37
+ }
38
+ #endif /* __cplusplus */
39
+
40
+ #endif /* TIMEVAL_UTILS_H */
hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/libgcc.a ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ed04118dc5e8047d757bf23fe312e0d854496610ec252815389ca537379d45e
3
+ size 5987458
hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/libgcov.a ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e36a8d914ecee25e689ed0e2b85651f859cb1eb1ab3e39ab12021d3f25f59464
3
+ size 174320
hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/tiny-stack/libgcc.a ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:818c7914e9379b5e3b6f9228e34ed3ad739087301e43a3f1efce75f5b3db0c7e
3
+ size 5993666
hardware/tools/avr/lib/gcc/avr/7.3.0/avr25/tiny-stack/libgcov.a ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf973e82347bc9a67cdf2741cd37e546d159f8f543cc7c13f7f33993a3d928a3
3
+ size 174504