revision 1264:74ad81710528
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 1264:74ad81710528 |
parent | 1263:b3de98d19faf |
child | 1265:7c6c5d26fd2e |
author | nkeynes |
date | Tue Mar 06 12:19:08 2012 +1000 (12 years ago) |
Move x86dasm/* files under xlat/disasm
1.1 --- a/src/Makefile.am Tue Mar 06 09:04:34 2012 +10001.2 +++ b/src/Makefile.am Tue Mar 06 12:19:08 2012 +10001.3 @@ -88,15 +88,15 @@1.4 xlat/x86/ia32abi.h xlat/x86/amd64abi.h \1.5 xlat/xlatdasm.c xlat/xlatdasm.h \1.6 sh4/sh4trans.c sh4/sh4trans.h sh4/mmux86.c sh4/shadow.c \1.7 - x86dasm/i386-dis.c x86dasm/dis-init.c x86dasm/dis-buf.c \1.8 - x86dasm/ansidecl.h x86dasm/bfd.h x86dasm/dis-asm.h \1.9 - x86dasm/symcat.h x86dasm/sysdep.h1.10 + xlat/disasm/i386-dis.c xlat/disasm/dis-init.c xlat/disasm/dis-buf.c \1.11 + xlat/disasm/ansidecl.h xlat/disasm/bfd.h xlat/disasm/dis-asm.h \1.12 + xlat/disasm/symcat.h xlat/disasm/sysdep.h1.14 test_testsh4x86_LDADD = @LXDREAM_LIBS@ @GLIB_LIBS@ @GTK_LIBS@ @LIBPNG_LIBS@1.15 test_testsh4x86_CPPFLAGS = @LXDREAMCPPFLAGS@1.16 test_testsh4x86_SOURCES = test/testsh4x86.c xlat/xlatdasm.c \1.17 - xlat/xlatdasm.h x86dasm/i386-dis.c x86dasm/dis-init.c \1.18 - x86dasm/dis-buf.c \1.19 + xlat/xlatdasm.h xlat/disasm/i386-dis.c xlat/disasm/dis-init.c \1.20 + xlat/disasm/dis-buf.c \1.21 sh4/sh4trans.c sh4/sh4x86.c xlat/xltcache.c sh4/sh4dasm.c \1.22 xlat/xltcache.h mem.c util.c cpu.c
2.1 --- a/src/Makefile.in Tue Mar 06 09:04:34 2012 +10002.2 +++ b/src/Makefile.in Tue Mar 06 12:19:08 2012 +10002.3 @@ -47,9 +47,9 @@2.4 @BUILD_SH4X86_TRUE@ xlat/x86/ia32abi.h xlat/x86/amd64abi.h \2.5 @BUILD_SH4X86_TRUE@ xlat/xlatdasm.c xlat/xlatdasm.h \2.6 @BUILD_SH4X86_TRUE@ sh4/sh4trans.c sh4/sh4trans.h sh4/mmux86.c sh4/shadow.c \2.7 -@BUILD_SH4X86_TRUE@ x86dasm/i386-dis.c x86dasm/dis-init.c x86dasm/dis-buf.c \2.8 -@BUILD_SH4X86_TRUE@ x86dasm/ansidecl.h x86dasm/bfd.h x86dasm/dis-asm.h \2.9 -@BUILD_SH4X86_TRUE@ x86dasm/symcat.h x86dasm/sysdep.h2.10 +@BUILD_SH4X86_TRUE@ xlat/disasm/i386-dis.c xlat/disasm/dis-init.c xlat/disasm/dis-buf.c \2.11 +@BUILD_SH4X86_TRUE@ xlat/disasm/ansidecl.h xlat/disasm/bfd.h xlat/disasm/dis-asm.h \2.12 +@BUILD_SH4X86_TRUE@ xlat/disasm/symcat.h xlat/disasm/sysdep.h2.14 @BUILD_SH4X86_TRUE@am__append_3 = test/testsh4x862.15 @GUI_GTK_TRUE@am__append_4 = gtkui/gtkui.c gtkui/gtkui.h \2.16 @@ -146,11 +146,12 @@2.17 hotkeys.c hotkeys.h sh4/sh4x86.c xlat/x86/x86op.h \2.18 xlat/x86/ia32abi.h xlat/x86/amd64abi.h xlat/xlatdasm.c \2.19 xlat/xlatdasm.h sh4/sh4trans.c sh4/sh4trans.h sh4/mmux86.c \2.20 - sh4/shadow.c x86dasm/i386-dis.c x86dasm/dis-init.c \2.21 - x86dasm/dis-buf.c x86dasm/ansidecl.h x86dasm/bfd.h \2.22 - x86dasm/dis-asm.h x86dasm/symcat.h x86dasm/sysdep.h \2.23 - cocoaui/paths_osx.m drivers/io_osx.m drivers/mac_keymap.h \2.24 - drivers/mac_keymap.txt paths_unix.c drivers/io_glib.c2.25 + sh4/shadow.c xlat/disasm/i386-dis.c xlat/disasm/dis-init.c \2.26 + xlat/disasm/dis-buf.c xlat/disasm/ansidecl.h xlat/disasm/bfd.h \2.27 + xlat/disasm/dis-asm.h xlat/disasm/symcat.h \2.28 + xlat/disasm/sysdep.h cocoaui/paths_osx.m drivers/io_osx.m \2.29 + drivers/mac_keymap.h drivers/mac_keymap.txt paths_unix.c \2.30 + drivers/io_glib.c2.31 @BUILD_SH4X86_TRUE@am__objects_1 = liblxdream_core_a-sh4x86.$(OBJEXT) \2.32 @BUILD_SH4X86_TRUE@ liblxdream_core_a-xlatdasm.$(OBJEXT) \2.33 @BUILD_SH4X86_TRUE@ liblxdream_core_a-sh4trans.$(OBJEXT) \2.34 @@ -353,9 +354,10 @@2.35 test_testlxpaths_DEPENDENCIES =2.36 am__dirstamp = $(am__leading_dot)dirstamp2.37 am__test_testsh4x86_SOURCES_DIST = test/testsh4x86.c xlat/xlatdasm.c \2.38 - xlat/xlatdasm.h x86dasm/i386-dis.c x86dasm/dis-init.c \2.39 - x86dasm/dis-buf.c sh4/sh4trans.c sh4/sh4x86.c xlat/xltcache.c \2.40 - sh4/sh4dasm.c xlat/xltcache.h mem.c util.c cpu.c2.41 + xlat/xlatdasm.h xlat/disasm/i386-dis.c xlat/disasm/dis-init.c \2.42 + xlat/disasm/dis-buf.c sh4/sh4trans.c sh4/sh4x86.c \2.43 + xlat/xltcache.c sh4/sh4dasm.c xlat/xltcache.h mem.c util.c \2.44 + cpu.c2.45 @BUILD_SH4X86_TRUE@am_test_testsh4x86_OBJECTS = \2.46 @BUILD_SH4X86_TRUE@ test_testsh4x86-testsh4x86.$(OBJEXT) \2.47 @BUILD_SH4X86_TRUE@ test_testsh4x86-xlatdasm.$(OBJEXT) \2.48 @@ -695,8 +697,8 @@2.49 @BUILD_SH4X86_TRUE@test_testsh4x86_LDADD = @LXDREAM_LIBS@ @GLIB_LIBS@ @GTK_LIBS@ @LIBPNG_LIBS@2.50 @BUILD_SH4X86_TRUE@test_testsh4x86_CPPFLAGS = @LXDREAMCPPFLAGS@2.51 @BUILD_SH4X86_TRUE@test_testsh4x86_SOURCES = test/testsh4x86.c xlat/xlatdasm.c \2.52 -@BUILD_SH4X86_TRUE@ xlat/xlatdasm.h x86dasm/i386-dis.c x86dasm/dis-init.c \2.53 -@BUILD_SH4X86_TRUE@ x86dasm/dis-buf.c \2.54 +@BUILD_SH4X86_TRUE@ xlat/xlatdasm.h xlat/disasm/i386-dis.c xlat/disasm/dis-init.c \2.55 +@BUILD_SH4X86_TRUE@ xlat/disasm/dis-buf.c \2.56 @BUILD_SH4X86_TRUE@ sh4/sh4trans.c sh4/sh4x86.c xlat/xltcache.c sh4/sh4dasm.c \2.57 @BUILD_SH4X86_TRUE@ xlat/xltcache.h mem.c util.c cpu.c2.59 @@ -2171,47 +2173,47 @@2.60 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.61 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-shadow.obj `if test -f 'sh4/shadow.c'; then $(CYGPATH_W) 'sh4/shadow.c'; else $(CYGPATH_W) '$(srcdir)/sh4/shadow.c'; fi`2.63 -liblxdream_core_a-i386-dis.o: x86dasm/i386-dis.c2.64 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-i386-dis.o -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-i386-dis.Tpo" -c -o liblxdream_core_a-i386-dis.o `test -f 'x86dasm/i386-dis.c' || echo '$(srcdir)/'`x86dasm/i386-dis.c; \2.65 +liblxdream_core_a-i386-dis.o: xlat/disasm/i386-dis.c2.66 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-i386-dis.o -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-i386-dis.Tpo" -c -o liblxdream_core_a-i386-dis.o `test -f 'xlat/disasm/i386-dis.c' || echo '$(srcdir)/'`xlat/disasm/i386-dis.c; \2.67 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblxdream_core_a-i386-dis.Tpo" "$(DEPDIR)/liblxdream_core_a-i386-dis.Po"; else rm -f "$(DEPDIR)/liblxdream_core_a-i386-dis.Tpo"; exit 1; fi2.68 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/i386-dis.c' object='liblxdream_core_a-i386-dis.o' libtool=no @AMDEPBACKSLASH@2.69 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/i386-dis.c' object='liblxdream_core_a-i386-dis.o' libtool=no @AMDEPBACKSLASH@2.70 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.71 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-i386-dis.o `test -f 'x86dasm/i386-dis.c' || echo '$(srcdir)/'`x86dasm/i386-dis.c2.72 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-i386-dis.o `test -f 'xlat/disasm/i386-dis.c' || echo '$(srcdir)/'`xlat/disasm/i386-dis.c2.74 -liblxdream_core_a-i386-dis.obj: x86dasm/i386-dis.c2.75 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-i386-dis.obj -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-i386-dis.Tpo" -c -o liblxdream_core_a-i386-dis.obj `if test -f 'x86dasm/i386-dis.c'; then $(CYGPATH_W) 'x86dasm/i386-dis.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/i386-dis.c'; fi`; \2.76 +liblxdream_core_a-i386-dis.obj: xlat/disasm/i386-dis.c2.77 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-i386-dis.obj -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-i386-dis.Tpo" -c -o liblxdream_core_a-i386-dis.obj `if test -f 'xlat/disasm/i386-dis.c'; then $(CYGPATH_W) 'xlat/disasm/i386-dis.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/i386-dis.c'; fi`; \2.78 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblxdream_core_a-i386-dis.Tpo" "$(DEPDIR)/liblxdream_core_a-i386-dis.Po"; else rm -f "$(DEPDIR)/liblxdream_core_a-i386-dis.Tpo"; exit 1; fi2.79 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/i386-dis.c' object='liblxdream_core_a-i386-dis.obj' libtool=no @AMDEPBACKSLASH@2.80 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/i386-dis.c' object='liblxdream_core_a-i386-dis.obj' libtool=no @AMDEPBACKSLASH@2.81 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.82 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-i386-dis.obj `if test -f 'x86dasm/i386-dis.c'; then $(CYGPATH_W) 'x86dasm/i386-dis.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/i386-dis.c'; fi`2.83 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-i386-dis.obj `if test -f 'xlat/disasm/i386-dis.c'; then $(CYGPATH_W) 'xlat/disasm/i386-dis.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/i386-dis.c'; fi`2.85 -liblxdream_core_a-dis-init.o: x86dasm/dis-init.c2.86 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-dis-init.o -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-dis-init.Tpo" -c -o liblxdream_core_a-dis-init.o `test -f 'x86dasm/dis-init.c' || echo '$(srcdir)/'`x86dasm/dis-init.c; \2.87 +liblxdream_core_a-dis-init.o: xlat/disasm/dis-init.c2.88 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-dis-init.o -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-dis-init.Tpo" -c -o liblxdream_core_a-dis-init.o `test -f 'xlat/disasm/dis-init.c' || echo '$(srcdir)/'`xlat/disasm/dis-init.c; \2.89 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblxdream_core_a-dis-init.Tpo" "$(DEPDIR)/liblxdream_core_a-dis-init.Po"; else rm -f "$(DEPDIR)/liblxdream_core_a-dis-init.Tpo"; exit 1; fi2.90 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/dis-init.c' object='liblxdream_core_a-dis-init.o' libtool=no @AMDEPBACKSLASH@2.91 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/dis-init.c' object='liblxdream_core_a-dis-init.o' libtool=no @AMDEPBACKSLASH@2.92 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.93 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-dis-init.o `test -f 'x86dasm/dis-init.c' || echo '$(srcdir)/'`x86dasm/dis-init.c2.94 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-dis-init.o `test -f 'xlat/disasm/dis-init.c' || echo '$(srcdir)/'`xlat/disasm/dis-init.c2.96 -liblxdream_core_a-dis-init.obj: x86dasm/dis-init.c2.97 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-dis-init.obj -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-dis-init.Tpo" -c -o liblxdream_core_a-dis-init.obj `if test -f 'x86dasm/dis-init.c'; then $(CYGPATH_W) 'x86dasm/dis-init.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/dis-init.c'; fi`; \2.98 +liblxdream_core_a-dis-init.obj: xlat/disasm/dis-init.c2.99 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-dis-init.obj -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-dis-init.Tpo" -c -o liblxdream_core_a-dis-init.obj `if test -f 'xlat/disasm/dis-init.c'; then $(CYGPATH_W) 'xlat/disasm/dis-init.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/dis-init.c'; fi`; \2.100 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblxdream_core_a-dis-init.Tpo" "$(DEPDIR)/liblxdream_core_a-dis-init.Po"; else rm -f "$(DEPDIR)/liblxdream_core_a-dis-init.Tpo"; exit 1; fi2.101 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/dis-init.c' object='liblxdream_core_a-dis-init.obj' libtool=no @AMDEPBACKSLASH@2.102 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/dis-init.c' object='liblxdream_core_a-dis-init.obj' libtool=no @AMDEPBACKSLASH@2.103 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.104 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-dis-init.obj `if test -f 'x86dasm/dis-init.c'; then $(CYGPATH_W) 'x86dasm/dis-init.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/dis-init.c'; fi`2.105 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-dis-init.obj `if test -f 'xlat/disasm/dis-init.c'; then $(CYGPATH_W) 'xlat/disasm/dis-init.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/dis-init.c'; fi`2.107 -liblxdream_core_a-dis-buf.o: x86dasm/dis-buf.c2.108 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-dis-buf.o -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-dis-buf.Tpo" -c -o liblxdream_core_a-dis-buf.o `test -f 'x86dasm/dis-buf.c' || echo '$(srcdir)/'`x86dasm/dis-buf.c; \2.109 +liblxdream_core_a-dis-buf.o: xlat/disasm/dis-buf.c2.110 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-dis-buf.o -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-dis-buf.Tpo" -c -o liblxdream_core_a-dis-buf.o `test -f 'xlat/disasm/dis-buf.c' || echo '$(srcdir)/'`xlat/disasm/dis-buf.c; \2.111 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblxdream_core_a-dis-buf.Tpo" "$(DEPDIR)/liblxdream_core_a-dis-buf.Po"; else rm -f "$(DEPDIR)/liblxdream_core_a-dis-buf.Tpo"; exit 1; fi2.112 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/dis-buf.c' object='liblxdream_core_a-dis-buf.o' libtool=no @AMDEPBACKSLASH@2.113 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/dis-buf.c' object='liblxdream_core_a-dis-buf.o' libtool=no @AMDEPBACKSLASH@2.114 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.115 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-dis-buf.o `test -f 'x86dasm/dis-buf.c' || echo '$(srcdir)/'`x86dasm/dis-buf.c2.116 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-dis-buf.o `test -f 'xlat/disasm/dis-buf.c' || echo '$(srcdir)/'`xlat/disasm/dis-buf.c2.118 -liblxdream_core_a-dis-buf.obj: x86dasm/dis-buf.c2.119 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-dis-buf.obj -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-dis-buf.Tpo" -c -o liblxdream_core_a-dis-buf.obj `if test -f 'x86dasm/dis-buf.c'; then $(CYGPATH_W) 'x86dasm/dis-buf.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/dis-buf.c'; fi`; \2.120 +liblxdream_core_a-dis-buf.obj: xlat/disasm/dis-buf.c2.121 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-dis-buf.obj -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-dis-buf.Tpo" -c -o liblxdream_core_a-dis-buf.obj `if test -f 'xlat/disasm/dis-buf.c'; then $(CYGPATH_W) 'xlat/disasm/dis-buf.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/dis-buf.c'; fi`; \2.122 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/liblxdream_core_a-dis-buf.Tpo" "$(DEPDIR)/liblxdream_core_a-dis-buf.Po"; else rm -f "$(DEPDIR)/liblxdream_core_a-dis-buf.Tpo"; exit 1; fi2.123 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/dis-buf.c' object='liblxdream_core_a-dis-buf.obj' libtool=no @AMDEPBACKSLASH@2.124 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/dis-buf.c' object='liblxdream_core_a-dis-buf.obj' libtool=no @AMDEPBACKSLASH@2.125 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.126 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-dis-buf.obj `if test -f 'x86dasm/dis-buf.c'; then $(CYGPATH_W) 'x86dasm/dis-buf.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/dis-buf.c'; fi`2.127 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o liblxdream_core_a-dis-buf.obj `if test -f 'xlat/disasm/dis-buf.c'; then $(CYGPATH_W) 'xlat/disasm/dis-buf.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/dis-buf.c'; fi`2.129 liblxdream_core_a-paths_unix.o: paths_unix.c2.130 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(liblxdream_core_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT liblxdream_core_a-paths_unix.o -MD -MP -MF "$(DEPDIR)/liblxdream_core_a-paths_unix.Tpo" -c -o liblxdream_core_a-paths_unix.o `test -f 'paths_unix.c' || echo '$(srcdir)/'`paths_unix.c; \2.131 @@ -2661,47 +2663,47 @@2.132 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.133 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-xlatdasm.obj `if test -f 'xlat/xlatdasm.c'; then $(CYGPATH_W) 'xlat/xlatdasm.c'; else $(CYGPATH_W) '$(srcdir)/xlat/xlatdasm.c'; fi`2.135 -test_testsh4x86-i386-dis.o: x86dasm/i386-dis.c2.136 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-i386-dis.o -MD -MP -MF "$(DEPDIR)/test_testsh4x86-i386-dis.Tpo" -c -o test_testsh4x86-i386-dis.o `test -f 'x86dasm/i386-dis.c' || echo '$(srcdir)/'`x86dasm/i386-dis.c; \2.137 +test_testsh4x86-i386-dis.o: xlat/disasm/i386-dis.c2.138 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-i386-dis.o -MD -MP -MF "$(DEPDIR)/test_testsh4x86-i386-dis.Tpo" -c -o test_testsh4x86-i386-dis.o `test -f 'xlat/disasm/i386-dis.c' || echo '$(srcdir)/'`xlat/disasm/i386-dis.c; \2.139 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_testsh4x86-i386-dis.Tpo" "$(DEPDIR)/test_testsh4x86-i386-dis.Po"; else rm -f "$(DEPDIR)/test_testsh4x86-i386-dis.Tpo"; exit 1; fi2.140 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/i386-dis.c' object='test_testsh4x86-i386-dis.o' libtool=no @AMDEPBACKSLASH@2.141 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/i386-dis.c' object='test_testsh4x86-i386-dis.o' libtool=no @AMDEPBACKSLASH@2.142 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.143 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-i386-dis.o `test -f 'x86dasm/i386-dis.c' || echo '$(srcdir)/'`x86dasm/i386-dis.c2.144 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-i386-dis.o `test -f 'xlat/disasm/i386-dis.c' || echo '$(srcdir)/'`xlat/disasm/i386-dis.c2.146 -test_testsh4x86-i386-dis.obj: x86dasm/i386-dis.c2.147 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-i386-dis.obj -MD -MP -MF "$(DEPDIR)/test_testsh4x86-i386-dis.Tpo" -c -o test_testsh4x86-i386-dis.obj `if test -f 'x86dasm/i386-dis.c'; then $(CYGPATH_W) 'x86dasm/i386-dis.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/i386-dis.c'; fi`; \2.148 +test_testsh4x86-i386-dis.obj: xlat/disasm/i386-dis.c2.149 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-i386-dis.obj -MD -MP -MF "$(DEPDIR)/test_testsh4x86-i386-dis.Tpo" -c -o test_testsh4x86-i386-dis.obj `if test -f 'xlat/disasm/i386-dis.c'; then $(CYGPATH_W) 'xlat/disasm/i386-dis.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/i386-dis.c'; fi`; \2.150 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_testsh4x86-i386-dis.Tpo" "$(DEPDIR)/test_testsh4x86-i386-dis.Po"; else rm -f "$(DEPDIR)/test_testsh4x86-i386-dis.Tpo"; exit 1; fi2.151 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/i386-dis.c' object='test_testsh4x86-i386-dis.obj' libtool=no @AMDEPBACKSLASH@2.152 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/i386-dis.c' object='test_testsh4x86-i386-dis.obj' libtool=no @AMDEPBACKSLASH@2.153 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.154 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-i386-dis.obj `if test -f 'x86dasm/i386-dis.c'; then $(CYGPATH_W) 'x86dasm/i386-dis.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/i386-dis.c'; fi`2.155 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-i386-dis.obj `if test -f 'xlat/disasm/i386-dis.c'; then $(CYGPATH_W) 'xlat/disasm/i386-dis.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/i386-dis.c'; fi`2.157 -test_testsh4x86-dis-init.o: x86dasm/dis-init.c2.158 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-dis-init.o -MD -MP -MF "$(DEPDIR)/test_testsh4x86-dis-init.Tpo" -c -o test_testsh4x86-dis-init.o `test -f 'x86dasm/dis-init.c' || echo '$(srcdir)/'`x86dasm/dis-init.c; \2.159 +test_testsh4x86-dis-init.o: xlat/disasm/dis-init.c2.160 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-dis-init.o -MD -MP -MF "$(DEPDIR)/test_testsh4x86-dis-init.Tpo" -c -o test_testsh4x86-dis-init.o `test -f 'xlat/disasm/dis-init.c' || echo '$(srcdir)/'`xlat/disasm/dis-init.c; \2.161 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_testsh4x86-dis-init.Tpo" "$(DEPDIR)/test_testsh4x86-dis-init.Po"; else rm -f "$(DEPDIR)/test_testsh4x86-dis-init.Tpo"; exit 1; fi2.162 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/dis-init.c' object='test_testsh4x86-dis-init.o' libtool=no @AMDEPBACKSLASH@2.163 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/dis-init.c' object='test_testsh4x86-dis-init.o' libtool=no @AMDEPBACKSLASH@2.164 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.165 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-dis-init.o `test -f 'x86dasm/dis-init.c' || echo '$(srcdir)/'`x86dasm/dis-init.c2.166 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-dis-init.o `test -f 'xlat/disasm/dis-init.c' || echo '$(srcdir)/'`xlat/disasm/dis-init.c2.168 -test_testsh4x86-dis-init.obj: x86dasm/dis-init.c2.169 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-dis-init.obj -MD -MP -MF "$(DEPDIR)/test_testsh4x86-dis-init.Tpo" -c -o test_testsh4x86-dis-init.obj `if test -f 'x86dasm/dis-init.c'; then $(CYGPATH_W) 'x86dasm/dis-init.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/dis-init.c'; fi`; \2.170 +test_testsh4x86-dis-init.obj: xlat/disasm/dis-init.c2.171 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-dis-init.obj -MD -MP -MF "$(DEPDIR)/test_testsh4x86-dis-init.Tpo" -c -o test_testsh4x86-dis-init.obj `if test -f 'xlat/disasm/dis-init.c'; then $(CYGPATH_W) 'xlat/disasm/dis-init.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/dis-init.c'; fi`; \2.172 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_testsh4x86-dis-init.Tpo" "$(DEPDIR)/test_testsh4x86-dis-init.Po"; else rm -f "$(DEPDIR)/test_testsh4x86-dis-init.Tpo"; exit 1; fi2.173 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/dis-init.c' object='test_testsh4x86-dis-init.obj' libtool=no @AMDEPBACKSLASH@2.174 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/dis-init.c' object='test_testsh4x86-dis-init.obj' libtool=no @AMDEPBACKSLASH@2.175 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.176 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-dis-init.obj `if test -f 'x86dasm/dis-init.c'; then $(CYGPATH_W) 'x86dasm/dis-init.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/dis-init.c'; fi`2.177 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-dis-init.obj `if test -f 'xlat/disasm/dis-init.c'; then $(CYGPATH_W) 'xlat/disasm/dis-init.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/dis-init.c'; fi`2.179 -test_testsh4x86-dis-buf.o: x86dasm/dis-buf.c2.180 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-dis-buf.o -MD -MP -MF "$(DEPDIR)/test_testsh4x86-dis-buf.Tpo" -c -o test_testsh4x86-dis-buf.o `test -f 'x86dasm/dis-buf.c' || echo '$(srcdir)/'`x86dasm/dis-buf.c; \2.181 +test_testsh4x86-dis-buf.o: xlat/disasm/dis-buf.c2.182 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-dis-buf.o -MD -MP -MF "$(DEPDIR)/test_testsh4x86-dis-buf.Tpo" -c -o test_testsh4x86-dis-buf.o `test -f 'xlat/disasm/dis-buf.c' || echo '$(srcdir)/'`xlat/disasm/dis-buf.c; \2.183 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_testsh4x86-dis-buf.Tpo" "$(DEPDIR)/test_testsh4x86-dis-buf.Po"; else rm -f "$(DEPDIR)/test_testsh4x86-dis-buf.Tpo"; exit 1; fi2.184 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/dis-buf.c' object='test_testsh4x86-dis-buf.o' libtool=no @AMDEPBACKSLASH@2.185 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/dis-buf.c' object='test_testsh4x86-dis-buf.o' libtool=no @AMDEPBACKSLASH@2.186 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.187 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-dis-buf.o `test -f 'x86dasm/dis-buf.c' || echo '$(srcdir)/'`x86dasm/dis-buf.c2.188 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-dis-buf.o `test -f 'xlat/disasm/dis-buf.c' || echo '$(srcdir)/'`xlat/disasm/dis-buf.c2.190 -test_testsh4x86-dis-buf.obj: x86dasm/dis-buf.c2.191 -@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-dis-buf.obj -MD -MP -MF "$(DEPDIR)/test_testsh4x86-dis-buf.Tpo" -c -o test_testsh4x86-dis-buf.obj `if test -f 'x86dasm/dis-buf.c'; then $(CYGPATH_W) 'x86dasm/dis-buf.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/dis-buf.c'; fi`; \2.192 +test_testsh4x86-dis-buf.obj: xlat/disasm/dis-buf.c2.193 +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-dis-buf.obj -MD -MP -MF "$(DEPDIR)/test_testsh4x86-dis-buf.Tpo" -c -o test_testsh4x86-dis-buf.obj `if test -f 'xlat/disasm/dis-buf.c'; then $(CYGPATH_W) 'xlat/disasm/dis-buf.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/dis-buf.c'; fi`; \2.194 @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test_testsh4x86-dis-buf.Tpo" "$(DEPDIR)/test_testsh4x86-dis-buf.Po"; else rm -f "$(DEPDIR)/test_testsh4x86-dis-buf.Tpo"; exit 1; fi2.195 -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='x86dasm/dis-buf.c' object='test_testsh4x86-dis-buf.obj' libtool=no @AMDEPBACKSLASH@2.196 +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xlat/disasm/dis-buf.c' object='test_testsh4x86-dis-buf.obj' libtool=no @AMDEPBACKSLASH@2.197 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@2.198 -@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-dis-buf.obj `if test -f 'x86dasm/dis-buf.c'; then $(CYGPATH_W) 'x86dasm/dis-buf.c'; else $(CYGPATH_W) '$(srcdir)/x86dasm/dis-buf.c'; fi`2.199 +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_testsh4x86-dis-buf.obj `if test -f 'xlat/disasm/dis-buf.c'; then $(CYGPATH_W) 'xlat/disasm/dis-buf.c'; else $(CYGPATH_W) '$(srcdir)/xlat/disasm/dis-buf.c'; fi`2.201 test_testsh4x86-sh4trans.o: sh4/sh4trans.c2.202 @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_testsh4x86_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_testsh4x86-sh4trans.o -MD -MP -MF "$(DEPDIR)/test_testsh4x86-sh4trans.Tpo" -c -o test_testsh4x86-sh4trans.o `test -f 'sh4/sh4trans.c' || echo '$(srcdir)/'`sh4/sh4trans.c; \
3.1 --- a/src/x86dasm/README Tue Mar 06 09:04:34 2012 +10003.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +00003.3 @@ -1,1 +0,0 @@3.4 -i386-dis extracted from binutils 2.16.1 and modified to play with lxdream.
4.1 --- a/src/x86dasm/ansidecl.h Tue Mar 06 09:04:34 2012 +10004.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +00004.3 @@ -1,346 +0,0 @@4.4 -/* ANSI and traditional C compatability macros4.5 - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 20014.6 - Free Software Foundation, Inc.4.7 - This file is part of the GNU C Library.4.8 -4.9 -This program is free software; you can redistribute it and/or modify4.10 -it under the terms of the GNU General Public License as published by4.11 -the Free Software Foundation; either version 2 of the License, or4.12 -(at your option) any later version.4.13 -4.14 -This program is distributed in the hope that it will be useful,4.15 -but WITHOUT ANY WARRANTY; without even the implied warranty of4.16 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the4.17 -GNU General Public License for more details.4.18 -4.19 -You should have received a copy of the GNU General Public License4.20 -along with this program; if not, write to the Free Software4.21 -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */4.22 -4.23 -/* ANSI and traditional C compatibility macros4.24 -4.25 - ANSI C is assumed if __STDC__ is #defined.4.26 -4.27 - Macro ANSI C definition Traditional C definition4.28 - ----- ---- - ---------- ----------- - ----------4.29 - ANSI_PROTOTYPES 1 not defined4.30 - PTR `void *' `char *'4.31 - PTRCONST `void *const' `char *'4.32 - LONG_DOUBLE `long double' `double'4.33 - const not defined `'4.34 - volatile not defined `'4.35 - signed not defined `'4.36 - VA_START(ap, var) va_start(ap, var) va_start(ap)4.37 -4.38 - Note that it is safe to write "void foo();" indicating a function4.39 - with no return value, in all K+R compilers we have been able to test.4.40 -4.41 - For declaring functions with prototypes, we also provide these:4.42 -4.43 - PARAMS ((prototype))4.44 - -- for functions which take a fixed number of arguments. Use this4.45 - when declaring the function. When defining the function, write a4.46 - K+R style argument list. For example:4.47 -4.48 - char *strcpy PARAMS ((char *dest, char *source));4.49 - ...4.50 - char *4.51 - strcpy (dest, source)4.52 - char *dest;4.53 - char *source;4.54 - { ... }4.55 -4.56 -4.57 - VPARAMS ((prototype, ...))4.58 - -- for functions which take a variable number of arguments. Use4.59 - PARAMS to declare the function, VPARAMS to define it. For example:4.60 -4.61 - int printf PARAMS ((const char *format, ...));4.62 - ...4.63 - int4.64 - printf VPARAMS ((const char *format, ...))4.65 - {4.66 - ...4.67 - }4.68 -4.69 - For writing functions which take variable numbers of arguments, we4.70 - also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These4.71 - hide the differences between K+R <varargs.h> and C89 <stdarg.h> more4.72 - thoroughly than the simple VA_START() macro mentioned above.4.73 -4.74 - VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end.4.75 - Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls4.76 - corresponding to the list of fixed arguments. Then use va_arg4.77 - normally to get the variable arguments, or pass your va_list object4.78 - around. You do not declare the va_list yourself; VA_OPEN does it4.79 - for you.4.80 -4.81 - Here is a complete example:4.82 -4.83 - int4.84 - printf VPARAMS ((const char *format, ...))4.85 - {4.86 - int result;4.87 -4.88 - VA_OPEN (ap, format);4.89 - VA_FIXEDARG (ap, const char *, format);4.90 -4.91 - result = vfprintf (stdout, format, ap);4.92 - VA_CLOSE (ap);4.93 -4.94 - return result;4.95 - }4.96 -4.97 -4.98 - You can declare variables either before or after the VA_OPEN,4.99 - VA_FIXEDARG sequence. Also, VA_OPEN and VA_CLOSE are the beginning4.100 - and end of a block. They must appear at the same nesting level,4.101 - and any variables declared after VA_OPEN go out of scope at4.102 - VA_CLOSE. Unfortunately, with a K+R compiler, that includes the4.103 - argument list. You can have multiple instances of VA_OPEN/VA_CLOSE4.104 - pairs in a single function in case you need to traverse the4.105 - argument list more than once.4.106 -4.107 - For ease of writing code which uses GCC extensions but needs to be4.108 - portable to other compilers, we provide the GCC_VERSION macro that4.109 - simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various4.110 - wrappers around __attribute__. Also, __extension__ will be #defined4.111 - to nothing if it doesn't work. See below.4.112 -4.113 - This header also defines a lot of obsolete macros:4.114 - CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,4.115 - AND, DOTS, NOARGS. Don't use them. */4.116 -4.117 -#ifndef _ANSIDECL_H4.118 -#define _ANSIDECL_H 14.119 -4.120 -/* Every source file includes this file,4.121 - so they will all get the switch for lint. */4.122 -/* LINTLIBRARY */4.123 -4.124 -/* Using MACRO(x,y) in cpp #if conditionals does not work with some4.125 - older preprocessors. Thus we can't define something like this:4.126 -4.127 -#define HAVE_GCC_VERSION(MAJOR, MINOR) \4.128 - (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))4.129 -4.130 -and then test "#if HAVE_GCC_VERSION(2,7)".4.131 -4.132 -So instead we use the macro below and test it against specific values. */4.133 -4.134 -/* This macro simplifies testing whether we are using gcc, and if it4.135 - is of a particular minimum version. (Both major & minor numbers are4.136 - significant.) This macro will evaluate to 0 if we are not using4.137 - gcc at all. */4.138 -#ifndef GCC_VERSION4.139 -#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)4.140 -#endif /* GCC_VERSION */4.141 -4.142 -#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus))4.143 -/* All known AIX compilers implement these things (but don't always4.144 - define __STDC__). The RISC/OS MIPS compiler defines these things4.145 - in SVR4 mode, but does not define __STDC__. */4.146 -/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other4.147 - C++ compilers, does not define __STDC__, though it acts as if this4.148 - was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */4.149 -4.150 -#define ANSI_PROTOTYPES 14.151 -#define PTR void *4.152 -#define PTRCONST void *const4.153 -#define LONG_DOUBLE long double4.154 -4.155 -/* PARAMS is often defined elsewhere (e.g. by libintl.h), so wrap it in4.156 - a #ifndef. */4.157 -#ifndef PARAMS4.158 -#define PARAMS(ARGS) ARGS4.159 -#endif4.160 -4.161 -#define VPARAMS(ARGS) ARGS4.162 -#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR)4.163 -4.164 -/* variadic function helper macros */4.165 -/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's4.166 - use without inhibiting further decls and without declaring an4.167 - actual variable. */4.168 -#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy4.169 -#define VA_CLOSE(AP) } va_end(AP); }4.170 -#define VA_FIXEDARG(AP, T, N) struct Qdmy4.171 -4.172 -#undef const4.173 -#undef volatile4.174 -#undef signed4.175 -4.176 -/* inline requires special treatment; it's in C99, and GCC >=2.7 supports4.177 - it too, but it's not in C89. */4.178 -#undef inline4.179 -#if __STDC_VERSION__ > 199901L4.180 -/* it's a keyword */4.181 -#else4.182 -# if GCC_VERSION >= 20074.183 -# define inline __inline__ /* __inline__ prevents -pedantic warnings */4.184 -# else4.185 -# define inline /* nothing */4.186 -# endif4.187 -#endif4.188 -4.189 -/* These are obsolete. Do not use. */4.190 -#ifndef IN_GCC4.191 -#define CONST const4.192 -#define VOLATILE volatile4.193 -#define SIGNED signed4.194 -4.195 -#define PROTO(type, name, arglist) type name arglist4.196 -#define EXFUN(name, proto) name proto4.197 -#define DEFUN(name, arglist, args) name(args)4.198 -#define DEFUN_VOID(name) name(void)4.199 -#define AND ,4.200 -#define DOTS , ...4.201 -#define NOARGS void4.202 -#endif /* ! IN_GCC */4.203 -4.204 -#else /* Not ANSI C. */4.205 -4.206 -#undef ANSI_PROTOTYPES4.207 -#define PTR char *4.208 -#define PTRCONST PTR4.209 -#define LONG_DOUBLE double4.210 -4.211 -#define PARAMS(args) ()4.212 -#define VPARAMS(args) (va_alist) va_dcl4.213 -#define VA_START(va_list, var) va_start(va_list)4.214 -4.215 -#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy4.216 -#define VA_CLOSE(AP) } va_end(AP); }4.217 -#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)4.218 -4.219 -/* some systems define these in header files for non-ansi mode */4.220 -#undef const4.221 -#undef volatile4.222 -#undef signed4.223 -#undef inline4.224 -#define const4.225 -#define volatile4.226 -#define signed4.227 -#define inline4.228 -4.229 -#ifndef IN_GCC4.230 -#define CONST4.231 -#define VOLATILE4.232 -#define SIGNED4.233 -4.234 -#define PROTO(type, name, arglist) type name ()4.235 -#define EXFUN(name, proto) name()4.236 -#define DEFUN(name, arglist, args) name arglist args;4.237 -#define DEFUN_VOID(name) name()4.238 -#define AND ;4.239 -#define DOTS4.240 -#define NOARGS4.241 -#endif /* ! IN_GCC */4.242 -4.243 -#endif /* ANSI C. */4.244 -4.245 -/* Define macros for some gcc attributes. This permits us to use the4.246 - macros freely, and know that they will come into play for the4.247 - version of gcc in which they are supported. */4.248 -4.249 -#if (GCC_VERSION < 2007)4.250 -# define __attribute__(x)4.251 -#endif4.252 -4.253 -/* Attribute __malloc__ on functions was valid as of gcc 2.96. */4.254 -#ifndef ATTRIBUTE_MALLOC4.255 -# if (GCC_VERSION >= 2096)4.256 -# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))4.257 -# else4.258 -# define ATTRIBUTE_MALLOC4.259 -# endif /* GNUC >= 2.96 */4.260 -#endif /* ATTRIBUTE_MALLOC */4.261 -4.262 -/* Attributes on labels were valid as of gcc 2.93. */4.263 -#ifndef ATTRIBUTE_UNUSED_LABEL4.264 -# if (GCC_VERSION >= 2093)4.265 -# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED4.266 -# else4.267 -# define ATTRIBUTE_UNUSED_LABEL4.268 -# endif /* GNUC >= 2.93 */4.269 -#endif /* ATTRIBUTE_UNUSED_LABEL */4.270 -4.271 -#ifndef ATTRIBUTE_UNUSED4.272 -#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))4.273 -#endif /* ATTRIBUTE_UNUSED */4.274 -4.275 -/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the4.276 - identifier name. */4.277 -#if ! defined(__cplusplus) || (GCC_VERSION >= 3004)4.278 -# define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED4.279 -#else /* !__cplusplus || GNUC >= 3.4 */4.280 -# define ARG_UNUSED(NAME) NAME4.281 -#endif /* !__cplusplus || GNUC >= 3.4 */4.282 -4.283 -#ifndef ATTRIBUTE_NORETURN4.284 -#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))4.285 -#endif /* ATTRIBUTE_NORETURN */4.286 -4.287 -/* Attribute `nonnull' was valid as of gcc 3.3. */4.288 -#ifndef ATTRIBUTE_NONNULL4.289 -# if (GCC_VERSION >= 3003)4.290 -# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))4.291 -# else4.292 -# define ATTRIBUTE_NONNULL(m)4.293 -# endif /* GNUC >= 3.3 */4.294 -#endif /* ATTRIBUTE_NONNULL */4.295 -4.296 -/* Attribute `pure' was valid as of gcc 3.0. */4.297 -#ifndef ATTRIBUTE_PURE4.298 -# if (GCC_VERSION >= 3000)4.299 -# define ATTRIBUTE_PURE __attribute__ ((__pure__))4.300 -# else4.301 -# define ATTRIBUTE_PURE4.302 -# endif /* GNUC >= 3.0 */4.303 -#endif /* ATTRIBUTE_PURE */4.304 -4.305 -/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL.4.306 - This was the case for the `printf' format attribute by itself4.307 - before GCC 3.3, but as of 3.3 we need to add the `nonnull'4.308 - attribute to retain this behavior. */4.309 -#ifndef ATTRIBUTE_PRINTF4.310 -#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)4.311 -#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)4.312 -#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)4.313 -#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)4.314 -#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)4.315 -#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)4.316 -#endif /* ATTRIBUTE_PRINTF */4.317 -4.318 -/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A4.319 - NULL format specifier was allowed as of gcc 3.3. */4.320 -#ifndef ATTRIBUTE_NULL_PRINTF4.321 -# if (GCC_VERSION >= 3003)4.322 -# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))4.323 -# else4.324 -# define ATTRIBUTE_NULL_PRINTF(m, n)4.325 -# endif /* GNUC >= 3.3 */4.326 -# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2)4.327 -# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3)4.328 -# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4)4.329 -# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5)4.330 -# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)4.331 -#endif /* ATTRIBUTE_NULL_PRINTF */4.332 -4.333 -/* Attribute `sentinel' was valid as of gcc 3.5. */4.334 -#ifndef ATTRIBUTE_SENTINEL4.335 -# if (GCC_VERSION >= 3005)4.336 -# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))4.337 -# else4.338 -# define ATTRIBUTE_SENTINEL4.339 -# endif /* GNUC >= 3.5 */4.340 -#endif /* ATTRIBUTE_SENTINEL */4.341 -4.342 -/* We use __extension__ in some places to suppress -pedantic warnings4.343 - about GCC extensions. This feature didn't work properly before4.344 - gcc 2.8. */4.345 -#if GCC_VERSION < 20084.346 -#define __extension__4.347 -#endif4.348 -4.349 -#endif /* ansidecl.h */
5.1 --- a/src/x86dasm/bfd.h Tue Mar 06 09:04:34 2012 +10005.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +00005.3 @@ -1,4714 +0,0 @@5.4 -/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically5.5 - generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",5.6 - "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",5.7 - "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",5.8 - "linker.c" and "simple.c".5.9 - Run "make headers" in your build bfd/ to regenerate. */5.10 -5.11 -/* Main header file for the bfd library -- portable access to object files.5.12 -5.13 - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,5.14 - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.5.15 -5.16 - Contributed by Cygnus Support.5.17 -5.18 - This file is part of BFD, the Binary File Descriptor library.5.19 -5.20 - This program is free software; you can redistribute it and/or modify5.21 - it under the terms of the GNU General Public License as published by5.22 - the Free Software Foundation; either version 2 of the License, or5.23 - (at your option) any later version.5.24 -5.25 - This program is distributed in the hope that it will be useful,5.26 - but WITHOUT ANY WARRANTY; without even the implied warranty of5.27 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the5.28 - GNU General Public License for more details.5.29 -5.30 - You should have received a copy of the GNU General Public License5.31 - along with this program; if not, write to the Free Software5.32 - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */5.33 -5.34 -#ifndef __BFD_H_SEEN__5.35 -#define __BFD_H_SEEN__5.36 -5.37 -#ifdef __cplusplus5.38 -extern "C" {5.39 -#endif5.40 -5.41 -#include "x86dasm/ansidecl.h"5.42 -#include "x86dasm/symcat.h"5.43 -#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)5.44 -#ifndef SABER5.45 -/* This hack is to avoid a problem with some strict ANSI C preprocessors.5.46 - The problem is, "32_" is not a valid preprocessing token, and we don't5.47 - want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will5.48 - cause the inner CONCAT2 macros to be evaluated first, producing5.49 - still-valid pp-tokens. Then the final concatenation can be done. */5.50 -#undef CONCAT45.51 -#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))5.52 -#endif5.53 -#endif5.54 -5.55 -/* The word size used by BFD on the host. This may be 64 with a 325.56 - bit target if the host is 64 bit, or if other 64 bit targets have5.57 - been selected with --enable-targets, or if --enable-64-bit-bfd. */5.58 -#define BFD_ARCH_SIZE 645.59 -5.60 -/* The word size of the default bfd target. */5.61 -#define BFD_DEFAULT_TARGET_SIZE 325.62 -5.63 -#define BFD_HOST_64BIT_LONG 05.64 -#define BFD_HOST_LONG_LONG 15.65 -#if 15.66 -#define BFD_HOST_64_BIT long long5.67 -#define BFD_HOST_U_64_BIT unsigned long long5.68 -typedef BFD_HOST_64_BIT bfd_int64_t;5.69 -typedef BFD_HOST_U_64_BIT bfd_uint64_t;5.70 -#endif5.71 -5.72 -#if BFD_ARCH_SIZE >= 645.73 -#define BFD645.74 -#endif5.75 -5.76 -#ifndef INLINE5.77 -#if __GNUC__ >= 25.78 -#define INLINE __inline__5.79 -#else5.80 -#define INLINE5.81 -#endif5.82 -#endif5.83 -5.84 -/* Forward declaration. */5.85 -typedef struct bfd bfd;5.86 -5.87 -/* Boolean type used in bfd. Too many systems define their own5.88 - versions of "boolean" for us to safely typedef a "boolean" of5.89 - our own. Using an enum for "bfd_boolean" has its own set of5.90 - problems, with strange looking casts required to avoid warnings5.91 - on some older compilers. Thus we just use an int.5.92 -5.93 - General rule: Functions which are bfd_boolean return TRUE on5.94 - success and FALSE on failure (unless they're a predicate). */5.95 -5.96 -typedef int bfd_boolean;5.97 -#undef FALSE5.98 -#undef TRUE5.99 -#define FALSE 05.100 -#define TRUE 15.101 -5.102 -#ifdef BFD645.103 -5.104 -#ifndef BFD_HOST_64_BIT5.105 - #error No 64 bit integer type available5.106 -#endif /* ! defined (BFD_HOST_64_BIT) */5.107 -5.108 -typedef BFD_HOST_U_64_BIT bfd_vma;5.109 -typedef BFD_HOST_64_BIT bfd_signed_vma;5.110 -typedef BFD_HOST_U_64_BIT bfd_size_type;5.111 -typedef BFD_HOST_U_64_BIT symvalue;5.112 -5.113 -#ifndef fprintf_vma5.114 -#if BFD_HOST_64BIT_LONG5.115 -#define sprintf_vma(s,x) sprintf (s, "%016lx", x)5.116 -#define fprintf_vma(f,x) fprintf (f, "%016lx", x)5.117 -#else5.118 -#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))5.119 -#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))5.120 -#define fprintf_vma(s,x) \5.121 - fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))5.122 -#define sprintf_vma(s,x) \5.123 - sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))5.124 -#endif5.125 -#endif5.126 -5.127 -#else /* not BFD64 */5.128 -5.129 -/* Represent a target address. Also used as a generic unsigned type5.130 - which is guaranteed to be big enough to hold any arithmetic types5.131 - we need to deal with. */5.132 -typedef unsigned long bfd_vma;5.133 -5.134 -/* A generic signed type which is guaranteed to be big enough to hold any5.135 - arithmetic types we need to deal with. Can be assumed to be compatible5.136 - with bfd_vma in the same way that signed and unsigned ints are compatible5.137 - (as parameters, in assignment, etc). */5.138 -typedef long bfd_signed_vma;5.139 -5.140 -typedef unsigned long symvalue;5.141 -typedef unsigned long bfd_size_type;5.142 -5.143 -/* Print a bfd_vma x on stream s. */5.144 -#define fprintf_vma(s,x) fprintf (s, "%08lx", x)5.145 -#define sprintf_vma(s,x) sprintf (s, "%08lx", x)5.146 -5.147 -#endif /* not BFD64 */5.148 -5.149 -#ifndef BFD_HOST_64_BIT5.150 -/* Fall back on a 32 bit type. The idea is to make these types always5.151 - available for function return types, but in the case that5.152 - BFD_HOST_64_BIT is undefined such a function should abort or5.153 - otherwise signal an error. */5.154 -typedef bfd_signed_vma bfd_int64_t;5.155 -typedef bfd_vma bfd_uint64_t;5.156 -#endif5.157 -5.158 -/* An offset into a file. BFD always uses the largest possible offset5.159 - based on the build time availability of fseek, fseeko, or fseeko64. */5.160 -typedef BFD_HOST_64_BIT file_ptr;5.161 -typedef unsigned BFD_HOST_64_BIT ufile_ptr;5.162 -5.163 -extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);5.164 -extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);5.165 -5.166 -#define printf_vma(x) fprintf_vma(stdout,x)5.167 -#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)5.168 -5.169 -typedef unsigned int flagword; /* 32 bits of flags */5.170 -typedef unsigned char bfd_byte;5.171 -5.172 -/* File formats. */5.173 -5.174 -typedef enum bfd_format5.175 -{5.176 - bfd_unknown = 0, /* File format is unknown. */5.177 - bfd_object, /* Linker/assembler/compiler output. */5.178 - bfd_archive, /* Object archive file. */5.179 - bfd_core, /* Core dump. */5.180 - bfd_type_end /* Marks the end; don't use it! */5.181 -}5.182 -bfd_format;5.183 -5.184 -/* Values that may appear in the flags field of a BFD. These also5.185 - appear in the object_flags field of the bfd_target structure, where5.186 - they indicate the set of flags used by that backend (not all flags5.187 - are meaningful for all object file formats) (FIXME: at the moment,5.188 - the object_flags values have mostly just been copied from backend5.189 - to another, and are not necessarily correct). */5.190 -5.191 -/* No flags. */5.192 -#define BFD_NO_FLAGS 0x005.193 -5.194 -/* BFD contains relocation entries. */5.195 -#define HAS_RELOC 0x015.196 -5.197 -/* BFD is directly executable. */5.198 -#define EXEC_P 0x025.199 -5.200 -/* BFD has line number information (basically used for F_LNNO in a5.201 - COFF header). */5.202 -#define HAS_LINENO 0x045.203 -5.204 -/* BFD has debugging information. */5.205 -#define HAS_DEBUG 0x085.206 -5.207 -/* BFD has symbols. */5.208 -#define HAS_SYMS 0x105.209 -5.210 -/* BFD has local symbols (basically used for F_LSYMS in a COFF5.211 - header). */5.212 -#define HAS_LOCALS 0x205.213 -5.214 -/* BFD is a dynamic object. */5.215 -#define DYNAMIC 0x405.216 -5.217 -/* Text section is write protected (if D_PAGED is not set, this is5.218 - like an a.out NMAGIC file) (the linker sets this by default, but5.219 - clears it for -r or -N). */5.220 -#define WP_TEXT 0x805.221 -5.222 -/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the5.223 - linker sets this by default, but clears it for -r or -n or -N). */5.224 -#define D_PAGED 0x1005.225 -5.226 -/* BFD is relaxable (this means that bfd_relax_section may be able to5.227 - do something) (sometimes bfd_relax_section can do something even if5.228 - this is not set). */5.229 -#define BFD_IS_RELAXABLE 0x2005.230 -5.231 -/* This may be set before writing out a BFD to request using a5.232 - traditional format. For example, this is used to request that when5.233 - writing out an a.out object the symbols not be hashed to eliminate5.234 - duplicates. */5.235 -#define BFD_TRADITIONAL_FORMAT 0x4005.236 -5.237 -/* This flag indicates that the BFD contents are actually cached in5.238 - memory. If this is set, iostream points to a bfd_in_memory struct. */5.239 -#define BFD_IN_MEMORY 0x8005.240 -5.241 -/* The sections in this BFD specify a memory page. */5.242 -#define HAS_LOAD_PAGE 0x10005.243 -5.244 -/* This BFD has been created by the linker and doesn't correspond5.245 - to any input file. */5.246 -#define BFD_LINKER_CREATED 0x20005.247 -5.248 -/* Symbols and relocation. */5.249 -5.250 -/* A count of carsyms (canonical archive symbols). */5.251 -typedef unsigned long symindex;5.252 -5.253 -/* How to perform a relocation. */5.254 -typedef const struct reloc_howto_struct reloc_howto_type;5.255 -5.256 -#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)5.257 -5.258 -/* General purpose part of a symbol X;5.259 - target specific parts are in libcoff.h, libaout.h, etc. */5.260 -5.261 -#define bfd_get_section(x) ((x)->section)5.262 -#define bfd_get_output_section(x) ((x)->section->output_section)5.263 -#define bfd_set_section(x,y) ((x)->section) = (y)5.264 -#define bfd_asymbol_base(x) ((x)->section->vma)5.265 -#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)5.266 -#define bfd_asymbol_name(x) ((x)->name)5.267 -/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/5.268 -#define bfd_asymbol_bfd(x) ((x)->the_bfd)5.269 -#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)5.270 -5.271 -/* A canonical archive symbol. */5.272 -/* This is a type pun with struct ranlib on purpose! */5.273 -typedef struct carsym5.274 -{5.275 - char *name;5.276 - file_ptr file_offset; /* Look here to find the file. */5.277 -}5.278 -carsym; /* To make these you call a carsymogen. */5.279 -5.280 -/* Used in generating armaps (archive tables of contents).5.281 - Perhaps just a forward definition would do? */5.282 -struct orl /* Output ranlib. */5.283 -{5.284 - char **name; /* Symbol name. */5.285 - union5.286 - {5.287 - file_ptr pos;5.288 - bfd *abfd;5.289 - } u; /* bfd* or file position. */5.290 - int namidx; /* Index into string table. */5.291 -};5.292 -5.293 -/* Linenumber stuff. */5.294 -typedef struct lineno_cache_entry5.295 -{5.296 - unsigned int line_number; /* Linenumber from start of function. */5.297 - union5.298 - {5.299 - struct bfd_symbol *sym; /* Function name. */5.300 - bfd_vma offset; /* Offset into section. */5.301 - } u;5.302 -}5.303 -alent;5.304 -5.305 -/* Object and core file sections. */5.306 -5.307 -#define align_power(addr, align) \5.308 - (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))5.309 -5.310 -typedef struct bfd_section *sec_ptr;5.311 -5.312 -#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)5.313 -#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)5.314 -#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)5.315 -#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)5.316 -#define bfd_section_name(bfd, ptr) ((ptr)->name)5.317 -#define bfd_section_size(bfd, ptr) ((ptr)->size)5.318 -#define bfd_get_section_size(ptr) ((ptr)->size)5.319 -#define bfd_section_vma(bfd, ptr) ((ptr)->vma)5.320 -#define bfd_section_lma(bfd, ptr) ((ptr)->lma)5.321 -#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)5.322 -#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)5.323 -#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)5.324 -5.325 -#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)5.326 -5.327 -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)5.328 -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)5.329 -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)5.330 -/* Find the address one past the end of SEC. */5.331 -#define bfd_get_section_limit(bfd, sec) \5.332 - (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \5.333 - / bfd_octets_per_byte (bfd))5.334 -5.335 -typedef struct stat stat_type;5.336 -5.337 -typedef enum bfd_print_symbol5.338 -{5.339 - bfd_print_symbol_name,5.340 - bfd_print_symbol_more,5.341 - bfd_print_symbol_all5.342 -} bfd_print_symbol_type;5.343 -5.344 -/* Information about a symbol that nm needs. */5.345 -5.346 -typedef struct _symbol_info5.347 -{5.348 - symvalue value;5.349 - char type;5.350 - const char *name; /* Symbol name. */5.351 - unsigned char stab_type; /* Stab type. */5.352 - char stab_other; /* Stab other. */5.353 - short stab_desc; /* Stab desc. */5.354 - const char *stab_name; /* String for stab type. */5.355 -} symbol_info;5.356 -5.357 -/* Get the name of a stabs type code. */5.358 -5.359 -extern const char *bfd_get_stab_name (int);5.360 -5.361 -/* Hash table routines. There is no way to free up a hash table. */5.362 -5.363 -/* An element in the hash table. Most uses will actually use a larger5.364 - structure, and an instance of this will be the first field. */5.365 -5.366 -struct bfd_hash_entry5.367 -{5.368 - /* Next entry for this hash code. */5.369 - struct bfd_hash_entry *next;5.370 - /* String being hashed. */5.371 - const char *string;5.372 - /* Hash code. This is the full hash code, not the index into the5.373 - table. */5.374 - unsigned long hash;5.375 -};5.376 -5.377 -/* A hash table. */5.378 -5.379 -struct bfd_hash_table5.380 -{5.381 - /* The hash array. */5.382 - struct bfd_hash_entry **table;5.383 - /* The number of slots in the hash table. */5.384 - unsigned int size;5.385 - /* A function used to create new elements in the hash table. The5.386 - first entry is itself a pointer to an element. When this5.387 - function is first invoked, this pointer will be NULL. However,5.388 - having the pointer permits a hierarchy of method functions to be5.389 - built each of which calls the function in the superclass. Thus5.390 - each function should be written to allocate a new block of memory5.391 - only if the argument is NULL. */5.392 - struct bfd_hash_entry *(*newfunc)5.393 - (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);5.394 - /* An objalloc for this hash table. This is a struct objalloc *,5.395 - but we use void * to avoid requiring the inclusion of objalloc.h. */5.396 - void *memory;5.397 -};5.398 -5.399 -/* Initialize a hash table. */5.400 -extern bfd_boolean bfd_hash_table_init5.401 - (struct bfd_hash_table *,5.402 - struct bfd_hash_entry *(*) (struct bfd_hash_entry *,5.403 - struct bfd_hash_table *,5.404 - const char *));5.405 -5.406 -/* Initialize a hash table specifying a size. */5.407 -extern bfd_boolean bfd_hash_table_init_n5.408 - (struct bfd_hash_table *,5.409 - struct bfd_hash_entry *(*) (struct bfd_hash_entry *,5.410 - struct bfd_hash_table *,5.411 - const char *),5.412 - unsigned int size);5.413 -5.414 -/* Free up a hash table. */5.415 -extern void bfd_hash_table_free5.416 - (struct bfd_hash_table *);5.417 -5.418 -/* Look up a string in a hash table. If CREATE is TRUE, a new entry5.419 - will be created for this string if one does not already exist. The5.420 - COPY argument must be TRUE if this routine should copy the string5.421 - into newly allocated memory when adding an entry. */5.422 -extern struct bfd_hash_entry *bfd_hash_lookup5.423 - (struct bfd_hash_table *, const char *, bfd_boolean create,5.424 - bfd_boolean copy);5.425 -5.426 -/* Replace an entry in a hash table. */5.427 -extern void bfd_hash_replace5.428 - (struct bfd_hash_table *, struct bfd_hash_entry *old,5.429 - struct bfd_hash_entry *nw);5.430 -5.431 -/* Base method for creating a hash table entry. */5.432 -extern struct bfd_hash_entry *bfd_hash_newfunc5.433 - (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);5.434 -5.435 -/* Grab some space for a hash table entry. */5.436 -extern void *bfd_hash_allocate5.437 - (struct bfd_hash_table *, unsigned int);5.438 -5.439 -/* Traverse a hash table in a random order, calling a function on each5.440 - element. If the function returns FALSE, the traversal stops. The5.441 - INFO argument is passed to the function. */5.442 -extern void bfd_hash_traverse5.443 - (struct bfd_hash_table *,5.444 - bfd_boolean (*) (struct bfd_hash_entry *, void *),5.445 - void *info);5.446 -5.447 -/* Allows the default size of a hash table to be configured. New hash5.448 - tables allocated using bfd_hash_table_init will be created with5.449 - this size. */5.450 -extern void bfd_hash_set_default_size (bfd_size_type);5.451 -5.452 -/* This structure is used to keep track of stabs in sections5.453 - information while linking. */5.454 -5.455 -struct stab_info5.456 -{5.457 - /* A hash table used to hold stabs strings. */5.458 - struct bfd_strtab_hash *strings;5.459 - /* The header file hash table. */5.460 - struct bfd_hash_table includes;5.461 - /* The first .stabstr section. */5.462 - struct bfd_section *stabstr;5.463 -};5.464 -5.465 -#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table5.466 -5.467 -/* User program access to BFD facilities. */5.468 -5.469 -/* Direct I/O routines, for programs which know more about the object5.470 - file than BFD does. Use higher level routines if possible. */5.471 -5.472 -extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);5.473 -extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);5.474 -extern int bfd_seek (bfd *, file_ptr, int);5.475 -extern file_ptr bfd_tell (bfd *);5.476 -extern int bfd_flush (bfd *);5.477 -extern int bfd_stat (bfd *, struct stat *);5.478 -5.479 -/* Deprecated old routines. */5.480 -#if __GNUC__5.481 -#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \5.482 - (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \5.483 - bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))5.484 -#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \5.485 - (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \5.486 - bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))5.487 -#else5.488 -#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \5.489 - (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \5.490 - bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))5.491 -#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \5.492 - (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\5.493 - bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))5.494 -#endif5.495 -extern void warn_deprecated (const char *, const char *, int, const char *);5.496 -5.497 -/* Cast from const char * to char * so that caller can assign to5.498 - a char * without a warning. */5.499 -#define bfd_get_filename(abfd) ((char *) (abfd)->filename)5.500 -#define bfd_get_cacheable(abfd) ((abfd)->cacheable)5.501 -#define bfd_get_format(abfd) ((abfd)->format)5.502 -#define bfd_get_target(abfd) ((abfd)->xvec->name)5.503 -#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)5.504 -#define bfd_family_coff(abfd) \5.505 - (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \5.506 - bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)5.507 -#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)5.508 -#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)5.509 -#define bfd_header_big_endian(abfd) \5.510 - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)5.511 -#define bfd_header_little_endian(abfd) \5.512 - ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)5.513 -#define bfd_get_file_flags(abfd) ((abfd)->flags)5.514 -#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)5.515 -#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)5.516 -#define bfd_my_archive(abfd) ((abfd)->my_archive)5.517 -#define bfd_has_map(abfd) ((abfd)->has_armap)5.518 -5.519 -#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)5.520 -#define bfd_usrdata(abfd) ((abfd)->usrdata)5.521 -5.522 -#define bfd_get_start_address(abfd) ((abfd)->start_address)5.523 -#define bfd_get_symcount(abfd) ((abfd)->symcount)5.524 -#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)5.525 -#define bfd_count_sections(abfd) ((abfd)->section_count)5.526 -5.527 -#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)5.528 -5.529 -#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)5.530 -5.531 -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)5.532 -5.533 -extern bfd_boolean bfd_cache_close5.534 - (bfd *abfd);5.535 -/* NB: This declaration should match the autogenerated one in libbfd.h. */5.536 -5.537 -extern bfd_boolean bfd_cache_close_all (void);5.538 -5.539 -extern bfd_boolean bfd_record_phdr5.540 - (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,5.541 - bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);5.542 -5.543 -/* Byte swapping routines. */5.544 -5.545 -bfd_uint64_t bfd_getb64 (const void *);5.546 -bfd_uint64_t bfd_getl64 (const void *);5.547 -bfd_int64_t bfd_getb_signed_64 (const void *);5.548 -bfd_int64_t bfd_getl_signed_64 (const void *);5.549 -bfd_vma bfd_getb32 (const void *);5.550 -bfd_vma bfd_getl32 (const void *);5.551 -bfd_signed_vma bfd_getb_signed_32 (const void *);5.552 -bfd_signed_vma bfd_getl_signed_32 (const void *);5.553 -bfd_vma bfd_getb16 (const void *);5.554 -bfd_vma bfd_getl16 (const void *);5.555 -bfd_signed_vma bfd_getb_signed_16 (const void *);5.556 -bfd_signed_vma bfd_getl_signed_16 (const void *);5.557 -void bfd_putb64 (bfd_uint64_t, void *);5.558 -void bfd_putl64 (bfd_uint64_t, void *);5.559 -void bfd_putb32 (bfd_vma, void *);5.560 -void bfd_putl32 (bfd_vma, void *);5.561 -void bfd_putb16 (bfd_vma, void *);5.562 -void bfd_putl16 (bfd_vma, void *);5.563 -5.564 -/* Byte swapping routines which take size and endiannes as arguments. */5.565 -5.566 -bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);5.567 -void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);5.568 -5.569 -extern bfd_boolean bfd_section_already_linked_table_init (void);5.570 -extern void bfd_section_already_linked_table_free (void);5.571 -5.572 -/* Externally visible ECOFF routines. */5.573 -5.574 -#if defined(__STDC__) || defined(ALMOST_STDC)5.575 -struct ecoff_debug_info;5.576 -struct ecoff_debug_swap;5.577 -struct ecoff_extr;5.578 -struct bfd_symbol;5.579 -struct bfd_link_info;5.580 -struct bfd_link_hash_entry;5.581 -struct bfd_elf_version_tree;5.582 -#endif5.583 -extern bfd_vma bfd_ecoff_get_gp_value5.584 - (bfd * abfd);5.585 -extern bfd_boolean bfd_ecoff_set_gp_value5.586 - (bfd *abfd, bfd_vma gp_value);5.587 -extern bfd_boolean bfd_ecoff_set_regmasks5.588 - (bfd *abfd, unsigned long gprmask, unsigned long fprmask,5.589 - unsigned long *cprmask);5.590 -extern void *bfd_ecoff_debug_init5.591 - (bfd *output_bfd, struct ecoff_debug_info *output_debug,5.592 - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);5.593 -extern void bfd_ecoff_debug_free5.594 - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,5.595 - const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);5.596 -extern bfd_boolean bfd_ecoff_debug_accumulate5.597 - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,5.598 - const struct ecoff_debug_swap *output_swap, bfd *input_bfd,5.599 - struct ecoff_debug_info *input_debug,5.600 - const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);5.601 -extern bfd_boolean bfd_ecoff_debug_accumulate_other5.602 - (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,5.603 - const struct ecoff_debug_swap *output_swap, bfd *input_bfd,5.604 - struct bfd_link_info *);5.605 -extern bfd_boolean bfd_ecoff_debug_externals5.606 - (bfd *abfd, struct ecoff_debug_info *debug,5.607 - const struct ecoff_debug_swap *swap, bfd_boolean relocatable,5.608 - bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),5.609 - void (*set_index) (struct bfd_symbol *, bfd_size_type));5.610 -extern bfd_boolean bfd_ecoff_debug_one_external5.611 - (bfd *abfd, struct ecoff_debug_info *debug,5.612 - const struct ecoff_debug_swap *swap, const char *name,5.613 - struct ecoff_extr *esym);5.614 -extern bfd_size_type bfd_ecoff_debug_size5.615 - (bfd *abfd, struct ecoff_debug_info *debug,5.616 - const struct ecoff_debug_swap *swap);5.617 -extern bfd_boolean bfd_ecoff_write_debug5.618 - (bfd *abfd, struct ecoff_debug_info *debug,5.619 - const struct ecoff_debug_swap *swap, file_ptr where);5.620 -extern bfd_boolean bfd_ecoff_write_accumulated_debug5.621 - (void *handle, bfd *abfd, struct ecoff_debug_info *debug,5.622 - const struct ecoff_debug_swap *swap,5.623 - struct bfd_link_info *info, file_ptr where);5.624 -5.625 -/* Externally visible ELF routines. */5.626 -5.627 -struct bfd_link_needed_list5.628 -{5.629 - struct bfd_link_needed_list *next;5.630 - bfd *by;5.631 - const char *name;5.632 -};5.633 -5.634 -enum dynamic_lib_link_class {5.635 - DYN_NORMAL = 0,5.636 - DYN_AS_NEEDED = 1,5.637 - DYN_DT_NEEDED = 2,5.638 - DYN_NO_ADD_NEEDED = 4,5.639 - DYN_NO_NEEDED = 85.640 -};5.641 -5.642 -extern bfd_boolean bfd_elf_record_link_assignment5.643 - (bfd *, struct bfd_link_info *, const char *, bfd_boolean);5.644 -extern struct bfd_link_needed_list *bfd_elf_get_needed_list5.645 - (bfd *, struct bfd_link_info *);5.646 -extern bfd_boolean bfd_elf_get_bfd_needed_list5.647 - (bfd *, struct bfd_link_needed_list **);5.648 -extern bfd_boolean bfd_elf_size_dynamic_sections5.649 - (bfd *, const char *, const char *, const char *, const char * const *,5.650 - struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *);5.651 -extern void bfd_elf_set_dt_needed_name5.652 - (bfd *, const char *);5.653 -extern const char *bfd_elf_get_dt_soname5.654 - (bfd *);5.655 -extern void bfd_elf_set_dyn_lib_class5.656 - (bfd *, int);5.657 -extern int bfd_elf_get_dyn_lib_class5.658 - (bfd *);5.659 -extern struct bfd_link_needed_list *bfd_elf_get_runpath_list5.660 - (bfd *, struct bfd_link_info *);5.661 -extern bfd_boolean bfd_elf_discard_info5.662 - (bfd *, struct bfd_link_info *);5.663 -5.664 -/* Return an upper bound on the number of bytes required to store a5.665 - copy of ABFD's program header table entries. Return -1 if an error5.666 - occurs; bfd_get_error will return an appropriate code. */5.667 -extern long bfd_get_elf_phdr_upper_bound5.668 - (bfd *abfd);5.669 -5.670 -/* Copy ABFD's program header table entries to *PHDRS. The entries5.671 - will be stored as an array of Elf_Internal_Phdr structures, as5.672 - defined in include/elf/internal.h. To find out how large the5.673 - buffer needs to be, call bfd_get_elf_phdr_upper_bound.5.674 -5.675 - Return the number of program header table entries read, or -1 if an5.676 - error occurs; bfd_get_error will return an appropriate code. */5.677 -extern int bfd_get_elf_phdrs5.678 - (bfd *abfd, void *phdrs);5.679 -5.680 -/* Create a new BFD as if by bfd_openr. Rather than opening a file,5.681 - reconstruct an ELF file by reading the segments out of remote memory5.682 - based on the ELF file header at EHDR_VMA and the ELF program headers it5.683 - points to. If not null, *LOADBASEP is filled in with the difference5.684 - between the VMAs from which the segments were read, and the VMAs the5.685 - file headers (and hence BFD's idea of each section's VMA) put them at.5.686 -5.687 - The function TARGET_READ_MEMORY is called to copy LEN bytes from the5.688 - remote memory at target address VMA into the local buffer at MYADDR; it5.689 - should return zero on success or an `errno' code on failure. TEMPL must5.690 - be a BFD for an ELF target with the word size and byte order found in5.691 - the remote memory. */5.692 -extern bfd *bfd_elf_bfd_from_remote_memory5.693 - (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,5.694 - int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));5.695 -5.696 -/* Return the arch_size field of an elf bfd, or -1 if not elf. */5.697 -extern int bfd_get_arch_size5.698 - (bfd *);5.699 -5.700 -/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */5.701 -extern int bfd_get_sign_extend_vma5.702 - (bfd *);5.703 -5.704 -extern struct bfd_section *_bfd_elf_tls_setup5.705 - (bfd *, struct bfd_link_info *);5.706 -5.707 -extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs5.708 - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);5.709 -5.710 -/* SunOS shared library support routines for the linker. */5.711 -5.712 -extern struct bfd_link_needed_list *bfd_sunos_get_needed_list5.713 - (bfd *, struct bfd_link_info *);5.714 -extern bfd_boolean bfd_sunos_record_link_assignment5.715 - (bfd *, struct bfd_link_info *, const char *);5.716 -extern bfd_boolean bfd_sunos_size_dynamic_sections5.717 - (bfd *, struct bfd_link_info *, struct bfd_section **, struct bfd_section **, struct bfd_section **);5.718 -5.719 -/* Linux shared library support routines for the linker. */5.720 -5.721 -extern bfd_boolean bfd_i386linux_size_dynamic_sections5.722 - (bfd *, struct bfd_link_info *);5.723 -extern bfd_boolean bfd_m68klinux_size_dynamic_sections5.724 - (bfd *, struct bfd_link_info *);5.725 -extern bfd_boolean bfd_sparclinux_size_dynamic_sections5.726 - (bfd *, struct bfd_link_info *);5.727 -5.728 -/* mmap hacks */5.729 -5.730 -struct _bfd_window_internal;5.731 -typedef struct _bfd_window_internal bfd_window_internal;5.732 -5.733 -typedef struct _bfd_window5.734 -{5.735 - /* What the user asked for. */5.736 - void *data;5.737 - bfd_size_type size;5.738 - /* The actual window used by BFD. Small user-requested read-only5.739 - regions sharing a page may share a single window into the object5.740 - file. Read-write versions shouldn't until I've fixed things to5.741 - keep track of which portions have been claimed by the5.742 - application; don't want to give the same region back when the5.743 - application wants two writable copies! */5.744 - struct _bfd_window_internal *i;5.745 -}5.746 -bfd_window;5.747 -5.748 -extern void bfd_init_window5.749 - (bfd_window *);5.750 -extern void bfd_free_window5.751 - (bfd_window *);5.752 -extern bfd_boolean bfd_get_file_window5.753 - (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);5.754 -5.755 -/* XCOFF support routines for the linker. */5.756 -5.757 -extern bfd_boolean bfd_xcoff_link_record_set5.758 - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);5.759 -extern bfd_boolean bfd_xcoff_import_symbol5.760 - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,5.761 - const char *, const char *, const char *, unsigned int);5.762 -extern bfd_boolean bfd_xcoff_export_symbol5.763 - (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);5.764 -extern bfd_boolean bfd_xcoff_link_count_reloc5.765 - (bfd *, struct bfd_link_info *, const char *);5.766 -extern bfd_boolean bfd_xcoff_record_link_assignment5.767 - (bfd *, struct bfd_link_info *, const char *);5.768 -extern bfd_boolean bfd_xcoff_size_dynamic_sections5.769 - (bfd *, struct bfd_link_info *, const char *, const char *,5.770 - unsigned long, unsigned long, unsigned long, bfd_boolean,5.771 - int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean);5.772 -extern bfd_boolean bfd_xcoff_link_generate_rtinit5.773 - (bfd *, const char *, const char *, bfd_boolean);5.774 -5.775 -/* XCOFF support routines for ar. */5.776 -extern bfd_boolean bfd_xcoff_ar_archive_set_magic5.777 - (bfd *, char *);5.778 -5.779 -/* Externally visible COFF routines. */5.780 -5.781 -#if defined(__STDC__) || defined(ALMOST_STDC)5.782 -struct internal_syment;5.783 -union internal_auxent;5.784 -#endif5.785 -5.786 -extern bfd_boolean bfd_coff_get_syment5.787 - (bfd *, struct bfd_symbol *, struct internal_syment *);5.788 -5.789 -extern bfd_boolean bfd_coff_get_auxent5.790 - (bfd *, struct bfd_symbol *, int, union internal_auxent *);5.791 -5.792 -extern bfd_boolean bfd_coff_set_symbol_class5.793 - (bfd *, struct bfd_symbol *, unsigned int);5.794 -5.795 -extern bfd_boolean bfd_m68k_coff_create_embedded_relocs5.796 - (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);5.797 -5.798 -/* ARM Interworking support. Called from linker. */5.799 -extern bfd_boolean bfd_arm_allocate_interworking_sections5.800 - (struct bfd_link_info *);5.801 -5.802 -extern bfd_boolean bfd_arm_process_before_allocation5.803 - (bfd *, struct bfd_link_info *, int);5.804 -5.805 -extern bfd_boolean bfd_arm_get_bfd_for_interworking5.806 - (bfd *, struct bfd_link_info *);5.807 -5.808 -/* PE ARM Interworking support. Called from linker. */5.809 -extern bfd_boolean bfd_arm_pe_allocate_interworking_sections5.810 - (struct bfd_link_info *);5.811 -5.812 -extern bfd_boolean bfd_arm_pe_process_before_allocation5.813 - (bfd *, struct bfd_link_info *, int);5.814 -5.815 -extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking5.816 - (bfd *, struct bfd_link_info *);5.817 -5.818 -/* ELF ARM Interworking support. Called from linker. */5.819 -extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections5.820 - (struct bfd_link_info *);5.821 -5.822 -extern bfd_boolean bfd_elf32_arm_process_before_allocation5.823 - (bfd *, struct bfd_link_info *, int);5.824 -5.825 -void bfd_elf32_arm_set_target_relocs5.826 - (struct bfd_link_info *, int, char *, int);5.827 -5.828 -extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking5.829 - (bfd *, struct bfd_link_info *);5.830 -5.831 -extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd5.832 - (bfd *, struct bfd_link_info *);5.833 -5.834 -/* ARM Note section processing. */5.835 -extern bfd_boolean bfd_arm_merge_machines5.836 - (bfd *, bfd *);5.837 -5.838 -extern bfd_boolean bfd_arm_update_notes5.839 - (bfd *, const char *);5.840 -5.841 -extern unsigned int bfd_arm_get_mach_from_notes5.842 - (bfd *, const char *);5.843 -5.844 -/* TI COFF load page support. */5.845 -extern void bfd_ticoff_set_section_load_page5.846 - (struct bfd_section *, int);5.847 -5.848 -extern int bfd_ticoff_get_section_load_page5.849 - (struct bfd_section *);5.850 -5.851 -/* H8/300 functions. */5.852 -extern bfd_vma bfd_h8300_pad_address5.853 - (bfd *, bfd_vma);5.854 -5.855 -/* IA64 Itanium code generation. Called from linker. */5.856 -extern void bfd_elf32_ia64_after_parse5.857 - (int);5.858 -5.859 -extern void bfd_elf64_ia64_after_parse5.860 - (int);5.861 -5.862 -/* This structure is used for a comdat section, as in PE. A comdat5.863 - section is associated with a particular symbol. When the linker5.864 - sees a comdat section, it keeps only one of the sections with a5.865 - given name and associated with a given symbol. */5.866 -5.867 -struct coff_comdat_info5.868 -{5.869 - /* The name of the symbol associated with a comdat section. */5.870 - const char *name;5.871 -5.872 - /* The local symbol table index of the symbol associated with a5.873 - comdat section. This is only meaningful to the object file format5.874 - specific code; it is not an index into the list returned by5.875 - bfd_canonicalize_symtab. */5.876 - long symbol;5.877 -};5.878 -5.879 -extern struct coff_comdat_info *bfd_coff_get_comdat_section5.880 - (bfd *, struct bfd_section *);5.881 -5.882 -/* Extracted from init.c. */5.883 -void bfd_init (void);5.884 -5.885 -/* Extracted from opncls.c. */5.886 -bfd *bfd_openr (const char *filename, const char *target);5.887 -5.888 -bfd *bfd_fdopenr (const char *filename, const char *target, int fd);5.889 -5.890 -bfd *bfd_openstreamr (const char *, const char *, void *);5.891 -5.892 -bfd *bfd_openr_iovec (const char *filename, const char *target,5.893 - void *(*open) (struct bfd *nbfd,5.894 - void *open_closure),5.895 - void *open_closure,5.896 - file_ptr (*pread) (struct bfd *nbfd,5.897 - void *stream,5.898 - void *buf,5.899 - file_ptr nbytes,5.900 - file_ptr offset),5.901 - int (*close) (struct bfd *nbfd,5.902 - void *stream));5.903 -5.904 -bfd *bfd_openw (const char *filename, const char *target);5.905 -5.906 -bfd_boolean bfd_close (bfd *abfd);5.907 -5.908 -bfd_boolean bfd_close_all_done (bfd *);5.909 -5.910 -bfd *bfd_create (const char *filename, bfd *templ);5.911 -5.912 -bfd_boolean bfd_make_writable (bfd *abfd);5.913 -5.914 -bfd_boolean bfd_make_readable (bfd *abfd);5.915 -5.916 -unsigned long bfd_calc_gnu_debuglink_crc325.917 - (unsigned long crc, const unsigned char *buf, bfd_size_type len);5.918 -5.919 -char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);5.920 -5.921 -struct bfd_section *bfd_create_gnu_debuglink_section5.922 - (bfd *abfd, const char *filename);5.923 -5.924 -bfd_boolean bfd_fill_in_gnu_debuglink_section5.925 - (bfd *abfd, struct bfd_section *sect, const char *filename);5.926 -5.927 -/* Extracted from libbfd.c. */5.928 -5.929 -/* Byte swapping macros for user section data. */5.930 -5.931 -#define bfd_put_8(abfd, val, ptr) \5.932 - ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))5.933 -#define bfd_put_signed_8 \5.934 - bfd_put_85.935 -#define bfd_get_8(abfd, ptr) \5.936 - (*(unsigned char *) (ptr) & 0xff)5.937 -#define bfd_get_signed_8(abfd, ptr) \5.938 - (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)5.939 -5.940 -#define bfd_put_16(abfd, val, ptr) \5.941 - BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))5.942 -#define bfd_put_signed_16 \5.943 - bfd_put_165.944 -#define bfd_get_16(abfd, ptr) \5.945 - BFD_SEND (abfd, bfd_getx16, (ptr))5.946 -#define bfd_get_signed_16(abfd, ptr) \5.947 - BFD_SEND (abfd, bfd_getx_signed_16, (ptr))5.948 -5.949 -#define bfd_put_32(abfd, val, ptr) \5.950 - BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))5.951 -#define bfd_put_signed_32 \5.952 - bfd_put_325.953 -#define bfd_get_32(abfd, ptr) \5.954 - BFD_SEND (abfd, bfd_getx32, (ptr))5.955 -#define bfd_get_signed_32(abfd, ptr) \5.956 - BFD_SEND (abfd, bfd_getx_signed_32, (ptr))5.957 -5.958 -#define bfd_put_64(abfd, val, ptr) \5.959 - BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))5.960 -#define bfd_put_signed_64 \5.961 - bfd_put_645.962 -#define bfd_get_64(abfd, ptr) \5.963 - BFD_SEND (abfd, bfd_getx64, (ptr))5.964 -#define bfd_get_signed_64(abfd, ptr) \5.965 - BFD_SEND (abfd, bfd_getx_signed_64, (ptr))5.966 -5.967 -#define bfd_get(bits, abfd, ptr) \5.968 - ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \5.969 - : (bits) == 16 ? bfd_get_16 (abfd, ptr) \5.970 - : (bits) == 32 ? bfd_get_32 (abfd, ptr) \5.971 - : (bits) == 64 ? bfd_get_64 (abfd, ptr) \5.972 - : (abort (), (bfd_vma) - 1))5.973 -5.974 -#define bfd_put(bits, abfd, val, ptr) \5.975 - ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \5.976 - : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \5.977 - : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \5.978 - : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \5.979 - : (abort (), (void) 0))5.980 -5.981 -5.982 -/* Byte swapping macros for file header data. */5.983 -5.984 -#define bfd_h_put_8(abfd, val, ptr) \5.985 - bfd_put_8 (abfd, val, ptr)5.986 -#define bfd_h_put_signed_8(abfd, val, ptr) \5.987 - bfd_put_8 (abfd, val, ptr)5.988 -#define bfd_h_get_8(abfd, ptr) \5.989 - bfd_get_8 (abfd, ptr)5.990 -#define bfd_h_get_signed_8(abfd, ptr) \5.991 - bfd_get_signed_8 (abfd, ptr)5.992 -5.993 -#define bfd_h_put_16(abfd, val, ptr) \5.994 - BFD_SEND (abfd, bfd_h_putx16, (val, ptr))5.995 -#define bfd_h_put_signed_16 \5.996 - bfd_h_put_165.997 -#define bfd_h_get_16(abfd, ptr) \5.998 - BFD_SEND (abfd, bfd_h_getx16, (ptr))5.999 -#define bfd_h_get_signed_16(abfd, ptr) \5.1000 - BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))5.1001 -5.1002 -#define bfd_h_put_32(abfd, val, ptr) \5.1003 - BFD_SEND (abfd, bfd_h_putx32, (val, ptr))5.1004 -#define bfd_h_put_signed_32 \5.1005 - bfd_h_put_325.1006 -#define bfd_h_get_32(abfd, ptr) \5.1007 - BFD_SEND (abfd, bfd_h_getx32, (ptr))5.1008 -#define bfd_h_get_signed_32(abfd, ptr) \5.1009 - BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))5.1010 -5.1011 -#define bfd_h_put_64(abfd, val, ptr) \5.1012 - BFD_SEND (abfd, bfd_h_putx64, (val, ptr))5.1013 -#define bfd_h_put_signed_64 \5.1014 - bfd_h_put_645.1015 -#define bfd_h_get_64(abfd, ptr) \5.1016 - BFD_SEND (abfd, bfd_h_getx64, (ptr))5.1017 -#define bfd_h_get_signed_64(abfd, ptr) \5.1018 - BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))5.1019 -5.1020 -/* Aliases for the above, which should eventually go away. */5.1021 -5.1022 -#define H_PUT_64 bfd_h_put_645.1023 -#define H_PUT_32 bfd_h_put_325.1024 -#define H_PUT_16 bfd_h_put_165.1025 -#define H_PUT_8 bfd_h_put_85.1026 -#define H_PUT_S64 bfd_h_put_signed_645.1027 -#define H_PUT_S32 bfd_h_put_signed_325.1028 -#define H_PUT_S16 bfd_h_put_signed_165.1029 -#define H_PUT_S8 bfd_h_put_signed_85.1030 -#define H_GET_64 bfd_h_get_645.1031 -#define H_GET_32 bfd_h_get_325.1032 -#define H_GET_16 bfd_h_get_165.1033 -#define H_GET_8 bfd_h_get_85.1034 -#define H_GET_S64 bfd_h_get_signed_645.1035 -#define H_GET_S32 bfd_h_get_signed_325.1036 -#define H_GET_S16 bfd_h_get_signed_165.1037 -#define H_GET_S8 bfd_h_get_signed_85.1038 -5.1039 -5.1040 -/* Extracted from bfdio.c. */5.1041 -long bfd_get_mtime (bfd *abfd);5.1042 -5.1043 -long bfd_get_size (bfd *abfd);5.1044 -5.1045 -/* Extracted from bfdwin.c. */5.1046 -/* Extracted from section.c. */5.1047 -typedef struct bfd_section5.1048 -{5.1049 - /* The name of the section; the name isn't a copy, the pointer is5.1050 - the same as that passed to bfd_make_section. */5.1051 - const char *name;5.1052 -5.1053 - /* A unique sequence number. */5.1054 - int id;5.1055 -5.1056 - /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */5.1057 - int index;5.1058 -5.1059 - /* The next section in the list belonging to the BFD, or NULL. */5.1060 - struct bfd_section *next;5.1061 -5.1062 - /* The field flags contains attributes of the section. Some5.1063 - flags are read in from the object file, and some are5.1064 - synthesized from other information. */5.1065 - flagword flags;5.1066 -5.1067 -#define SEC_NO_FLAGS 0x0005.1068 -5.1069 - /* Tells the OS to allocate space for this section when loading.5.1070 - This is clear for a section containing debug information only. */5.1071 -#define SEC_ALLOC 0x0015.1072 -5.1073 - /* Tells the OS to load the section from the file when loading.5.1074 - This is clear for a .bss section. */5.1075 -#define SEC_LOAD 0x0025.1076 -5.1077 - /* The section contains data still to be relocated, so there is5.1078 - some relocation information too. */5.1079 -#define SEC_RELOC 0x0045.1080 -5.1081 - /* A signal to the OS that the section contains read only data. */5.1082 -#define SEC_READONLY 0x0085.1083 -5.1084 - /* The section contains code only. */5.1085 -#define SEC_CODE 0x0105.1086 -5.1087 - /* The section contains data only. */5.1088 -#define SEC_DATA 0x0205.1089 -5.1090 - /* The section will reside in ROM. */5.1091 -#define SEC_ROM 0x0405.1092 -5.1093 - /* The section contains constructor information. This section5.1094 - type is used by the linker to create lists of constructors and5.1095 - destructors used by <<g++>>. When a back end sees a symbol5.1096 - which should be used in a constructor list, it creates a new5.1097 - section for the type of name (e.g., <<__CTOR_LIST__>>), attaches5.1098 - the symbol to it, and builds a relocation. To build the lists5.1099 - of constructors, all the linker has to do is catenate all the5.1100 - sections called <<__CTOR_LIST__>> and relocate the data5.1101 - contained within - exactly the operations it would peform on5.1102 - standard data. */5.1103 -#define SEC_CONSTRUCTOR 0x0805.1104 -5.1105 - /* The section has contents - a data section could be5.1106 - <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be5.1107 - <<SEC_HAS_CONTENTS>> */5.1108 -#define SEC_HAS_CONTENTS 0x1005.1109 -5.1110 - /* An instruction to the linker to not output the section5.1111 - even if it has information which would normally be written. */5.1112 -#define SEC_NEVER_LOAD 0x2005.1113 -5.1114 - /* The section contains thread local data. */5.1115 -#define SEC_THREAD_LOCAL 0x4005.1116 -5.1117 - /* The section has GOT references. This flag is only for the5.1118 - linker, and is currently only used by the elf32-hppa back end.5.1119 - It will be set if global offset table references were detected5.1120 - in this section, which indicate to the linker that the section5.1121 - contains PIC code, and must be handled specially when doing a5.1122 - static link. */5.1123 -#define SEC_HAS_GOT_REF 0x8005.1124 -5.1125 - /* The section contains common symbols (symbols may be defined5.1126 - multiple times, the value of a symbol is the amount of5.1127 - space it requires, and the largest symbol value is the one5.1128 - used). Most targets have exactly one of these (which we5.1129 - translate to bfd_com_section_ptr), but ECOFF has two. */5.1130 -#define SEC_IS_COMMON 0x10005.1131 -5.1132 - /* The section contains only debugging information. For5.1133 - example, this is set for ELF .debug and .stab sections.5.1134 - strip tests this flag to see if a section can be5.1135 - discarded. */5.1136 -#define SEC_DEBUGGING 0x20005.1137 -5.1138 - /* The contents of this section are held in memory pointed to5.1139 - by the contents field. This is checked by bfd_get_section_contents,5.1140 - and the data is retrieved from memory if appropriate. */5.1141 -#define SEC_IN_MEMORY 0x40005.1142 -5.1143 - /* The contents of this section are to be excluded by the5.1144 - linker for executable and shared objects unless those5.1145 - objects are to be further relocated. */5.1146 -#define SEC_EXCLUDE 0x80005.1147 -5.1148 - /* The contents of this section are to be sorted based on the sum of5.1149 - the symbol and addend values specified by the associated relocation5.1150 - entries. Entries without associated relocation entries will be5.1151 - appended to the end of the section in an unspecified order. */5.1152 -#define SEC_SORT_ENTRIES 0x100005.1153 -5.1154 - /* When linking, duplicate sections of the same name should be5.1155 - discarded, rather than being combined into a single section as5.1156 - is usually done. This is similar to how common symbols are5.1157 - handled. See SEC_LINK_DUPLICATES below. */5.1158 -#define SEC_LINK_ONCE 0x200005.1159 -5.1160 - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker5.1161 - should handle duplicate sections. */5.1162 -#define SEC_LINK_DUPLICATES 0x400005.1163 -5.1164 - /* This value for SEC_LINK_DUPLICATES means that duplicate5.1165 - sections with the same name should simply be discarded. */5.1166 -#define SEC_LINK_DUPLICATES_DISCARD 0x05.1167 -5.1168 - /* This value for SEC_LINK_DUPLICATES means that the linker5.1169 - should warn if there are any duplicate sections, although5.1170 - it should still only link one copy. */5.1171 -#define SEC_LINK_DUPLICATES_ONE_ONLY 0x800005.1172 -5.1173 - /* This value for SEC_LINK_DUPLICATES means that the linker5.1174 - should warn if any duplicate sections are a different size. */5.1175 -#define SEC_LINK_DUPLICATES_SAME_SIZE 0x1000005.1176 -5.1177 - /* This value for SEC_LINK_DUPLICATES means that the linker5.1178 - should warn if any duplicate sections contain different5.1179 - contents. */5.1180 -#define SEC_LINK_DUPLICATES_SAME_CONTENTS \5.1181 - (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)5.1182 -5.1183 - /* This section was created by the linker as part of dynamic5.1184 - relocation or other arcane processing. It is skipped when5.1185 - going through the first-pass output, trusting that someone5.1186 - else up the line will take care of it later. */5.1187 -#define SEC_LINKER_CREATED 0x2000005.1188 -5.1189 - /* This section should not be subject to garbage collection. */5.1190 -#define SEC_KEEP 0x4000005.1191 -5.1192 - /* This section contains "short" data, and should be placed5.1193 - "near" the GP. */5.1194 -#define SEC_SMALL_DATA 0x8000005.1195 -5.1196 - /* Attempt to merge identical entities in the section.5.1197 - Entity size is given in the entsize field. */5.1198 -#define SEC_MERGE 0x10000005.1199 -5.1200 - /* If given with SEC_MERGE, entities to merge are zero terminated5.1201 - strings where entsize specifies character size instead of fixed5.1202 - size entries. */5.1203 -#define SEC_STRINGS 0x20000005.1204 -5.1205 - /* This section contains data about section groups. */5.1206 -#define SEC_GROUP 0x40000005.1207 -5.1208 - /* The section is a COFF shared library section. This flag is5.1209 - only for the linker. If this type of section appears in5.1210 - the input file, the linker must copy it to the output file5.1211 - without changing the vma or size. FIXME: Although this5.1212 - was originally intended to be general, it really is COFF5.1213 - specific (and the flag was renamed to indicate this). It5.1214 - might be cleaner to have some more general mechanism to5.1215 - allow the back end to control what the linker does with5.1216 - sections. */5.1217 -#define SEC_COFF_SHARED_LIBRARY 0x100000005.1218 -5.1219 - /* This section contains data which may be shared with other5.1220 - executables or shared objects. This is for COFF only. */5.1221 -#define SEC_COFF_SHARED 0x200000005.1222 -5.1223 - /* When a section with this flag is being linked, then if the size of5.1224 - the input section is less than a page, it should not cross a page5.1225 - boundary. If the size of the input section is one page or more,5.1226 - it should be aligned on a page boundary. This is for TI5.1227 - TMS320C54X only. */5.1228 -#define SEC_TIC54X_BLOCK 0x400000005.1229 -5.1230 - /* Conditionally link this section; do not link if there are no5.1231 - references found to any symbol in the section. This is for TI5.1232 - TMS320C54X only. */5.1233 -#define SEC_TIC54X_CLINK 0x800000005.1234 -5.1235 - /* End of section flags. */5.1236 -5.1237 - /* Some internal packed boolean fields. */5.1238 -5.1239 - /* See the vma field. */5.1240 - unsigned int user_set_vma : 1;5.1241 -5.1242 - /* A mark flag used by some of the linker backends. */5.1243 - unsigned int linker_mark : 1;5.1244 -5.1245 - /* Another mark flag used by some of the linker backends. Set for5.1246 - output sections that have an input section. */5.1247 - unsigned int linker_has_input : 1;5.1248 -5.1249 - /* A mark flag used by some linker backends for garbage collection. */5.1250 - unsigned int gc_mark : 1;5.1251 -5.1252 - /* The following flags are used by the ELF linker. */5.1253 -5.1254 - /* Mark sections which have been allocated to segments. */5.1255 - unsigned int segment_mark : 1;5.1256 -5.1257 - /* Type of sec_info information. */5.1258 - unsigned int sec_info_type:3;5.1259 -#define ELF_INFO_TYPE_NONE 05.1260 -#define ELF_INFO_TYPE_STABS 15.1261 -#define ELF_INFO_TYPE_MERGE 25.1262 -#define ELF_INFO_TYPE_EH_FRAME 35.1263 -#define ELF_INFO_TYPE_JUST_SYMS 45.1264 -5.1265 - /* Nonzero if this section uses RELA relocations, rather than REL. */5.1266 - unsigned int use_rela_p:1;5.1267 -5.1268 - /* Bits used by various backends. The generic code doesn't touch5.1269 - these fields. */5.1270 -5.1271 - /* Nonzero if this section has TLS related relocations. */5.1272 - unsigned int has_tls_reloc:1;5.1273 -5.1274 - /* Nonzero if this section has a gp reloc. */5.1275 - unsigned int has_gp_reloc:1;5.1276 -5.1277 - /* Nonzero if this section needs the relax finalize pass. */5.1278 - unsigned int need_finalize_relax:1;5.1279 -5.1280 - /* Whether relocations have been processed. */5.1281 - unsigned int reloc_done : 1;5.1282 -5.1283 - /* End of internal packed boolean fields. */5.1284 -5.1285 - /* The virtual memory address of the section - where it will be5.1286 - at run time. The symbols are relocated against this. The5.1287 - user_set_vma flag is maintained by bfd; if it's not set, the5.1288 - backend can assign addresses (for example, in <<a.out>>, where5.1289 - the default address for <<.data>> is dependent on the specific5.1290 - target and various flags). */5.1291 - bfd_vma vma;5.1292 -5.1293 - /* The load address of the section - where it would be in a5.1294 - rom image; really only used for writing section header5.1295 - information. */5.1296 - bfd_vma lma;5.1297 -5.1298 - /* The size of the section in octets, as it will be output.5.1299 - Contains a value even if the section has no contents (e.g., the5.1300 - size of <<.bss>>). */5.1301 - bfd_size_type size;5.1302 -5.1303 - /* For input sections, the original size on disk of the section, in5.1304 - octets. This field is used by the linker relaxation code. It is5.1305 - currently only set for sections where the linker relaxation scheme5.1306 - doesn't cache altered section and reloc contents (stabs, eh_frame,5.1307 - SEC_MERGE, some coff relaxing targets), and thus the original size5.1308 - needs to be kept to read the section multiple times.5.1309 - For output sections, rawsize holds the section size calculated on5.1310 - a previous linker relaxation pass. */5.1311 - bfd_size_type rawsize;5.1312 -5.1313 - /* If this section is going to be output, then this value is the5.1314 - offset in *bytes* into the output section of the first byte in the5.1315 - input section (byte ==> smallest addressable unit on the5.1316 - target). In most cases, if this was going to start at the5.1317 - 100th octet (8-bit quantity) in the output section, this value5.1318 - would be 100. However, if the target byte size is 16 bits5.1319 - (bfd_octets_per_byte is "2"), this value would be 50. */5.1320 - bfd_vma output_offset;5.1321 -5.1322 - /* The output section through which to map on output. */5.1323 - struct bfd_section *output_section;5.1324 -5.1325 - /* The alignment requirement of the section, as an exponent of 2 -5.1326 - e.g., 3 aligns to 2^3 (or 8). */5.1327 - unsigned int alignment_power;5.1328 -5.1329 - /* If an input section, a pointer to a vector of relocation5.1330 - records for the data in this section. */5.1331 - struct reloc_cache_entry *relocation;5.1332 -5.1333 - /* If an output section, a pointer to a vector of pointers to5.1334 - relocation records for the data in this section. */5.1335 - struct reloc_cache_entry **orelocation;5.1336 -5.1337 - /* The number of relocation records in one of the above. */5.1338 - unsigned reloc_count;5.1339 -5.1340 - /* Information below is back end specific - and not always used5.1341 - or updated. */5.1342 -5.1343 - /* File position of section data. */5.1344 - file_ptr filepos;5.1345 -5.1346 - /* File position of relocation info. */5.1347 - file_ptr rel_filepos;5.1348 -5.1349 - /* File position of line data. */5.1350 - file_ptr line_filepos;5.1351 -5.1352 - /* Pointer to data for applications. */5.1353 - void *userdata;5.1354 -5.1355 - /* If the SEC_IN_MEMORY flag is set, this points to the actual5.1356 - contents. */5.1357 - unsigned char *contents;5.1358 -5.1359 - /* Attached line number information. */5.1360 - alent *lineno;5.1361 -5.1362 - /* Number of line number records. */5.1363 - unsigned int lineno_count;5.1364 -5.1365 - /* Entity size for merging purposes. */5.1366 - unsigned int entsize;5.1367 -5.1368 - /* Points to the kept section if this section is a link-once section,5.1369 - and is discarded. */5.1370 - struct bfd_section *kept_section;5.1371 -5.1372 - /* When a section is being output, this value changes as more5.1373 - linenumbers are written out. */5.1374 - file_ptr moving_line_filepos;5.1375 -5.1376 - /* What the section number is in the target world. */5.1377 - int target_index;5.1378 -5.1379 - void *used_by_bfd;5.1380 -5.1381 - /* If this is a constructor section then here is a list of the5.1382 - relocations created to relocate items within it. */5.1383 - struct relent_chain *constructor_chain;5.1384 -5.1385 - /* The BFD which owns the section. */5.1386 - bfd *owner;5.1387 -5.1388 - /* A symbol which points at this section only. */5.1389 - struct bfd_symbol *symbol;5.1390 - struct bfd_symbol **symbol_ptr_ptr;5.1391 -5.1392 - struct bfd_link_order *link_order_head;5.1393 - struct bfd_link_order *link_order_tail;5.1394 -} asection;5.1395 -5.1396 -/* These sections are global, and are managed by BFD. The application5.1397 - and target back end are not permitted to change the values in5.1398 - these sections. New code should use the section_ptr macros rather5.1399 - than referring directly to the const sections. The const sections5.1400 - may eventually vanish. */5.1401 -#define BFD_ABS_SECTION_NAME "*ABS*"5.1402 -#define BFD_UND_SECTION_NAME "*UND*"5.1403 -#define BFD_COM_SECTION_NAME "*COM*"5.1404 -#define BFD_IND_SECTION_NAME "*IND*"5.1405 -5.1406 -/* The absolute section. */5.1407 -extern asection bfd_abs_section;5.1408 -#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)5.1409 -#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)5.1410 -/* Pointer to the undefined section. */5.1411 -extern asection bfd_und_section;5.1412 -#define bfd_und_section_ptr ((asection *) &bfd_und_section)5.1413 -#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)5.1414 -/* Pointer to the common section. */5.1415 -extern asection bfd_com_section;5.1416 -#define bfd_com_section_ptr ((asection *) &bfd_com_section)5.1417 -/* Pointer to the indirect section. */5.1418 -extern asection bfd_ind_section;5.1419 -#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)5.1420 -#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)5.1421 -5.1422 -#define bfd_is_const_section(SEC) \5.1423 - ( ((SEC) == bfd_abs_section_ptr) \5.1424 - || ((SEC) == bfd_und_section_ptr) \5.1425 - || ((SEC) == bfd_com_section_ptr) \5.1426 - || ((SEC) == bfd_ind_section_ptr))5.1427 -5.1428 -extern const struct bfd_symbol * const bfd_abs_symbol;5.1429 -extern const struct bfd_symbol * const bfd_com_symbol;5.1430 -extern const struct bfd_symbol * const bfd_und_symbol;5.1431 -extern const struct bfd_symbol * const bfd_ind_symbol;5.1432 -5.1433 -/* Macros to handle insertion and deletion of a bfd's sections. These5.1434 - only handle the list pointers, ie. do not adjust section_count,5.1435 - target_index etc. */5.1436 -#define bfd_section_list_remove(ABFD, PS) \5.1437 - do \5.1438 - { \5.1439 - asection **_ps = PS; \5.1440 - asection *_s = *_ps; \5.1441 - *_ps = _s->next; \5.1442 - if (_s->next == NULL) \5.1443 - (ABFD)->section_tail = _ps; \5.1444 - } \5.1445 - while (0)5.1446 -#define bfd_section_list_insert(ABFD, PS, S) \5.1447 - do \5.1448 - { \5.1449 - asection **_ps = PS; \5.1450 - asection *_s = S; \5.1451 - _s->next = *_ps; \5.1452 - *_ps = _s; \5.1453 - if (_s->next == NULL) \5.1454 - (ABFD)->section_tail = &_s->next; \5.1455 - } \5.1456 - while (0)5.1457 -5.1458 -void bfd_section_list_clear (bfd *);5.1459 -5.1460 -asection *bfd_get_section_by_name (bfd *abfd, const char *name);5.1461 -5.1462 -asection *bfd_get_section_by_name_if5.1463 - (bfd *abfd,5.1464 - const char *name,5.1465 - bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),5.1466 - void *obj);5.1467 -5.1468 -char *bfd_get_unique_section_name5.1469 - (bfd *abfd, const char *templat, int *count);5.1470 -5.1471 -asection *bfd_make_section_old_way (bfd *abfd, const char *name);5.1472 -5.1473 -asection *bfd_make_section_anyway (bfd *abfd, const char *name);5.1474 -5.1475 -asection *bfd_make_section (bfd *, const char *name);5.1476 -5.1477 -bfd_boolean bfd_set_section_flags5.1478 - (bfd *abfd, asection *sec, flagword flags);5.1479 -5.1480 -void bfd_map_over_sections5.1481 - (bfd *abfd,5.1482 - void (*func) (bfd *abfd, asection *sect, void *obj),5.1483 - void *obj);5.1484 -5.1485 -asection *bfd_sections_find_if5.1486 - (bfd *abfd,5.1487 - bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),5.1488 - void *obj);5.1489 -5.1490 -bfd_boolean bfd_set_section_size5.1491 - (bfd *abfd, asection *sec, bfd_size_type val);5.1492 -5.1493 -bfd_boolean bfd_set_section_contents5.1494 - (bfd *abfd, asection *section, const void *data,5.1495 - file_ptr offset, bfd_size_type count);5.1496 -5.1497 -bfd_boolean bfd_get_section_contents5.1498 - (bfd *abfd, asection *section, void *location, file_ptr offset,5.1499 - bfd_size_type count);5.1500 -5.1501 -bfd_boolean bfd_malloc_and_get_section5.1502 - (bfd *abfd, asection *section, bfd_byte **buf);5.1503 -5.1504 -bfd_boolean bfd_copy_private_section_data5.1505 - (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);5.1506 -5.1507 -#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \5.1508 - BFD_SEND (obfd, _bfd_copy_private_section_data, \5.1509 - (ibfd, isection, obfd, osection))5.1510 -void _bfd_strip_section_from_output5.1511 - (struct bfd_link_info *info, asection *section);5.1512 -5.1513 -bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);5.1514 -5.1515 -bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);5.1516 -5.1517 -/* Extracted from archures.c. */5.1518 -enum bfd_architecture5.1519 -{5.1520 - bfd_arch_unknown, /* File arch not known. */5.1521 - bfd_arch_obscure, /* Arch known, not one of these. */5.1522 - bfd_arch_m68k, /* Motorola 68xxx */5.1523 -#define bfd_mach_m68000 15.1524 -#define bfd_mach_m68008 25.1525 -#define bfd_mach_m68010 35.1526 -#define bfd_mach_m68020 45.1527 -#define bfd_mach_m68030 55.1528 -#define bfd_mach_m68040 65.1529 -#define bfd_mach_m68060 75.1530 -#define bfd_mach_cpu32 85.1531 -#define bfd_mach_mcf5200 95.1532 -#define bfd_mach_mcf5206e 105.1533 -#define bfd_mach_mcf5307 115.1534 -#define bfd_mach_mcf5407 125.1535 -#define bfd_mach_mcf528x 135.1536 -#define bfd_mach_mcfv4e 145.1537 -#define bfd_mach_mcf521x 155.1538 -#define bfd_mach_mcf5249 165.1539 -#define bfd_mach_mcf547x 175.1540 -#define bfd_mach_mcf548x 185.1541 - bfd_arch_vax, /* DEC Vax */5.1542 - bfd_arch_i960, /* Intel 960 */5.1543 - /* The order of the following is important.5.1544 - lower number indicates a machine type that5.1545 - only accepts a subset of the instructions5.1546 - available to machines with higher numbers.5.1547 - The exception is the "ca", which is5.1548 - incompatible with all other machines except5.1549 - "core". */5.1550 -5.1551 -#define bfd_mach_i960_core 15.1552 -#define bfd_mach_i960_ka_sa 25.1553 -#define bfd_mach_i960_kb_sb 35.1554 -#define bfd_mach_i960_mc 45.1555 -#define bfd_mach_i960_xa 55.1556 -#define bfd_mach_i960_ca 65.1557 -#define bfd_mach_i960_jx 75.1558 -#define bfd_mach_i960_hx 85.1559 -5.1560 - bfd_arch_or32, /* OpenRISC 32 */5.1561 -5.1562 - bfd_arch_a29k, /* AMD 29000 */5.1563 - bfd_arch_sparc, /* SPARC */5.1564 -#define bfd_mach_sparc 15.1565 -/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */5.1566 -#define bfd_mach_sparc_sparclet 25.1567 -#define bfd_mach_sparc_sparclite 35.1568 -#define bfd_mach_sparc_v8plus 45.1569 -#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */5.1570 -#define bfd_mach_sparc_sparclite_le 65.1571 -#define bfd_mach_sparc_v9 75.1572 -#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */5.1573 -#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */5.1574 -#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */5.1575 -/* Nonzero if MACH has the v9 instruction set. */5.1576 -#define bfd_mach_sparc_v9_p(mach) \5.1577 - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \5.1578 - && (mach) != bfd_mach_sparc_sparclite_le)5.1579 -/* Nonzero if MACH is a 64 bit sparc architecture. */5.1580 -#define bfd_mach_sparc_64bit_p(mach) \5.1581 - ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)5.1582 - bfd_arch_mips, /* MIPS Rxxxx */5.1583 -#define bfd_mach_mips3000 30005.1584 -#define bfd_mach_mips3900 39005.1585 -#define bfd_mach_mips4000 40005.1586 -#define bfd_mach_mips4010 40105.1587 -#define bfd_mach_mips4100 41005.1588 -#define bfd_mach_mips4111 41115.1589 -#define bfd_mach_mips4120 41205.1590 -#define bfd_mach_mips4300 43005.1591 -#define bfd_mach_mips4400 44005.1592 -#define bfd_mach_mips4600 46005.1593 -#define bfd_mach_mips4650 46505.1594 -#define bfd_mach_mips5000 50005.1595 -#define bfd_mach_mips5400 54005.1596 -#define bfd_mach_mips5500 55005.1597 -#define bfd_mach_mips6000 60005.1598 -#define bfd_mach_mips7000 70005.1599 -#define bfd_mach_mips8000 80005.1600 -#define bfd_mach_mips9000 90005.1601 -#define bfd_mach_mips10000 100005.1602 -#define bfd_mach_mips12000 120005.1603 -#define bfd_mach_mips16 165.1604 -#define bfd_mach_mips5 55.1605 -#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */5.1606 -#define bfd_mach_mipsisa32 325.1607 -#define bfd_mach_mipsisa32r2 335.1608 -#define bfd_mach_mipsisa64 645.1609 -#define bfd_mach_mipsisa64r2 655.1610 - bfd_arch_i386, /* Intel 386 */5.1611 -#define bfd_mach_i386_i386 15.1612 -#define bfd_mach_i386_i8086 25.1613 -#define bfd_mach_i386_i386_intel_syntax 35.1614 -#define bfd_mach_x86_64 645.1615 -#define bfd_mach_x86_64_intel_syntax 655.1616 - bfd_arch_we32k, /* AT&T WE32xxx */5.1617 - bfd_arch_tahoe, /* CCI/Harris Tahoe */5.1618 - bfd_arch_i860, /* Intel 860 */5.1619 - bfd_arch_i370, /* IBM 360/370 Mainframes */5.1620 - bfd_arch_romp, /* IBM ROMP PC/RT */5.1621 - bfd_arch_alliant, /* Alliant */5.1622 - bfd_arch_convex, /* Convex */5.1623 - bfd_arch_m88k, /* Motorola 88xxx */5.1624 - bfd_arch_m98k, /* Motorola 98xxx */5.1625 - bfd_arch_pyramid, /* Pyramid Technology */5.1626 - bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */5.1627 -#define bfd_mach_h8300 15.1628 -#define bfd_mach_h8300h 25.1629 -#define bfd_mach_h8300s 35.1630 -#define bfd_mach_h8300hn 45.1631 -#define bfd_mach_h8300sn 55.1632 -#define bfd_mach_h8300sx 65.1633 -#define bfd_mach_h8300sxn 75.1634 - bfd_arch_pdp11, /* DEC PDP-11 */5.1635 - bfd_arch_powerpc, /* PowerPC */5.1636 -#define bfd_mach_ppc 325.1637 -#define bfd_mach_ppc64 645.1638 -#define bfd_mach_ppc_403 4035.1639 -#define bfd_mach_ppc_403gc 40305.1640 -#define bfd_mach_ppc_505 5055.1641 -#define bfd_mach_ppc_601 6015.1642 -#define bfd_mach_ppc_602 6025.1643 -#define bfd_mach_ppc_603 6035.1644 -#define bfd_mach_ppc_ec603e 60315.1645 -#define bfd_mach_ppc_604 6045.1646 -#define bfd_mach_ppc_620 6205.1647 -#define bfd_mach_ppc_630 6305.1648 -#define bfd_mach_ppc_750 7505.1649 -#define bfd_mach_ppc_860 8605.1650 -#define bfd_mach_ppc_a35 355.1651 -#define bfd_mach_ppc_rs64ii 6425.1652 -#define bfd_mach_ppc_rs64iii 6435.1653 -#define bfd_mach_ppc_7400 74005.1654 -#define bfd_mach_ppc_e500 5005.1655 - bfd_arch_rs6000, /* IBM RS/6000 */5.1656 -#define bfd_mach_rs6k 60005.1657 -#define bfd_mach_rs6k_rs1 60015.1658 -#define bfd_mach_rs6k_rsc 60035.1659 -#define bfd_mach_rs6k_rs2 60025.1660 - bfd_arch_hppa, /* HP PA RISC */5.1661 -#define bfd_mach_hppa10 105.1662 -#define bfd_mach_hppa11 115.1663 -#define bfd_mach_hppa20 205.1664 -#define bfd_mach_hppa20w 255.1665 - bfd_arch_d10v, /* Mitsubishi D10V */5.1666 -#define bfd_mach_d10v 15.1667 -#define bfd_mach_d10v_ts2 25.1668 -#define bfd_mach_d10v_ts3 35.1669 - bfd_arch_d30v, /* Mitsubishi D30V */5.1670 - bfd_arch_dlx, /* DLX */5.1671 - bfd_arch_m68hc11, /* Motorola 68HC11 */5.1672 - bfd_arch_m68hc12, /* Motorola 68HC12 */5.1673 -#define bfd_mach_m6812_default 05.1674 -#define bfd_mach_m6812 15.1675 -#define bfd_mach_m6812s 25.1676 - bfd_arch_z8k, /* Zilog Z8000 */5.1677 -#define bfd_mach_z8001 15.1678 -#define bfd_mach_z8002 25.1679 - bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */5.1680 - bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */5.1681 -#define bfd_mach_sh 15.1682 -#define bfd_mach_sh2 0x205.1683 -#define bfd_mach_sh_dsp 0x2d5.1684 -#define bfd_mach_sh2a 0x2a5.1685 -#define bfd_mach_sh2a_nofpu 0x2b5.1686 -#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a15.1687 -#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a25.1688 -#define bfd_mach_sh2a_or_sh4 0x2a35.1689 -#define bfd_mach_sh2a_or_sh3e 0x2a45.1690 -#define bfd_mach_sh2e 0x2e5.1691 -#define bfd_mach_sh3 0x305.1692 -#define bfd_mach_sh3_nommu 0x315.1693 -#define bfd_mach_sh3_dsp 0x3d5.1694 -#define bfd_mach_sh3e 0x3e5.1695 -#define bfd_mach_sh4 0x405.1696 -#define bfd_mach_sh4_nofpu 0x415.1697 -#define bfd_mach_sh4_nommu_nofpu 0x425.1698 -#define bfd_mach_sh4a 0x4a5.1699 -#define bfd_mach_sh4a_nofpu 0x4b5.1700 -#define bfd_mach_sh4al_dsp 0x4d5.1701 -#define bfd_mach_sh5 0x505.1702 - bfd_arch_alpha, /* Dec Alpha */5.1703 -#define bfd_mach_alpha_ev4 0x105.1704 -#define bfd_mach_alpha_ev5 0x205.1705 -#define bfd_mach_alpha_ev6 0x305.1706 - bfd_arch_arm, /* Advanced Risc Machines ARM. */5.1707 -#define bfd_mach_arm_unknown 05.1708 -#define bfd_mach_arm_2 15.1709 -#define bfd_mach_arm_2a 25.1710 -#define bfd_mach_arm_3 35.1711 -#define bfd_mach_arm_3M 45.1712 -#define bfd_mach_arm_4 55.1713 -#define bfd_mach_arm_4T 65.1714 -#define bfd_mach_arm_5 75.1715 -#define bfd_mach_arm_5T 85.1716 -#define bfd_mach_arm_5TE 95.1717 -#define bfd_mach_arm_XScale 105.1718 -#define bfd_mach_arm_ep9312 115.1719 -#define bfd_mach_arm_iWMMXt 125.1720 - bfd_arch_ns32k, /* National Semiconductors ns32000 */5.1721 - bfd_arch_w65, /* WDC 65816 */5.1722 - bfd_arch_tic30, /* Texas Instruments TMS320C30 */5.1723 - bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */5.1724 -#define bfd_mach_tic3x 305.1725 -#define bfd_mach_tic4x 405.1726 - bfd_arch_tic54x, /* Texas Instruments TMS320C54X */5.1727 - bfd_arch_tic80, /* TI TMS320c80 (MVP) */5.1728 - bfd_arch_v850, /* NEC V850 */5.1729 -#define bfd_mach_v850 15.1730 -#define bfd_mach_v850e 'E'5.1731 -#define bfd_mach_v850e1 '1'5.1732 - bfd_arch_arc, /* ARC Cores */5.1733 -#define bfd_mach_arc_5 55.1734 -#define bfd_mach_arc_6 65.1735 -#define bfd_mach_arc_7 75.1736 -#define bfd_mach_arc_8 85.1737 - bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */5.1738 -#define bfd_mach_m32r 1 /* For backwards compatibility. */5.1739 -#define bfd_mach_m32rx 'x'5.1740 -#define bfd_mach_m32r2 '2'5.1741 - bfd_arch_mn10200, /* Matsushita MN10200 */5.1742 - bfd_arch_mn10300, /* Matsushita MN10300 */5.1743 -#define bfd_mach_mn10300 3005.1744 -#define bfd_mach_am33 3305.1745 -#define bfd_mach_am33_2 3325.1746 - bfd_arch_fr30,5.1747 -#define bfd_mach_fr30 0x465233305.1748 - bfd_arch_frv,5.1749 -#define bfd_mach_frv 15.1750 -#define bfd_mach_frvsimple 25.1751 -#define bfd_mach_fr300 3005.1752 -#define bfd_mach_fr400 4005.1753 -#define bfd_mach_fr450 4505.1754 -#define bfd_mach_frvtomcat 499 /* fr500 prototype */5.1755 -#define bfd_mach_fr500 5005.1756 -#define bfd_mach_fr550 5505.1757 - bfd_arch_mcore,5.1758 - bfd_arch_ia64, /* HP/Intel ia64 */5.1759 -#define bfd_mach_ia64_elf64 645.1760 -#define bfd_mach_ia64_elf32 325.1761 - bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */5.1762 -#define bfd_mach_ip2022 15.1763 -#define bfd_mach_ip2022ext 25.1764 - bfd_arch_iq2000, /* Vitesse IQ2000. */5.1765 -#define bfd_mach_iq2000 15.1766 -#define bfd_mach_iq10 25.1767 - bfd_arch_pj,5.1768 - bfd_arch_avr, /* Atmel AVR microcontrollers. */5.1769 -#define bfd_mach_avr1 15.1770 -#define bfd_mach_avr2 25.1771 -#define bfd_mach_avr3 35.1772 -#define bfd_mach_avr4 45.1773 -#define bfd_mach_avr5 55.1774 - bfd_arch_cr16c, /* National Semiconductor CompactRISC. */5.1775 -#define bfd_mach_cr16c 15.1776 - bfd_arch_crx, /* National Semiconductor CRX. */5.1777 -#define bfd_mach_crx 15.1778 - bfd_arch_cris, /* Axis CRIS */5.1779 -#define bfd_mach_cris_v0_v10 2555.1780 -#define bfd_mach_cris_v32 325.1781 -#define bfd_mach_cris_v10_v32 10325.1782 - bfd_arch_s390, /* IBM s390 */5.1783 -#define bfd_mach_s390_31 315.1784 -#define bfd_mach_s390_64 645.1785 - bfd_arch_openrisc, /* OpenRISC */5.1786 - bfd_arch_mmix, /* Donald Knuth's educational processor. */5.1787 - bfd_arch_xstormy16,5.1788 -#define bfd_mach_xstormy16 15.1789 - bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */5.1790 -#define bfd_mach_msp11 115.1791 -#define bfd_mach_msp110 1105.1792 -#define bfd_mach_msp12 125.1793 -#define bfd_mach_msp13 135.1794 -#define bfd_mach_msp14 145.1795 -#define bfd_mach_msp15 155.1796 -#define bfd_mach_msp16 165.1797 -#define bfd_mach_msp31 315.1798 -#define bfd_mach_msp32 325.1799 -#define bfd_mach_msp33 335.1800 -#define bfd_mach_msp41 415.1801 -#define bfd_mach_msp42 425.1802 -#define bfd_mach_msp43 435.1803 -#define bfd_mach_msp44 445.1804 - bfd_arch_xtensa, /* Tensilica's Xtensa cores. */5.1805 -#define bfd_mach_xtensa 15.1806 - bfd_arch_maxq, /* Dallas MAXQ 10/20 */5.1807 -#define bfd_mach_maxq10 105.1808 -#define bfd_mach_maxq20 205.1809 - bfd_arch_last5.1810 - };5.1811 -5.1812 -typedef struct bfd_arch_info5.1813 -{5.1814 - int bits_per_word;5.1815 - int bits_per_address;5.1816 - int bits_per_byte;5.1817 - enum bfd_architecture arch;5.1818 - unsigned long mach;5.1819 - const char *arch_name;5.1820 - const char *printable_name;5.1821 - unsigned int section_align_power;5.1822 - /* TRUE if this is the default machine for the architecture.5.1823 - The default arch should be the first entry for an arch so that5.1824 - all the entries for that arch can be accessed via <<next>>. */5.1825 - bfd_boolean the_default;5.1826 - const struct bfd_arch_info * (*compatible)5.1827 - (const struct bfd_arch_info *a, const struct bfd_arch_info *b);5.1828 -5.1829 - bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);5.1830 -5.1831 - const struct bfd_arch_info *next;5.1832 -}5.1833 -bfd_arch_info_type;5.1834 -5.1835 -const char *bfd_printable_name (bfd *abfd);5.1836 -5.1837 -const bfd_arch_info_type *bfd_scan_arch (const char *string);5.1838 -5.1839 -const char **bfd_arch_list (void);5.1840 -5.1841 -const bfd_arch_info_type *bfd_arch_get_compatible5.1842 - (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);5.1843 -5.1844 -void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);5.1845 -5.1846 -enum bfd_architecture bfd_get_arch (bfd *abfd);5.1847 -5.1848 -unsigned long bfd_get_mach (bfd *abfd);5.1849 -5.1850 -unsigned int bfd_arch_bits_per_byte (bfd *abfd);5.1851 -5.1852 -unsigned int bfd_arch_bits_per_address (bfd *abfd);5.1853 -5.1854 -const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);5.1855 -5.1856 -const bfd_arch_info_type *bfd_lookup_arch5.1857 - (enum bfd_architecture arch, unsigned long machine);5.1858 -5.1859 -const char *bfd_printable_arch_mach5.1860 - (enum bfd_architecture arch, unsigned long machine);5.1861 -5.1862 -unsigned int bfd_octets_per_byte (bfd *abfd);5.1863 -5.1864 -unsigned int bfd_arch_mach_octets_per_byte5.1865 - (enum bfd_architecture arch, unsigned long machine);5.1866 -5.1867 -/* Extracted from reloc.c. */5.1868 -typedef enum bfd_reloc_status5.1869 -{5.1870 - /* No errors detected. */5.1871 - bfd_reloc_ok,5.1872 -5.1873 - /* The relocation was performed, but there was an overflow. */5.1874 - bfd_reloc_overflow,5.1875 -5.1876 - /* The address to relocate was not within the section supplied. */5.1877 - bfd_reloc_outofrange,5.1878 -5.1879 - /* Used by special functions. */5.1880 - bfd_reloc_continue,5.1881 -5.1882 - /* Unsupported relocation size requested. */5.1883 - bfd_reloc_notsupported,5.1884 -5.1885 - /* Unused. */5.1886 - bfd_reloc_other,5.1887 -5.1888 - /* The symbol to relocate against was undefined. */5.1889 - bfd_reloc_undefined,5.1890 -5.1891 - /* The relocation was performed, but may not be ok - presently5.1892 - generated only when linking i960 coff files with i960 b.out5.1893 - symbols. If this type is returned, the error_message argument5.1894 - to bfd_perform_relocation will be set. */5.1895 - bfd_reloc_dangerous5.1896 - }5.1897 - bfd_reloc_status_type;5.1898 -5.1899 -5.1900 -typedef struct reloc_cache_entry5.1901 -{5.1902 - /* A pointer into the canonical table of pointers. */5.1903 - struct bfd_symbol **sym_ptr_ptr;5.1904 -5.1905 - /* offset in section. */5.1906 - bfd_size_type address;5.1907 -5.1908 - /* addend for relocation value. */5.1909 - bfd_vma addend;5.1910 -5.1911 - /* Pointer to how to perform the required relocation. */5.1912 - reloc_howto_type *howto;5.1913 -5.1914 -}5.1915 -arelent;5.1916 -5.1917 -enum complain_overflow5.1918 -{5.1919 - /* Do not complain on overflow. */5.1920 - complain_overflow_dont,5.1921 -5.1922 - /* Complain if the bitfield overflows, whether it is considered5.1923 - as signed or unsigned. */5.1924 - complain_overflow_bitfield,5.1925 -5.1926 - /* Complain if the value overflows when considered as signed5.1927 - number. */5.1928 - complain_overflow_signed,5.1929 -5.1930 - /* Complain if the value overflows when considered as an5.1931 - unsigned number. */5.1932 - complain_overflow_unsigned5.1933 -};5.1934 -5.1935 -struct reloc_howto_struct5.1936 -{5.1937 - /* The type field has mainly a documentary use - the back end can5.1938 - do what it wants with it, though normally the back end's5.1939 - external idea of what a reloc number is stored5.1940 - in this field. For example, a PC relative word relocation5.1941 - in a coff environment has the type 023 - because that's5.1942 - what the outside world calls a R_PCRWORD reloc. */5.1943 - unsigned int type;5.1944 -5.1945 - /* The value the final relocation is shifted right by. This drops5.1946 - unwanted data from the relocation. */5.1947 - unsigned int rightshift;5.1948 -5.1949 - /* The size of the item to be relocated. This is *not* a5.1950 - power-of-two measure. To get the number of bytes operated5.1951 - on by a type of relocation, use bfd_get_reloc_size. */5.1952 - int size;5.1953 -5.1954 - /* The number of bits in the item to be relocated. This is used5.1955 - when doing overflow checking. */5.1956 - unsigned int bitsize;5.1957 -5.1958 - /* Notes that the relocation is relative to the location in the5.1959 - data section of the addend. The relocation function will5.1960 - subtract from the relocation value the address of the location5.1961 - being relocated. */5.1962 - bfd_boolean pc_relative;5.1963 -5.1964 - /* The bit position of the reloc value in the destination.5.1965 - The relocated value is left shifted by this amount. */5.1966 - unsigned int bitpos;5.1967 -5.1968 - /* What type of overflow error should be checked for when5.1969 - relocating. */5.1970 - enum complain_overflow complain_on_overflow;5.1971 -5.1972 - /* If this field is non null, then the supplied function is5.1973 - called rather than the normal function. This allows really5.1974 - strange relocation methods to be accommodated (e.g., i960 callj5.1975 - instructions). */5.1976 - bfd_reloc_status_type (*special_function)5.1977 - (bfd *, arelent *, struct bfd_symbol *, void *, asection *,5.1978 - bfd *, char **);5.1979 -5.1980 - /* The textual name of the relocation type. */5.1981 - char *name;5.1982 -5.1983 - /* Some formats record a relocation addend in the section contents5.1984 - rather than with the relocation. For ELF formats this is the5.1985 - distinction between USE_REL and USE_RELA (though the code checks5.1986 - for USE_REL == 1/0). The value of this field is TRUE if the5.1987 - addend is recorded with the section contents; when performing a5.1988 - partial link (ld -r) the section contents (the data) will be5.1989 - modified. The value of this field is FALSE if addends are5.1990 - recorded with the relocation (in arelent.addend); when performing5.1991 - a partial link the relocation will be modified.5.1992 - All relocations for all ELF USE_RELA targets should set this field5.1993 - to FALSE (values of TRUE should be looked on with suspicion).5.1994 - However, the converse is not true: not all relocations of all ELF5.1995 - USE_REL targets set this field to TRUE. Why this is so is peculiar5.1996 - to each particular target. For relocs that aren't used in partial5.1997 - links (e.g. GOT stuff) it doesn't matter what this is set to. */5.1998 - bfd_boolean partial_inplace;5.1999 -5.2000 - /* src_mask selects the part of the instruction (or data) to be used5.2001 - in the relocation sum. If the target relocations don't have an5.2002 - addend in the reloc, eg. ELF USE_REL, src_mask will normally equal5.2003 - dst_mask to extract the addend from the section contents. If5.2004 - relocations do have an addend in the reloc, eg. ELF USE_RELA, this5.2005 - field should be zero. Non-zero values for ELF USE_RELA targets are5.2006 - bogus as in those cases the value in the dst_mask part of the5.2007 - section contents should be treated as garbage. */5.2008 - bfd_vma src_mask;5.2009 -5.2010 - /* dst_mask selects which parts of the instruction (or data) are5.2011 - replaced with a relocated value. */5.2012 - bfd_vma dst_mask;5.2013 -5.2014 - /* When some formats create PC relative instructions, they leave5.2015 - the value of the pc of the place being relocated in the offset5.2016 - slot of the instruction, so that a PC relative relocation can5.2017 - be made just by adding in an ordinary offset (e.g., sun3 a.out).5.2018 - Some formats leave the displacement part of an instruction5.2019 - empty (e.g., m88k bcs); this flag signals the fact. */5.2020 - bfd_boolean pcrel_offset;5.2021 -};5.2022 -5.2023 -#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \5.2024 - { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }5.2025 -#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \5.2026 - HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \5.2027 - NAME, FALSE, 0, 0, IN)5.2028 -5.2029 -#define EMPTY_HOWTO(C) \5.2030 - HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \5.2031 - NULL, FALSE, 0, 0, FALSE)5.2032 -5.2033 -#define HOWTO_PREPARE(relocation, symbol) \5.2034 - { \5.2035 - if (symbol != NULL) \5.2036 - { \5.2037 - if (bfd_is_com_section (symbol->section)) \5.2038 - { \5.2039 - relocation = 0; \5.2040 - } \5.2041 - else \5.2042 - { \5.2043 - relocation = symbol->value; \5.2044 - } \5.2045 - } \5.2046 - }5.2047 -5.2048 -unsigned int bfd_get_reloc_size (reloc_howto_type *);5.2049 -5.2050 -typedef struct relent_chain5.2051 -{5.2052 - arelent relent;5.2053 - struct relent_chain *next;5.2054 -}5.2055 -arelent_chain;5.2056 -5.2057 -bfd_reloc_status_type bfd_check_overflow5.2058 - (enum complain_overflow how,5.2059 - unsigned int bitsize,5.2060 - unsigned int rightshift,5.2061 - unsigned int addrsize,5.2062 - bfd_vma relocation);5.2063 -5.2064 -bfd_reloc_status_type bfd_perform_relocation5.2065 - (bfd *abfd,5.2066 - arelent *reloc_entry,5.2067 - void *data,5.2068 - asection *input_section,5.2069 - bfd *output_bfd,5.2070 - char **error_message);5.2071 -5.2072 -bfd_reloc_status_type bfd_install_relocation5.2073 - (bfd *abfd,5.2074 - arelent *reloc_entry,5.2075 - void *data, bfd_vma data_start,5.2076 - asection *input_section,5.2077 - char **error_message);5.2078 -5.2079 -enum bfd_reloc_code_real {5.2080 - _dummy_first_bfd_reloc_code_real,5.2081 -5.2082 -5.2083 -/* Basic absolute relocations of N bits. */5.2084 - BFD_RELOC_64,5.2085 - BFD_RELOC_32,5.2086 - BFD_RELOC_26,5.2087 - BFD_RELOC_24,5.2088 - BFD_RELOC_16,5.2089 - BFD_RELOC_14,5.2090 - BFD_RELOC_8,5.2091 -5.2092 -/* PC-relative relocations. Sometimes these are relative to the address5.2093 -of the relocation itself; sometimes they are relative to the start of5.2094 -the section containing the relocation. It depends on the specific target.5.2095 -5.2096 -The 24-bit relocation is used in some Intel 960 configurations. */5.2097 - BFD_RELOC_64_PCREL,5.2098 - BFD_RELOC_32_PCREL,5.2099 - BFD_RELOC_24_PCREL,5.2100 - BFD_RELOC_16_PCREL,5.2101 - BFD_RELOC_12_PCREL,5.2102 - BFD_RELOC_8_PCREL,5.2103 -5.2104 -/* Section relative relocations. Some targets need this for DWARF2. */5.2105 - BFD_RELOC_32_SECREL,5.2106 -5.2107 -/* For ELF. */5.2108 - BFD_RELOC_32_GOT_PCREL,5.2109 - BFD_RELOC_16_GOT_PCREL,5.2110 - BFD_RELOC_8_GOT_PCREL,5.2111 - BFD_RELOC_32_GOTOFF,5.2112 - BFD_RELOC_16_GOTOFF,5.2113 - BFD_RELOC_LO16_GOTOFF,5.2114 - BFD_RELOC_HI16_GOTOFF,5.2115 - BFD_RELOC_HI16_S_GOTOFF,5.2116 - BFD_RELOC_8_GOTOFF,5.2117 - BFD_RELOC_64_PLT_PCREL,5.2118 - BFD_RELOC_32_PLT_PCREL,5.2119 - BFD_RELOC_24_PLT_PCREL,5.2120 - BFD_RELOC_16_PLT_PCREL,5.2121 - BFD_RELOC_8_PLT_PCREL,5.2122 - BFD_RELOC_64_PLTOFF,5.2123 - BFD_RELOC_32_PLTOFF,5.2124 - BFD_RELOC_16_PLTOFF,5.2125 - BFD_RELOC_LO16_PLTOFF,5.2126 - BFD_RELOC_HI16_PLTOFF,5.2127 - BFD_RELOC_HI16_S_PLTOFF,5.2128 - BFD_RELOC_8_PLTOFF,5.2129 -5.2130 -/* Relocations used by 68K ELF. */5.2131 - BFD_RELOC_68K_GLOB_DAT,5.2132 - BFD_RELOC_68K_JMP_SLOT,5.2133 - BFD_RELOC_68K_RELATIVE,5.2134 -5.2135 -/* Linkage-table relative. */5.2136 - BFD_RELOC_32_BASEREL,5.2137 - BFD_RELOC_16_BASEREL,5.2138 - BFD_RELOC_LO16_BASEREL,5.2139 - BFD_RELOC_HI16_BASEREL,5.2140 - BFD_RELOC_HI16_S_BASEREL,5.2141 - BFD_RELOC_8_BASEREL,5.2142 - BFD_RELOC_RVA,5.2143 -5.2144 -/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */5.2145 - BFD_RELOC_8_FFnn,5.2146 -5.2147 -/* These PC-relative relocations are stored as word displacements --5.2148 -i.e., byte displacements shifted right two bits. The 30-bit word5.2149 -displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the5.2150 -SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The5.2151 -signed 16-bit displacement is used on the MIPS, and the 23-bit5.2152 -displacement is used on the Alpha. */5.2153 - BFD_RELOC_32_PCREL_S2,5.2154 - BFD_RELOC_16_PCREL_S2,5.2155 - BFD_RELOC_23_PCREL_S2,5.2156 -5.2157 -/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of5.2158 -the target word. These are used on the SPARC. */5.2159 - BFD_RELOC_HI22,5.2160 - BFD_RELOC_LO10,5.2161 -5.2162 -/* For systems that allocate a Global Pointer register, these are5.2163 -displacements off that register. These relocation types are5.2164 -handled specially, because the value the register will have is5.2165 -decided relatively late. */5.2166 - BFD_RELOC_GPREL16,5.2167 - BFD_RELOC_GPREL32,5.2168 -5.2169 -/* Reloc types used for i960/b.out. */5.2170 - BFD_RELOC_I960_CALLJ,5.2171 -5.2172 -/* SPARC ELF relocations. There is probably some overlap with other5.2173 -relocation types already defined. */5.2174 - BFD_RELOC_NONE,5.2175 - BFD_RELOC_SPARC_WDISP22,5.2176 - BFD_RELOC_SPARC22,5.2177 - BFD_RELOC_SPARC13,5.2178 - BFD_RELOC_SPARC_GOT10,5.2179 - BFD_RELOC_SPARC_GOT13,5.2180 - BFD_RELOC_SPARC_GOT22,5.2181 - BFD_RELOC_SPARC_PC10,5.2182 - BFD_RELOC_SPARC_PC22,5.2183 - BFD_RELOC_SPARC_WPLT30,5.2184 - BFD_RELOC_SPARC_COPY,5.2185 - BFD_RELOC_SPARC_GLOB_DAT,5.2186 - BFD_RELOC_SPARC_JMP_SLOT,5.2187 - BFD_RELOC_SPARC_RELATIVE,5.2188 - BFD_RELOC_SPARC_UA16,5.2189 - BFD_RELOC_SPARC_UA32,5.2190 - BFD_RELOC_SPARC_UA64,5.2191 -5.2192 -/* I think these are specific to SPARC a.out (e.g., Sun 4). */5.2193 - BFD_RELOC_SPARC_BASE13,5.2194 - BFD_RELOC_SPARC_BASE22,5.2195 -5.2196 -/* SPARC64 relocations */5.2197 -#define BFD_RELOC_SPARC_64 BFD_RELOC_645.2198 - BFD_RELOC_SPARC_10,5.2199 - BFD_RELOC_SPARC_11,5.2200 - BFD_RELOC_SPARC_OLO10,5.2201 - BFD_RELOC_SPARC_HH22,5.2202 - BFD_RELOC_SPARC_HM10,5.2203 - BFD_RELOC_SPARC_LM22,5.2204 - BFD_RELOC_SPARC_PC_HH22,5.2205 - BFD_RELOC_SPARC_PC_HM10,5.2206 - BFD_RELOC_SPARC_PC_LM22,5.2207 - BFD_RELOC_SPARC_WDISP16,5.2208 - BFD_RELOC_SPARC_WDISP19,5.2209 - BFD_RELOC_SPARC_7,5.2210 - BFD_RELOC_SPARC_6,5.2211 - BFD_RELOC_SPARC_5,5.2212 -#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL5.2213 - BFD_RELOC_SPARC_PLT32,5.2214 - BFD_RELOC_SPARC_PLT64,5.2215 - BFD_RELOC_SPARC_HIX22,5.2216 - BFD_RELOC_SPARC_LOX10,5.2217 - BFD_RELOC_SPARC_H44,5.2218 - BFD_RELOC_SPARC_M44,5.2219 - BFD_RELOC_SPARC_L44,5.2220 - BFD_RELOC_SPARC_REGISTER,5.2221 -5.2222 -/* SPARC little endian relocation */5.2223 - BFD_RELOC_SPARC_REV32,5.2224 -5.2225 -/* SPARC TLS relocations */5.2226 - BFD_RELOC_SPARC_TLS_GD_HI22,5.2227 - BFD_RELOC_SPARC_TLS_GD_LO10,5.2228 - BFD_RELOC_SPARC_TLS_GD_ADD,5.2229 - BFD_RELOC_SPARC_TLS_GD_CALL,5.2230 - BFD_RELOC_SPARC_TLS_LDM_HI22,5.2231 - BFD_RELOC_SPARC_TLS_LDM_LO10,5.2232 - BFD_RELOC_SPARC_TLS_LDM_ADD,5.2233 - BFD_RELOC_SPARC_TLS_LDM_CALL,5.2234 - BFD_RELOC_SPARC_TLS_LDO_HIX22,5.2235 - BFD_RELOC_SPARC_TLS_LDO_LOX10,5.2236 - BFD_RELOC_SPARC_TLS_LDO_ADD,5.2237 - BFD_RELOC_SPARC_TLS_IE_HI22,5.2238 - BFD_RELOC_SPARC_TLS_IE_LO10,5.2239 - BFD_RELOC_SPARC_TLS_IE_LD,5.2240 - BFD_RELOC_SPARC_TLS_IE_LDX,5.2241 - BFD_RELOC_SPARC_TLS_IE_ADD,5.2242 - BFD_RELOC_SPARC_TLS_LE_HIX22,5.2243 - BFD_RELOC_SPARC_TLS_LE_LOX10,5.2244 - BFD_RELOC_SPARC_TLS_DTPMOD32,5.2245 - BFD_RELOC_SPARC_TLS_DTPMOD64,5.2246 - BFD_RELOC_SPARC_TLS_DTPOFF32,5.2247 - BFD_RELOC_SPARC_TLS_DTPOFF64,5.2248 - BFD_RELOC_SPARC_TLS_TPOFF32,5.2249 - BFD_RELOC_SPARC_TLS_TPOFF64,5.2250 -5.2251 -/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or5.2252 -"addend" in some special way.5.2253 -For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when5.2254 -writing; when reading, it will be the absolute section symbol. The5.2255 -addend is the displacement in bytes of the "lda" instruction from5.2256 -the "ldah" instruction (which is at the address of this reloc). */5.2257 - BFD_RELOC_ALPHA_GPDISP_HI16,5.2258 -5.2259 -/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as5.2260 -with GPDISP_HI16 relocs. The addend is ignored when writing the5.2261 -relocations out, and is filled in with the file's GP value on5.2262 -reading, for convenience. */5.2263 - BFD_RELOC_ALPHA_GPDISP_LO16,5.2264 -5.2265 -/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI165.2266 -relocation except that there is no accompanying GPDISP_LO165.2267 -relocation. */5.2268 - BFD_RELOC_ALPHA_GPDISP,5.2269 -5.2270 -/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;5.2271 -the assembler turns it into a LDQ instruction to load the address of5.2272 -the symbol, and then fills in a register in the real instruction.5.2273 -5.2274 -The LITERAL reloc, at the LDQ instruction, refers to the .lita5.2275 -section symbol. The addend is ignored when writing, but is filled5.2276 -in with the file's GP value on reading, for convenience, as with the5.2277 -GPDISP_LO16 reloc.5.2278 -5.2279 -The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.5.2280 -It should refer to the symbol to be referenced, as with 16_GOTOFF,5.2281 -but it generates output not based on the position within the .got5.2282 -section, but relative to the GP value chosen for the file during the5.2283 -final link stage.5.2284 -5.2285 -The LITUSE reloc, on the instruction using the loaded address, gives5.2286 -information to the linker that it might be able to use to optimize5.2287 -away some literal section references. The symbol is ignored (read5.2288 -as the absolute section symbol), and the "addend" indicates the type5.2289 -of instruction using the register:5.2290 -1 - "memory" fmt insn5.2291 -2 - byte-manipulation (byte offset reg)5.2292 -3 - jsr (target of branch) */5.2293 - BFD_RELOC_ALPHA_LITERAL,5.2294 - BFD_RELOC_ALPHA_ELF_LITERAL,5.2295 - BFD_RELOC_ALPHA_LITUSE,5.2296 -5.2297 -/* The HINT relocation indicates a value that should be filled into the5.2298 -"hint" field of a jmp/jsr/ret instruction, for possible branch-5.2299 -prediction logic which may be provided on some processors. */5.2300 - BFD_RELOC_ALPHA_HINT,5.2301 -5.2302 -/* The LINKAGE relocation outputs a linkage pair in the object file,5.2303 -which is filled by the linker. */5.2304 - BFD_RELOC_ALPHA_LINKAGE,5.2305 -5.2306 -/* The CODEADDR relocation outputs a STO_CA in the object file,5.2307 -which is filled by the linker. */5.2308 - BFD_RELOC_ALPHA_CODEADDR,5.2309 -5.2310 -/* The GPREL_HI/LO relocations together form a 32-bit offset from the5.2311 -GP register. */5.2312 - BFD_RELOC_ALPHA_GPREL_HI16,5.2313 - BFD_RELOC_ALPHA_GPREL_LO16,5.2314 -5.2315 -/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must5.2316 -share a common GP, and the target address is adjusted for5.2317 -STO_ALPHA_STD_GPLOAD. */5.2318 - BFD_RELOC_ALPHA_BRSGP,5.2319 -5.2320 -/* Alpha thread-local storage relocations. */5.2321 - BFD_RELOC_ALPHA_TLSGD,5.2322 - BFD_RELOC_ALPHA_TLSLDM,5.2323 - BFD_RELOC_ALPHA_DTPMOD64,5.2324 - BFD_RELOC_ALPHA_GOTDTPREL16,5.2325 - BFD_RELOC_ALPHA_DTPREL64,5.2326 - BFD_RELOC_ALPHA_DTPREL_HI16,5.2327 - BFD_RELOC_ALPHA_DTPREL_LO16,5.2328 - BFD_RELOC_ALPHA_DTPREL16,5.2329 - BFD_RELOC_ALPHA_GOTTPREL16,5.2330 - BFD_RELOC_ALPHA_TPREL64,5.2331 - BFD_RELOC_ALPHA_TPREL_HI16,5.2332 - BFD_RELOC_ALPHA_TPREL_LO16,5.2333 - BFD_RELOC_ALPHA_TPREL16,5.2334 -5.2335 -/* Bits 27..2 of the relocation address shifted right 2 bits;5.2336 -simple reloc otherwise. */5.2337 - BFD_RELOC_MIPS_JMP,5.2338 -5.2339 -/* The MIPS16 jump instruction. */5.2340 - BFD_RELOC_MIPS16_JMP,5.2341 -5.2342 -/* MIPS16 GP relative reloc. */5.2343 - BFD_RELOC_MIPS16_GPREL,5.2344 -5.2345 -/* High 16 bits of 32-bit value; simple reloc. */5.2346 - BFD_RELOC_HI16,5.2347 -5.2348 -/* High 16 bits of 32-bit value but the low 16 bits will be sign5.2349 -extended and added to form the final result. If the low 165.2350 -bits form a negative number, we need to add one to the high value5.2351 -to compensate for the borrow when the low bits are added. */5.2352 - BFD_RELOC_HI16_S,5.2353 -5.2354 -/* Low 16 bits. */5.2355 - BFD_RELOC_LO16,5.2356 -5.2357 -/* MIPS16 high 16 bits of 32-bit value. */5.2358 - BFD_RELOC_MIPS16_HI16,5.2359 -5.2360 -/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign5.2361 -extended and added to form the final result. If the low 165.2362 -bits form a negative number, we need to add one to the high value5.2363 -to compensate for the borrow when the low bits are added. */5.2364 - BFD_RELOC_MIPS16_HI16_S,5.2365 -5.2366 -/* MIPS16 low 16 bits. */5.2367 - BFD_RELOC_MIPS16_LO16,5.2368 -5.2369 -/* Relocation against a MIPS literal section. */5.2370 - BFD_RELOC_MIPS_LITERAL,5.2371 -5.2372 -/* MIPS ELF relocations. */5.2373 - BFD_RELOC_MIPS_GOT16,5.2374 - BFD_RELOC_MIPS_CALL16,5.2375 - BFD_RELOC_MIPS_GOT_HI16,5.2376 - BFD_RELOC_MIPS_GOT_LO16,5.2377 - BFD_RELOC_MIPS_CALL_HI16,5.2378 - BFD_RELOC_MIPS_CALL_LO16,5.2379 - BFD_RELOC_MIPS_SUB,5.2380 - BFD_RELOC_MIPS_GOT_PAGE,5.2381 - BFD_RELOC_MIPS_GOT_OFST,5.2382 - BFD_RELOC_MIPS_GOT_DISP,5.2383 - BFD_RELOC_MIPS_SHIFT5,5.2384 - BFD_RELOC_MIPS_SHIFT6,5.2385 - BFD_RELOC_MIPS_INSERT_A,5.2386 - BFD_RELOC_MIPS_INSERT_B,5.2387 - BFD_RELOC_MIPS_DELETE,5.2388 - BFD_RELOC_MIPS_HIGHEST,5.2389 - BFD_RELOC_MIPS_HIGHER,5.2390 - BFD_RELOC_MIPS_SCN_DISP,5.2391 - BFD_RELOC_MIPS_REL16,5.2392 - BFD_RELOC_MIPS_RELGOT,5.2393 - BFD_RELOC_MIPS_JALR,5.2394 - BFD_RELOC_MIPS_TLS_DTPMOD32,5.2395 - BFD_RELOC_MIPS_TLS_DTPREL32,5.2396 - BFD_RELOC_MIPS_TLS_DTPMOD64,5.2397 - BFD_RELOC_MIPS_TLS_DTPREL64,5.2398 - BFD_RELOC_MIPS_TLS_GD,5.2399 - BFD_RELOC_MIPS_TLS_LDM,5.2400 - BFD_RELOC_MIPS_TLS_DTPREL_HI16,5.2401 - BFD_RELOC_MIPS_TLS_DTPREL_LO16,5.2402 - BFD_RELOC_MIPS_TLS_GOTTPREL,5.2403 - BFD_RELOC_MIPS_TLS_TPREL32,5.2404 - BFD_RELOC_MIPS_TLS_TPREL64,5.2405 - BFD_RELOC_MIPS_TLS_TPREL_HI16,5.2406 - BFD_RELOC_MIPS_TLS_TPREL_LO16,5.2407 -5.2408 -5.2409 -/* Fujitsu Frv Relocations. */5.2410 - BFD_RELOC_FRV_LABEL16,5.2411 - BFD_RELOC_FRV_LABEL24,5.2412 - BFD_RELOC_FRV_LO16,5.2413 - BFD_RELOC_FRV_HI16,5.2414 - BFD_RELOC_FRV_GPREL12,5.2415 - BFD_RELOC_FRV_GPRELU12,5.2416 - BFD_RELOC_FRV_GPREL32,5.2417 - BFD_RELOC_FRV_GPRELHI,5.2418 - BFD_RELOC_FRV_GPRELLO,5.2419 - BFD_RELOC_FRV_GOT12,5.2420 - BFD_RELOC_FRV_GOTHI,5.2421 - BFD_RELOC_FRV_GOTLO,5.2422 - BFD_RELOC_FRV_FUNCDESC,5.2423 - BFD_RELOC_FRV_FUNCDESC_GOT12,5.2424 - BFD_RELOC_FRV_FUNCDESC_GOTHI,5.2425 - BFD_RELOC_FRV_FUNCDESC_GOTLO,5.2426 - BFD_RELOC_FRV_FUNCDESC_VALUE,5.2427 - BFD_RELOC_FRV_FUNCDESC_GOTOFF12,5.2428 - BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,5.2429 - BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,5.2430 - BFD_RELOC_FRV_GOTOFF12,5.2431 - BFD_RELOC_FRV_GOTOFFHI,5.2432 - BFD_RELOC_FRV_GOTOFFLO,5.2433 - BFD_RELOC_FRV_GETTLSOFF,5.2434 - BFD_RELOC_FRV_TLSDESC_VALUE,5.2435 - BFD_RELOC_FRV_GOTTLSDESC12,5.2436 - BFD_RELOC_FRV_GOTTLSDESCHI,5.2437 - BFD_RELOC_FRV_GOTTLSDESCLO,5.2438 - BFD_RELOC_FRV_TLSMOFF12,5.2439 - BFD_RELOC_FRV_TLSMOFFHI,5.2440 - BFD_RELOC_FRV_TLSMOFFLO,5.2441 - BFD_RELOC_FRV_GOTTLSOFF12,5.2442 - BFD_RELOC_FRV_GOTTLSOFFHI,5.2443 - BFD_RELOC_FRV_GOTTLSOFFLO,5.2444 - BFD_RELOC_FRV_TLSOFF,5.2445 - BFD_RELOC_FRV_TLSDESC_RELAX,5.2446 - BFD_RELOC_FRV_GETTLSOFF_RELAX,5.2447 - BFD_RELOC_FRV_TLSOFF_RELAX,5.2448 - BFD_RELOC_FRV_TLSMOFF,5.2449 -5.2450 -5.2451 -/* This is a 24bit GOT-relative reloc for the mn10300. */5.2452 - BFD_RELOC_MN10300_GOTOFF24,5.2453 -5.2454 -/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes5.2455 -in the instruction. */5.2456 - BFD_RELOC_MN10300_GOT32,5.2457 -5.2458 -/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes5.2459 -in the instruction. */5.2460 - BFD_RELOC_MN10300_GOT24,5.2461 -5.2462 -/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes5.2463 -in the instruction. */5.2464 - BFD_RELOC_MN10300_GOT16,5.2465 -5.2466 -/* Copy symbol at runtime. */5.2467 - BFD_RELOC_MN10300_COPY,5.2468 -5.2469 -/* Create GOT entry. */5.2470 - BFD_RELOC_MN10300_GLOB_DAT,5.2471 -5.2472 -/* Create PLT entry. */5.2473 - BFD_RELOC_MN10300_JMP_SLOT,5.2474 -5.2475 -/* Adjust by program base. */5.2476 - BFD_RELOC_MN10300_RELATIVE,5.2477 -5.2478 -5.2479 -/* i386/elf relocations */5.2480 - BFD_RELOC_386_GOT32,5.2481 - BFD_RELOC_386_PLT32,5.2482 - BFD_RELOC_386_COPY,5.2483 - BFD_RELOC_386_GLOB_DAT,5.2484 - BFD_RELOC_386_JUMP_SLOT,5.2485 - BFD_RELOC_386_RELATIVE,5.2486 - BFD_RELOC_386_GOTOFF,5.2487 - BFD_RELOC_386_GOTPC,5.2488 - BFD_RELOC_386_TLS_TPOFF,5.2489 - BFD_RELOC_386_TLS_IE,5.2490 - BFD_RELOC_386_TLS_GOTIE,5.2491 - BFD_RELOC_386_TLS_LE,5.2492 - BFD_RELOC_386_TLS_GD,5.2493 - BFD_RELOC_386_TLS_LDM,5.2494 - BFD_RELOC_386_TLS_LDO_32,5.2495 - BFD_RELOC_386_TLS_IE_32,5.2496 - BFD_RELOC_386_TLS_LE_32,5.2497 - BFD_RELOC_386_TLS_DTPMOD32,5.2498 - BFD_RELOC_386_TLS_DTPOFF32,5.2499 - BFD_RELOC_386_TLS_TPOFF32,5.2500 -5.2501 -/* x86-64/elf relocations */5.2502 - BFD_RELOC_X86_64_GOT32,5.2503 - BFD_RELOC_X86_64_PLT32,5.2504 - BFD_RELOC_X86_64_COPY,5.2505 - BFD_RELOC_X86_64_GLOB_DAT,5.2506 - BFD_RELOC_X86_64_JUMP_SLOT,5.2507 - BFD_RELOC_X86_64_RELATIVE,5.2508 - BFD_RELOC_X86_64_GOTPCREL,5.2509 - BFD_RELOC_X86_64_32S,5.2510 - BFD_RELOC_X86_64_DTPMOD64,5.2511 - BFD_RELOC_X86_64_DTPOFF64,5.2512 - BFD_RELOC_X86_64_TPOFF64,5.2513 - BFD_RELOC_X86_64_TLSGD,5.2514 - BFD_RELOC_X86_64_TLSLD,5.2515 - BFD_RELOC_X86_64_DTPOFF32,5.2516 - BFD_RELOC_X86_64_GOTTPOFF,5.2517 - BFD_RELOC_X86_64_TPOFF32,5.2518 -5.2519 -/* ns32k relocations */5.2520 - BFD_RELOC_NS32K_IMM_8,5.2521 - BFD_RELOC_NS32K_IMM_16,5.2522 - BFD_RELOC_NS32K_IMM_32,5.2523 - BFD_RELOC_NS32K_IMM_8_PCREL,5.2524 - BFD_RELOC_NS32K_IMM_16_PCREL,5.2525 - BFD_RELOC_NS32K_IMM_32_PCREL,5.2526 - BFD_RELOC_NS32K_DISP_8,5.2527 - BFD_RELOC_NS32K_DISP_16,5.2528 - BFD_RELOC_NS32K_DISP_32,5.2529 - BFD_RELOC_NS32K_DISP_8_PCREL,5.2530 - BFD_RELOC_NS32K_DISP_16_PCREL,5.2531 - BFD_RELOC_NS32K_DISP_32_PCREL,5.2532 -5.2533 -/* PDP11 relocations */5.2534 - BFD_RELOC_PDP11_DISP_8_PCREL,5.2535 - BFD_RELOC_PDP11_DISP_6_PCREL,5.2536 -5.2537 -/* Picojava relocs. Not all of these appear in object files. */5.2538 - BFD_RELOC_PJ_CODE_HI16,5.2539 - BFD_RELOC_PJ_CODE_LO16,5.2540 - BFD_RELOC_PJ_CODE_DIR16,5.2541 - BFD_RELOC_PJ_CODE_DIR32,5.2542 - BFD_RELOC_PJ_CODE_REL16,5.2543 - BFD_RELOC_PJ_CODE_REL32,5.2544 -5.2545 -/* Power(rs6000) and PowerPC relocations. */5.2546 - BFD_RELOC_PPC_B26,5.2547 - BFD_RELOC_PPC_BA26,5.2548 - BFD_RELOC_PPC_TOC16,5.2549 - BFD_RELOC_PPC_B16,5.2550 - BFD_RELOC_PPC_B16_BRTAKEN,5.2551 - BFD_RELOC_PPC_B16_BRNTAKEN,5.2552 - BFD_RELOC_PPC_BA16,5.2553 - BFD_RELOC_PPC_BA16_BRTAKEN,5.2554 - BFD_RELOC_PPC_BA16_BRNTAKEN,5.2555 - BFD_RELOC_PPC_COPY,5.2556 - BFD_RELOC_PPC_GLOB_DAT,5.2557 - BFD_RELOC_PPC_JMP_SLOT,5.2558 - BFD_RELOC_PPC_RELATIVE,5.2559 - BFD_RELOC_PPC_LOCAL24PC,5.2560 - BFD_RELOC_PPC_EMB_NADDR32,5.2561 - BFD_RELOC_PPC_EMB_NADDR16,5.2562 - BFD_RELOC_PPC_EMB_NADDR16_LO,5.2563 - BFD_RELOC_PPC_EMB_NADDR16_HI,5.2564 - BFD_RELOC_PPC_EMB_NADDR16_HA,5.2565 - BFD_RELOC_PPC_EMB_SDAI16,5.2566 - BFD_RELOC_PPC_EMB_SDA2I16,5.2567 - BFD_RELOC_PPC_EMB_SDA2REL,5.2568 - BFD_RELOC_PPC_EMB_SDA21,5.2569 - BFD_RELOC_PPC_EMB_MRKREF,5.2570 - BFD_RELOC_PPC_EMB_RELSEC16,5.2571 - BFD_RELOC_PPC_EMB_RELST_LO,5.2572 - BFD_RELOC_PPC_EMB_RELST_HI,5.2573 - BFD_RELOC_PPC_EMB_RELST_HA,5.2574 - BFD_RELOC_PPC_EMB_BIT_FLD,5.2575 - BFD_RELOC_PPC_EMB_RELSDA,5.2576 - BFD_RELOC_PPC64_HIGHER,5.2577 - BFD_RELOC_PPC64_HIGHER_S,5.2578 - BFD_RELOC_PPC64_HIGHEST,5.2579 - BFD_RELOC_PPC64_HIGHEST_S,5.2580 - BFD_RELOC_PPC64_TOC16_LO,5.2581 - BFD_RELOC_PPC64_TOC16_HI,5.2582 - BFD_RELOC_PPC64_TOC16_HA,5.2583 - BFD_RELOC_PPC64_TOC,5.2584 - BFD_RELOC_PPC64_PLTGOT16,5.2585 - BFD_RELOC_PPC64_PLTGOT16_LO,5.2586 - BFD_RELOC_PPC64_PLTGOT16_HI,5.2587 - BFD_RELOC_PPC64_PLTGOT16_HA,5.2588 - BFD_RELOC_PPC64_ADDR16_DS,5.2589 - BFD_RELOC_PPC64_ADDR16_LO_DS,5.2590 - BFD_RELOC_PPC64_GOT16_DS,5.2591 - BFD_RELOC_PPC64_GOT16_LO_DS,5.2592 - BFD_RELOC_PPC64_PLT16_LO_DS,5.2593 - BFD_RELOC_PPC64_SECTOFF_DS,5.2594 - BFD_RELOC_PPC64_SECTOFF_LO_DS,5.2595 - BFD_RELOC_PPC64_TOC16_DS,5.2596 - BFD_RELOC_PPC64_TOC16_LO_DS,5.2597 - BFD_RELOC_PPC64_PLTGOT16_DS,5.2598 - BFD_RELOC_PPC64_PLTGOT16_LO_DS,5.2599 -5.2600 -/* PowerPC and PowerPC64 thread-local storage relocations. */5.2601 - BFD_RELOC_PPC_TLS,5.2602 - BFD_RELOC_PPC_DTPMOD,5.2603 - BFD_RELOC_PPC_TPREL16,5.2604 - BFD_RELOC_PPC_TPREL16_LO,5.2605 - BFD_RELOC_PPC_TPREL16_HI,5.2606 - BFD_RELOC_PPC_TPREL16_HA,5.2607 - BFD_RELOC_PPC_TPREL,5.2608 - BFD_RELOC_PPC_DTPREL16,5.2609 - BFD_RELOC_PPC_DTPREL16_LO,5.2610 - BFD_RELOC_PPC_DTPREL16_HI,5.2611 - BFD_RELOC_PPC_DTPREL16_HA,5.2612 - BFD_RELOC_PPC_DTPREL,5.2613 - BFD_RELOC_PPC_GOT_TLSGD16,5.2614 - BFD_RELOC_PPC_GOT_TLSGD16_LO,5.2615 - BFD_RELOC_PPC_GOT_TLSGD16_HI,5.2616 - BFD_RELOC_PPC_GOT_TLSGD16_HA,5.2617 - BFD_RELOC_PPC_GOT_TLSLD16,5.2618 - BFD_RELOC_PPC_GOT_TLSLD16_LO,5.2619 - BFD_RELOC_PPC_GOT_TLSLD16_HI,5.2620 - BFD_RELOC_PPC_GOT_TLSLD16_HA,5.2621 - BFD_RELOC_PPC_GOT_TPREL16,5.2622 - BFD_RELOC_PPC_GOT_TPREL16_LO,5.2623 - BFD_RELOC_PPC_GOT_TPREL16_HI,5.2624 - BFD_RELOC_PPC_GOT_TPREL16_HA,5.2625 - BFD_RELOC_PPC_GOT_DTPREL16,5.2626 - BFD_RELOC_PPC_GOT_DTPREL16_LO,5.2627 - BFD_RELOC_PPC_GOT_DTPREL16_HI,5.2628 - BFD_RELOC_PPC_GOT_DTPREL16_HA,5.2629 - BFD_RELOC_PPC64_TPREL16_DS,5.2630 - BFD_RELOC_PPC64_TPREL16_LO_DS,5.2631 - BFD_RELOC_PPC64_TPREL16_HIGHER,5.2632 - BFD_RELOC_PPC64_TPREL16_HIGHERA,5.2633 - BFD_RELOC_PPC64_TPREL16_HIGHEST,5.2634 - BFD_RELOC_PPC64_TPREL16_HIGHESTA,5.2635 - BFD_RELOC_PPC64_DTPREL16_DS,5.2636 - BFD_RELOC_PPC64_DTPREL16_LO_DS,5.2637 - BFD_RELOC_PPC64_DTPREL16_HIGHER,5.2638 - BFD_RELOC_PPC64_DTPREL16_HIGHERA,5.2639 - BFD_RELOC_PPC64_DTPREL16_HIGHEST,5.2640 - BFD_RELOC_PPC64_DTPREL16_HIGHESTA,5.2641 -5.2642 -/* IBM 370/390 relocations */5.2643 - BFD_RELOC_I370_D12,5.2644 -5.2645 -/* The type of reloc used to build a constructor table - at the moment5.2646 -probably a 32 bit wide absolute relocation, but the target can choose.5.2647 -It generally does map to one of the other relocation types. */5.2648 - BFD_RELOC_CTOR,5.2649 -5.2650 -/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are5.2651 -not stored in the instruction. */5.2652 - BFD_RELOC_ARM_PCREL_BRANCH,5.2653 -5.2654 -/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is5.2655 -not stored in the instruction. The 2nd lowest bit comes from a 1 bit5.2656 -field in the instruction. */5.2657 - BFD_RELOC_ARM_PCREL_BLX,5.2658 -5.2659 -/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is5.2660 -not stored in the instruction. The 2nd lowest bit comes from a 1 bit5.2661 -field in the instruction. */5.2662 - BFD_RELOC_THUMB_PCREL_BLX,5.2663 -5.2664 -/* These relocs are only used within the ARM assembler. They are not5.2665 -(at present) written to any object files. */5.2666 - BFD_RELOC_ARM_IMMEDIATE,5.2667 - BFD_RELOC_ARM_ADRL_IMMEDIATE,5.2668 - BFD_RELOC_ARM_OFFSET_IMM,5.2669 - BFD_RELOC_ARM_SHIFT_IMM,5.2670 - BFD_RELOC_ARM_SMI,5.2671 - BFD_RELOC_ARM_SWI,5.2672 - BFD_RELOC_ARM_MULTI,5.2673 - BFD_RELOC_ARM_CP_OFF_IMM,5.2674 - BFD_RELOC_ARM_CP_OFF_IMM_S2,5.2675 - BFD_RELOC_ARM_ADR_IMM,5.2676 - BFD_RELOC_ARM_LDR_IMM,5.2677 - BFD_RELOC_ARM_LITERAL,5.2678 - BFD_RELOC_ARM_IN_POOL,5.2679 - BFD_RELOC_ARM_OFFSET_IMM8,5.2680 - BFD_RELOC_ARM_HWLITERAL,5.2681 - BFD_RELOC_ARM_THUMB_ADD,5.2682 - BFD_RELOC_ARM_THUMB_IMM,5.2683 - BFD_RELOC_ARM_THUMB_SHIFT,5.2684 - BFD_RELOC_ARM_THUMB_OFFSET,5.2685 - BFD_RELOC_ARM_GOT12,5.2686 - BFD_RELOC_ARM_GOT32,5.2687 - BFD_RELOC_ARM_JUMP_SLOT,5.2688 - BFD_RELOC_ARM_COPY,5.2689 - BFD_RELOC_ARM_GLOB_DAT,5.2690 - BFD_RELOC_ARM_PLT32,5.2691 - BFD_RELOC_ARM_RELATIVE,5.2692 - BFD_RELOC_ARM_GOTOFF,5.2693 - BFD_RELOC_ARM_GOTPC,5.2694 -5.2695 -/* Pc-relative or absolute relocation depending on target. Used for5.2696 -entries in .init_array sections. */5.2697 - BFD_RELOC_ARM_TARGET1,5.2698 -5.2699 -/* Read-only segment base relative address. */5.2700 - BFD_RELOC_ARM_ROSEGREL32,5.2701 -5.2702 -/* Data segment base relative address. */5.2703 - BFD_RELOC_ARM_SBREL32,5.2704 -5.2705 -/* This reloc is used for References to RTTI dta from exception handling5.2706 -tables. The actual definition depends on the target. It may be a5.2707 -pc-relative or some form of GOT-indirect relocation. */5.2708 - BFD_RELOC_ARM_TARGET2,5.2709 -5.2710 -/* 31-bit PC relative address. */5.2711 - BFD_RELOC_ARM_PREL31,5.2712 -5.2713 -/* Renesas / SuperH SH relocs. Not all of these appear in object files. */5.2714 - BFD_RELOC_SH_PCDISP8BY2,5.2715 - BFD_RELOC_SH_PCDISP12BY2,5.2716 - BFD_RELOC_SH_IMM3,5.2717 - BFD_RELOC_SH_IMM3U,5.2718 - BFD_RELOC_SH_DISP12,5.2719 - BFD_RELOC_SH_DISP12BY2,5.2720 - BFD_RELOC_SH_DISP12BY4,5.2721 - BFD_RELOC_SH_DISP12BY8,5.2722 - BFD_RELOC_SH_DISP20,5.2723 - BFD_RELOC_SH_DISP20BY8,5.2724 - BFD_RELOC_SH_IMM4,5.2725 - BFD_RELOC_SH_IMM4BY2,5.2726 - BFD_RELOC_SH_IMM4BY4,5.2727 - BFD_RELOC_SH_IMM8,5.2728 - BFD_RELOC_SH_IMM8BY2,5.2729 - BFD_RELOC_SH_IMM8BY4,5.2730 - BFD_RELOC_SH_PCRELIMM8BY2,5.2731 - BFD_RELOC_SH_PCRELIMM8BY4,5.2732 - BFD_RELOC_SH_SWITCH16,5.2733 - BFD_RELOC_SH_SWITCH32,5.2734 - BFD_RELOC_SH_USES,5.2735 - BFD_RELOC_SH_COUNT,5.2736 - BFD_RELOC_SH_ALIGN,5.2737 - BFD_RELOC_SH_CODE,5.2738 - BFD_RELOC_SH_DATA,5.2739 - BFD_RELOC_SH_LABEL,5.2740 - BFD_RELOC_SH_LOOP_START,5.2741 - BFD_RELOC_SH_LOOP_END,5.2742 - BFD_RELOC_SH_COPY,5.2743 - BFD_RELOC_SH_GLOB_DAT,5.2744 - BFD_RELOC_SH_JMP_SLOT,5.2745 - BFD_RELOC_SH_RELATIVE,5.2746 - BFD_RELOC_SH_GOTPC,5.2747 - BFD_RELOC_SH_GOT_LOW16,5.2748 - BFD_RELOC_SH_GOT_MEDLOW16,5.2749 - BFD_RELOC_SH_GOT_MEDHI16,5.2750 - BFD_RELOC_SH_GOT_HI16,5.2751 - BFD_RELOC_SH_GOTPLT_LOW16,5.2752 - BFD_RELOC_SH_GOTPLT_MEDLOW16,5.2753 - BFD_RELOC_SH_GOTPLT_MEDHI16,5.2754 - BFD_RELOC_SH_GOTPLT_HI16,5.2755 - BFD_RELOC_SH_PLT_LOW16,5.2756 - BFD_RELOC_SH_PLT_MEDLOW16,5.2757 - BFD_RELOC_SH_PLT_MEDHI16,5.2758 - BFD_RELOC_SH_PLT_HI16,5.2759 - BFD_RELOC_SH_GOTOFF_LOW16,5.2760 - BFD_RELOC_SH_GOTOFF_MEDLOW16,5.2761 - BFD_RELOC_SH_GOTOFF_MEDHI16,5.2762 - BFD_RELOC_SH_GOTOFF_HI16,5.2763 - BFD_RELOC_SH_GOTPC_LOW16,5.2764 - BFD_RELOC_SH_GOTPC_MEDLOW16,5.2765 - BFD_RELOC_SH_GOTPC_MEDHI16,5.2766 - BFD_RELOC_SH_GOTPC_HI16,5.2767 - BFD_RELOC_SH_COPY64,5.2768 - BFD_RELOC_SH_GLOB_DAT64,5.2769 - BFD_RELOC_SH_JMP_SLOT64,5.2770 - BFD_RELOC_SH_RELATIVE64,5.2771 - BFD_RELOC_SH_GOT10BY4,5.2772 - BFD_RELOC_SH_GOT10BY8,5.2773 - BFD_RELOC_SH_GOTPLT10BY4,5.2774 - BFD_RELOC_SH_GOTPLT10BY8,5.2775 - BFD_RELOC_SH_GOTPLT32,5.2776 - BFD_RELOC_SH_SHMEDIA_CODE,5.2777 - BFD_RELOC_SH_IMMU5,5.2778 - BFD_RELOC_SH_IMMS6,5.2779 - BFD_RELOC_SH_IMMS6BY32,5.2780 - BFD_RELOC_SH_IMMU6,5.2781 - BFD_RELOC_SH_IMMS10,5.2782 - BFD_RELOC_SH_IMMS10BY2,5.2783 - BFD_RELOC_SH_IMMS10BY4,5.2784 - BFD_RELOC_SH_IMMS10BY8,5.2785 - BFD_RELOC_SH_IMMS16,5.2786 - BFD_RELOC_SH_IMMU16,5.2787 - BFD_RELOC_SH_IMM_LOW16,5.2788 - BFD_RELOC_SH_IMM_LOW16_PCREL,5.2789 - BFD_RELOC_SH_IMM_MEDLOW16,5.2790 - BFD_RELOC_SH_IMM_MEDLOW16_PCREL,5.2791 - BFD_RELOC_SH_IMM_MEDHI16,5.2792 - BFD_RELOC_SH_IMM_MEDHI16_PCREL,5.2793 - BFD_RELOC_SH_IMM_HI16,5.2794 - BFD_RELOC_SH_IMM_HI16_PCREL,5.2795 - BFD_RELOC_SH_PT_16,5.2796 - BFD_RELOC_SH_TLS_GD_32,5.2797 - BFD_RELOC_SH_TLS_LD_32,5.2798 - BFD_RELOC_SH_TLS_LDO_32,5.2799 - BFD_RELOC_SH_TLS_IE_32,5.2800 - BFD_RELOC_SH_TLS_LE_32,5.2801 - BFD_RELOC_SH_TLS_DTPMOD32,5.2802 - BFD_RELOC_SH_TLS_DTPOFF32,5.2803 - BFD_RELOC_SH_TLS_TPOFF32,5.2804 -5.2805 -/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must5.2806 -be zero and is not stored in the instruction. */5.2807 - BFD_RELOC_THUMB_PCREL_BRANCH9,5.2808 - BFD_RELOC_THUMB_PCREL_BRANCH12,5.2809 - BFD_RELOC_THUMB_PCREL_BRANCH23,5.2810 -5.2811 -/* ARC Cores relocs.5.2812 -ARC 22 bit pc-relative branch. The lowest two bits must be zero and are5.2813 -not stored in the instruction. The high 20 bits are installed in bits 265.2814 -through 7 of the instruction. */5.2815 - BFD_RELOC_ARC_B22_PCREL,5.2816 -5.2817 -/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not5.2818 -stored in the instruction. The high 24 bits are installed in bits 235.2819 -through 0. */5.2820 - BFD_RELOC_ARC_B26,5.2821 -5.2822 -/* Mitsubishi D10V relocs.5.2823 -This is a 10-bit reloc with the right 2 bits5.2824 -assumed to be 0. */5.2825 - BFD_RELOC_D10V_10_PCREL_R,5.2826 -5.2827 -/* Mitsubishi D10V relocs.5.2828 -This is a 10-bit reloc with the right 2 bits5.2829 -assumed to be 0. This is the same as the previous reloc5.2830 -except it is in the left container, i.e.,5.2831 -shifted left 15 bits. */5.2832 - BFD_RELOC_D10V_10_PCREL_L,5.2833 -5.2834 -/* This is an 18-bit reloc with the right 2 bits5.2835 -assumed to be 0. */5.2836 - BFD_RELOC_D10V_18,5.2837 -5.2838 -/* This is an 18-bit reloc with the right 2 bits5.2839 -assumed to be 0. */5.2840 - BFD_RELOC_D10V_18_PCREL,5.2841 -5.2842 -/* Mitsubishi D30V relocs.5.2843 -This is a 6-bit absolute reloc. */5.2844 - BFD_RELOC_D30V_6,5.2845 -5.2846 -/* This is a 6-bit pc-relative reloc with5.2847 -the right 3 bits assumed to be 0. */5.2848 - BFD_RELOC_D30V_9_PCREL,5.2849 -5.2850 -/* This is a 6-bit pc-relative reloc with5.2851 -the right 3 bits assumed to be 0. Same5.2852 -as the previous reloc but on the right side5.2853 -of the container. */5.2854 - BFD_RELOC_D30V_9_PCREL_R,5.2855 -5.2856 -/* This is a 12-bit absolute reloc with the5.2857 -right 3 bitsassumed to be 0. */5.2858 - BFD_RELOC_D30V_15,5.2859 -5.2860 -/* This is a 12-bit pc-relative reloc with5.2861 -the right 3 bits assumed to be 0. */5.2862 - BFD_RELOC_D30V_15_PCREL,5.2863 -5.2864 -/* This is a 12-bit pc-relative reloc with5.2865 -the right 3 bits assumed to be 0. Same5.2866 -as the previous reloc but on the right side5.2867 -of the container. */5.2868 - BFD_RELOC_D30V_15_PCREL_R,5.2869 -5.2870 -/* This is an 18-bit absolute reloc with5.2871 -the right 3 bits assumed to be 0. */5.2872 - BFD_RELOC_D30V_21,5.2873 -5.2874 -/* This is an 18-bit pc-relative reloc with5.2875 -the right 3 bits assumed to be 0. */5.2876 - BFD_RELOC_D30V_21_PCREL,5.2877 -5.2878 -/* This is an 18-bit pc-relative reloc with5.2879 -the right 3 bits assumed to be 0. Same5.2880 -as the previous reloc but on the right side5.2881 -of the container. */5.2882 - BFD_RELOC_D30V_21_PCREL_R,5.2883 -5.2884 -/* This is a 32-bit absolute reloc. */5.2885 - BFD_RELOC_D30V_32,5.2886 -5.2887 -/* This is a 32-bit pc-relative reloc. */5.2888 - BFD_RELOC_D30V_32_PCREL,5.2889 -5.2890 -/* DLX relocs */5.2891 - BFD_RELOC_DLX_HI16_S,5.2892 -5.2893 -/* DLX relocs */5.2894 - BFD_RELOC_DLX_LO16,5.2895 -5.2896 -/* DLX relocs */5.2897 - BFD_RELOC_DLX_JMP26,5.2898 -5.2899 -/* Renesas M32R (formerly Mitsubishi M32R) relocs.5.2900 -This is a 24 bit absolute address. */5.2901 - BFD_RELOC_M32R_24,5.2902 -5.2903 -/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */5.2904 - BFD_RELOC_M32R_10_PCREL,5.2905 -5.2906 -/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */5.2907 - BFD_RELOC_M32R_18_PCREL,5.2908 -5.2909 -/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */5.2910 - BFD_RELOC_M32R_26_PCREL,5.2911 -5.2912 -/* This is a 16-bit reloc containing the high 16 bits of an address5.2913 -used when the lower 16 bits are treated as unsigned. */5.2914 - BFD_RELOC_M32R_HI16_ULO,5.2915 -5.2916 -/* This is a 16-bit reloc containing the high 16 bits of an address5.2917 -used when the lower 16 bits are treated as signed. */5.2918 - BFD_RELOC_M32R_HI16_SLO,5.2919 -5.2920 -/* This is a 16-bit reloc containing the lower 16 bits of an address. */5.2921 - BFD_RELOC_M32R_LO16,5.2922 -5.2923 -/* This is a 16-bit reloc containing the small data area offset for use in5.2924 -add3, load, and store instructions. */5.2925 - BFD_RELOC_M32R_SDA16,5.2926 -5.2927 -/* For PIC. */5.2928 - BFD_RELOC_M32R_GOT24,5.2929 - BFD_RELOC_M32R_26_PLTREL,5.2930 - BFD_RELOC_M32R_COPY,5.2931 - BFD_RELOC_M32R_GLOB_DAT,5.2932 - BFD_RELOC_M32R_JMP_SLOT,5.2933 - BFD_RELOC_M32R_RELATIVE,5.2934 - BFD_RELOC_M32R_GOTOFF,5.2935 - BFD_RELOC_M32R_GOTOFF_HI_ULO,5.2936 - BFD_RELOC_M32R_GOTOFF_HI_SLO,5.2937 - BFD_RELOC_M32R_GOTOFF_LO,5.2938 - BFD_RELOC_M32R_GOTPC24,5.2939 - BFD_RELOC_M32R_GOT16_HI_ULO,5.2940 - BFD_RELOC_M32R_GOT16_HI_SLO,5.2941 - BFD_RELOC_M32R_GOT16_LO,5.2942 - BFD_RELOC_M32R_GOTPC_HI_ULO,5.2943 - BFD_RELOC_M32R_GOTPC_HI_SLO,5.2944 - BFD_RELOC_M32R_GOTPC_LO,5.2945 -5.2946 -/* This is a 9-bit reloc */5.2947 - BFD_RELOC_V850_9_PCREL,5.2948 -5.2949 -/* This is a 22-bit reloc */5.2950 - BFD_RELOC_V850_22_PCREL,5.2951 -5.2952 -/* This is a 16 bit offset from the short data area pointer. */5.2953 - BFD_RELOC_V850_SDA_16_16_OFFSET,5.2954 -5.2955 -/* This is a 16 bit offset (of which only 15 bits are used) from the5.2956 -short data area pointer. */5.2957 - BFD_RELOC_V850_SDA_15_16_OFFSET,5.2958 -5.2959 -/* This is a 16 bit offset from the zero data area pointer. */5.2960 - BFD_RELOC_V850_ZDA_16_16_OFFSET,5.2961 -5.2962 -/* This is a 16 bit offset (of which only 15 bits are used) from the5.2963 -zero data area pointer. */5.2964 - BFD_RELOC_V850_ZDA_15_16_OFFSET,5.2965 -5.2966 -/* This is an 8 bit offset (of which only 6 bits are used) from the5.2967 -tiny data area pointer. */5.2968 - BFD_RELOC_V850_TDA_6_8_OFFSET,5.2969 -5.2970 -/* This is an 8bit offset (of which only 7 bits are used) from the tiny5.2971 -data area pointer. */5.2972 - BFD_RELOC_V850_TDA_7_8_OFFSET,5.2973 -5.2974 -/* This is a 7 bit offset from the tiny data area pointer. */5.2975 - BFD_RELOC_V850_TDA_7_7_OFFSET,5.2976 -5.2977 -/* This is a 16 bit offset from the tiny data area pointer. */5.2978 - BFD_RELOC_V850_TDA_16_16_OFFSET,5.2979 -5.2980 -/* This is a 5 bit offset (of which only 4 bits are used) from the tiny5.2981 -data area pointer. */5.2982 - BFD_RELOC_V850_TDA_4_5_OFFSET,5.2983 -5.2984 -/* This is a 4 bit offset from the tiny data area pointer. */5.2985 - BFD_RELOC_V850_TDA_4_4_OFFSET,5.2986 -5.2987 -/* This is a 16 bit offset from the short data area pointer, with the5.2988 -bits placed non-contiguously in the instruction. */5.2989 - BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,5.2990 -5.2991 -/* This is a 16 bit offset from the zero data area pointer, with the5.2992 -bits placed non-contiguously in the instruction. */5.2993 - BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,5.2994 -5.2995 -/* This is a 6 bit offset from the call table base pointer. */5.2996 - BFD_RELOC_V850_CALLT_6_7_OFFSET,5.2997 -5.2998 -/* This is a 16 bit offset from the call table base pointer. */5.2999 - BFD_RELOC_V850_CALLT_16_16_OFFSET,5.3000 -5.3001 -/* Used for relaxing indirect function calls. */5.3002 - BFD_RELOC_V850_LONGCALL,5.3003 -5.3004 -/* Used for relaxing indirect jumps. */5.3005 - BFD_RELOC_V850_LONGJUMP,5.3006 -5.3007 -/* Used to maintain alignment whilst relaxing. */5.3008 - BFD_RELOC_V850_ALIGN,5.3009 -5.3010 -/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu5.3011 -instructions. */5.3012 - BFD_RELOC_V850_LO16_SPLIT_OFFSET,5.3013 -5.3014 -/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the5.3015 -instruction. */5.3016 - BFD_RELOC_MN10300_32_PCREL,5.3017 -5.3018 -/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the5.3019 -instruction. */5.3020 - BFD_RELOC_MN10300_16_PCREL,5.3021 -5.3022 -/* This is a 8bit DP reloc for the tms320c30, where the most5.3023 -significant 8 bits of a 24 bit word are placed into the least5.3024 -significant 8 bits of the opcode. */5.3025 - BFD_RELOC_TIC30_LDP,5.3026 -5.3027 -/* This is a 7bit reloc for the tms320c54x, where the least5.3028 -significant 7 bits of a 16 bit word are placed into the least5.3029 -significant 7 bits of the opcode. */5.3030 - BFD_RELOC_TIC54X_PARTLS7,5.3031 -5.3032 -/* This is a 9bit DP reloc for the tms320c54x, where the most5.3033 -significant 9 bits of a 16 bit word are placed into the least5.3034 -significant 9 bits of the opcode. */5.3035 - BFD_RELOC_TIC54X_PARTMS9,5.3036 -5.3037 -/* This is an extended address 23-bit reloc for the tms320c54x. */5.3038 - BFD_RELOC_TIC54X_23,5.3039 -5.3040 -/* This is a 16-bit reloc for the tms320c54x, where the least5.3041 -significant 16 bits of a 23-bit extended address are placed into5.3042 -the opcode. */5.3043 - BFD_RELOC_TIC54X_16_OF_23,5.3044 -5.3045 -/* This is a reloc for the tms320c54x, where the most5.3046 -significant 7 bits of a 23-bit extended address are placed into5.3047 -the opcode. */5.3048 - BFD_RELOC_TIC54X_MS7_OF_23,5.3049 -5.3050 -/* This is a 48 bit reloc for the FR30 that stores 32 bits. */5.3051 - BFD_RELOC_FR30_48,5.3052 -5.3053 -/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into5.3054 -two sections. */5.3055 - BFD_RELOC_FR30_20,5.3056 -5.3057 -/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in5.3058 -4 bits. */5.3059 - BFD_RELOC_FR30_6_IN_4,5.3060 -5.3061 -/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset5.3062 -into 8 bits. */5.3063 - BFD_RELOC_FR30_8_IN_8,5.3064 -5.3065 -/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset5.3066 -into 8 bits. */5.3067 - BFD_RELOC_FR30_9_IN_8,5.3068 -5.3069 -/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset5.3070 -into 8 bits. */5.3071 - BFD_RELOC_FR30_10_IN_8,5.3072 -5.3073 -/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative5.3074 -short offset into 8 bits. */5.3075 - BFD_RELOC_FR30_9_PCREL,5.3076 -5.3077 -/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative5.3078 -short offset into 11 bits. */5.3079 - BFD_RELOC_FR30_12_PCREL,5.3080 -5.3081 -/* Motorola Mcore relocations. */5.3082 - BFD_RELOC_MCORE_PCREL_IMM8BY4,5.3083 - BFD_RELOC_MCORE_PCREL_IMM11BY2,5.3084 - BFD_RELOC_MCORE_PCREL_IMM4BY2,5.3085 - BFD_RELOC_MCORE_PCREL_32,5.3086 - BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,5.3087 - BFD_RELOC_MCORE_RVA,5.3088 -5.3089 -/* These are relocations for the GETA instruction. */5.3090 - BFD_RELOC_MMIX_GETA,5.3091 - BFD_RELOC_MMIX_GETA_1,5.3092 - BFD_RELOC_MMIX_GETA_2,5.3093 - BFD_RELOC_MMIX_GETA_3,5.3094 -5.3095 -/* These are relocations for a conditional branch instruction. */5.3096 - BFD_RELOC_MMIX_CBRANCH,5.3097 - BFD_RELOC_MMIX_CBRANCH_J,5.3098 - BFD_RELOC_MMIX_CBRANCH_1,5.3099 - BFD_RELOC_MMIX_CBRANCH_2,5.3100 - BFD_RELOC_MMIX_CBRANCH_3,5.3101 -5.3102 -/* These are relocations for the PUSHJ instruction. */5.3103 - BFD_RELOC_MMIX_PUSHJ,5.3104 - BFD_RELOC_MMIX_PUSHJ_1,5.3105 - BFD_RELOC_MMIX_PUSHJ_2,5.3106 - BFD_RELOC_MMIX_PUSHJ_3,5.3107 - BFD_RELOC_MMIX_PUSHJ_STUBBABLE,5.3108 -5.3109 -/* These are relocations for the JMP instruction. */5.3110 - BFD_RELOC_MMIX_JMP,5.3111 - BFD_RELOC_MMIX_JMP_1,5.3112 - BFD_RELOC_MMIX_JMP_2,5.3113 - BFD_RELOC_MMIX_JMP_3,5.3114 -5.3115 -/* This is a relocation for a relative address as in a GETA instruction or5.3116 -a branch. */5.3117 - BFD_RELOC_MMIX_ADDR19,5.3118 -5.3119 -/* This is a relocation for a relative address as in a JMP instruction. */5.3120 - BFD_RELOC_MMIX_ADDR27,5.3121 -5.3122 -/* This is a relocation for an instruction field that may be a general5.3123 -register or a value 0..255. */5.3124 - BFD_RELOC_MMIX_REG_OR_BYTE,5.3125 -5.3126 -/* This is a relocation for an instruction field that may be a general5.3127 -register. */5.3128 - BFD_RELOC_MMIX_REG,5.3129 -5.3130 -/* This is a relocation for two instruction fields holding a register and5.3131 -an offset, the equivalent of the relocation. */5.3132 - BFD_RELOC_MMIX_BASE_PLUS_OFFSET,5.3133 -5.3134 -/* This relocation is an assertion that the expression is not allocated as5.3135 -a global register. It does not modify contents. */5.3136 - BFD_RELOC_MMIX_LOCAL,5.3137 -5.3138 -/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative5.3139 -short offset into 7 bits. */5.3140 - BFD_RELOC_AVR_7_PCREL,5.3141 -5.3142 -/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative5.3143 -short offset into 12 bits. */5.3144 - BFD_RELOC_AVR_13_PCREL,5.3145 -5.3146 -/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually5.3147 -program memory address) into 16 bits. */5.3148 - BFD_RELOC_AVR_16_PM,5.3149 -5.3150 -/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually5.3151 -data memory address) into 8 bit immediate value of LDI insn. */5.3152 - BFD_RELOC_AVR_LO8_LDI,5.3153 -5.3154 -/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit5.3155 -of data memory address) into 8 bit immediate value of LDI insn. */5.3156 - BFD_RELOC_AVR_HI8_LDI,5.3157 -5.3158 -/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit5.3159 -of program memory address) into 8 bit immediate value of LDI insn. */5.3160 - BFD_RELOC_AVR_HH8_LDI,5.3161 -5.3162 -/* This is a 16 bit reloc for the AVR that stores negated 8 bit value5.3163 -(usually data memory address) into 8 bit immediate value of SUBI insn. */5.3164 - BFD_RELOC_AVR_LO8_LDI_NEG,5.3165 -5.3166 -/* This is a 16 bit reloc for the AVR that stores negated 8 bit value5.3167 -(high 8 bit of data memory address) into 8 bit immediate value of5.3168 -SUBI insn. */5.3169 - BFD_RELOC_AVR_HI8_LDI_NEG,5.3170 -5.3171 -/* This is a 16 bit reloc for the AVR that stores negated 8 bit value5.3172 -(most high 8 bit of program memory address) into 8 bit immediate value5.3173 -of LDI or SUBI insn. */5.3174 - BFD_RELOC_AVR_HH8_LDI_NEG,5.3175 -5.3176 -/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually5.3177 -command address) into 8 bit immediate value of LDI insn. */5.3178 - BFD_RELOC_AVR_LO8_LDI_PM,5.3179 -5.3180 -/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit5.3181 -of command address) into 8 bit immediate value of LDI insn. */5.3182 - BFD_RELOC_AVR_HI8_LDI_PM,5.3183 -5.3184 -/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit5.3185 -of command address) into 8 bit immediate value of LDI insn. */5.3186 - BFD_RELOC_AVR_HH8_LDI_PM,5.3187 -5.3188 -/* This is a 16 bit reloc for the AVR that stores negated 8 bit value5.3189 -(usually command address) into 8 bit immediate value of SUBI insn. */5.3190 - BFD_RELOC_AVR_LO8_LDI_PM_NEG,5.3191 -5.3192 -/* This is a 16 bit reloc for the AVR that stores negated 8 bit value5.3193 -(high 8 bit of 16 bit command address) into 8 bit immediate value5.3194 -of SUBI insn. */5.3195 - BFD_RELOC_AVR_HI8_LDI_PM_NEG,5.3196 -5.3197 -/* This is a 16 bit reloc for the AVR that stores negated 8 bit value5.3198 -(high 6 bit of 22 bit command address) into 8 bit immediate5.3199 -value of SUBI insn. */5.3200 - BFD_RELOC_AVR_HH8_LDI_PM_NEG,5.3201 -5.3202 -/* This is a 32 bit reloc for the AVR that stores 23 bit value5.3203 -into 22 bits. */5.3204 - BFD_RELOC_AVR_CALL,5.3205 -5.3206 -/* This is a 16 bit reloc for the AVR that stores all needed bits5.3207 -for absolute addressing with ldi with overflow check to linktime */5.3208 - BFD_RELOC_AVR_LDI,5.3209 -5.3210 -/* This is a 6 bit reloc for the AVR that stores offset for ldd/std5.3211 -instructions */5.3212 - BFD_RELOC_AVR_6,5.3213 -5.3214 -/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw5.3215 -instructions */5.3216 - BFD_RELOC_AVR_6_ADIW,5.3217 -5.3218 -/* Direct 12 bit. */5.3219 - BFD_RELOC_390_12,5.3220 -5.3221 -/* 12 bit GOT offset. */5.3222 - BFD_RELOC_390_GOT12,5.3223 -5.3224 -/* 32 bit PC relative PLT address. */5.3225 - BFD_RELOC_390_PLT32,5.3226 -5.3227 -/* Copy symbol at runtime. */5.3228 - BFD_RELOC_390_COPY,5.3229 -5.3230 -/* Create GOT entry. */5.3231 - BFD_RELOC_390_GLOB_DAT,5.3232 -5.3233 -/* Create PLT entry. */5.3234 - BFD_RELOC_390_JMP_SLOT,5.3235 -5.3236 -/* Adjust by program base. */5.3237 - BFD_RELOC_390_RELATIVE,5.3238 -5.3239 -/* 32 bit PC relative offset to GOT. */5.3240 - BFD_RELOC_390_GOTPC,5.3241 -5.3242 -/* 16 bit GOT offset. */5.3243 - BFD_RELOC_390_GOT16,5.3244 -5.3245 -/* PC relative 16 bit shifted by 1. */5.3246 - BFD_RELOC_390_PC16DBL,5.3247 -5.3248 -/* 16 bit PC rel. PLT shifted by 1. */5.3249 - BFD_RELOC_390_PLT16DBL,5.3250 -5.3251 -/* PC relative 32 bit shifted by 1. */5.3252 - BFD_RELOC_390_PC32DBL,5.3253 -5.3254 -/* 32 bit PC rel. PLT shifted by 1. */5.3255 - BFD_RELOC_390_PLT32DBL,5.3256 -5.3257 -/* 32 bit PC rel. GOT shifted by 1. */5.3258 - BFD_RELOC_390_GOTPCDBL,5.3259 -5.3260 -/* 64 bit GOT offset. */5.3261 - BFD_RELOC_390_GOT64,5.3262 -5.3263 -/* 64 bit PC relative PLT address. */5.3264 - BFD_RELOC_390_PLT64,5.3265 -5.3266 -/* 32 bit rel. offset to GOT entry. */5.3267 - BFD_RELOC_390_GOTENT,5.3268 -5.3269 -/* 64 bit offset to GOT. */5.3270 - BFD_RELOC_390_GOTOFF64,5.3271 -5.3272 -/* 12-bit offset to symbol-entry within GOT, with PLT handling. */5.3273 - BFD_RELOC_390_GOTPLT12,5.3274 -5.3275 -/* 16-bit offset to symbol-entry within GOT, with PLT handling. */5.3276 - BFD_RELOC_390_GOTPLT16,5.3277 -5.3278 -/* 32-bit offset to symbol-entry within GOT, with PLT handling. */5.3279 - BFD_RELOC_390_GOTPLT32,5.3280 -5.3281 -/* 64-bit offset to symbol-entry within GOT, with PLT handling. */5.3282 - BFD_RELOC_390_GOTPLT64,5.3283 -5.3284 -/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */5.3285 - BFD_RELOC_390_GOTPLTENT,5.3286 -5.3287 -/* 16-bit rel. offset from the GOT to a PLT entry. */5.3288 - BFD_RELOC_390_PLTOFF16,5.3289 -5.3290 -/* 32-bit rel. offset from the GOT to a PLT entry. */5.3291 - BFD_RELOC_390_PLTOFF32,5.3292 -5.3293 -/* 64-bit rel. offset from the GOT to a PLT entry. */5.3294 - BFD_RELOC_390_PLTOFF64,5.3295 -5.3296 -/* s390 tls relocations. */5.3297 - BFD_RELOC_390_TLS_LOAD,5.3298 - BFD_RELOC_390_TLS_GDCALL,5.3299 - BFD_RELOC_390_TLS_LDCALL,5.3300 - BFD_RELOC_390_TLS_GD32,5.3301 - BFD_RELOC_390_TLS_GD64,5.3302 - BFD_RELOC_390_TLS_GOTIE12,5.3303 - BFD_RELOC_390_TLS_GOTIE32,5.3304 - BFD_RELOC_390_TLS_GOTIE64,5.3305 - BFD_RELOC_390_TLS_LDM32,5.3306 - BFD_RELOC_390_TLS_LDM64,5.3307 - BFD_RELOC_390_TLS_IE32,5.3308 - BFD_RELOC_390_TLS_IE64,5.3309 - BFD_RELOC_390_TLS_IEENT,5.3310 - BFD_RELOC_390_TLS_LE32,5.3311 - BFD_RELOC_390_TLS_LE64,5.3312 - BFD_RELOC_390_TLS_LDO32,5.3313 - BFD_RELOC_390_TLS_LDO64,5.3314 - BFD_RELOC_390_TLS_DTPMOD,5.3315 - BFD_RELOC_390_TLS_DTPOFF,5.3316 - BFD_RELOC_390_TLS_TPOFF,5.3317 -5.3318 -/* Long displacement extension. */5.3319 - BFD_RELOC_390_20,5.3320 - BFD_RELOC_390_GOT20,5.3321 - BFD_RELOC_390_GOTPLT20,5.3322 - BFD_RELOC_390_TLS_GOTIE20,5.3323 -5.3324 -/* Scenix IP2K - 9-bit register number / data address */5.3325 - BFD_RELOC_IP2K_FR9,5.3326 -5.3327 -/* Scenix IP2K - 4-bit register/data bank number */5.3328 - BFD_RELOC_IP2K_BANK,5.3329 -5.3330 -/* Scenix IP2K - low 13 bits of instruction word address */5.3331 - BFD_RELOC_IP2K_ADDR16CJP,5.3332 -5.3333 -/* Scenix IP2K - high 3 bits of instruction word address */5.3334 - BFD_RELOC_IP2K_PAGE3,5.3335 -5.3336 -/* Scenix IP2K - ext/low/high 8 bits of data address */5.3337 - BFD_RELOC_IP2K_LO8DATA,5.3338 - BFD_RELOC_IP2K_HI8DATA,5.3339 - BFD_RELOC_IP2K_EX8DATA,5.3340 -5.3341 -/* Scenix IP2K - low/high 8 bits of instruction word address */5.3342 - BFD_RELOC_IP2K_LO8INSN,5.3343 - BFD_RELOC_IP2K_HI8INSN,5.3344 -5.3345 -/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */5.3346 - BFD_RELOC_IP2K_PC_SKIP,5.3347 -5.3348 -/* Scenix IP2K - 16 bit word address in text section. */5.3349 - BFD_RELOC_IP2K_TEXT,5.3350 -5.3351 -/* Scenix IP2K - 7-bit sp or dp offset */5.3352 - BFD_RELOC_IP2K_FR_OFFSET,5.3353 -5.3354 -/* Scenix VPE4K coprocessor - data/insn-space addressing */5.3355 - BFD_RELOC_VPE4KMATH_DATA,5.3356 - BFD_RELOC_VPE4KMATH_INSN,5.3357 -5.3358 -/* These two relocations are used by the linker to determine which of5.3359 -the entries in a C++ virtual function table are actually used. When5.3360 -the --gc-sections option is given, the linker will zero out the entries5.3361 -that are not used, so that the code for those functions need not be5.3362 -included in the output.5.3363 -5.3364 -VTABLE_INHERIT is a zero-space relocation used to describe to the5.3365 -linker the inheritance tree of a C++ virtual function table. The5.3366 -relocation's symbol should be the parent class' vtable, and the5.3367 -relocation should be located at the child vtable.5.3368 -5.3369 -VTABLE_ENTRY is a zero-space relocation that describes the use of a5.3370 -virtual function table entry. The reloc's symbol should refer to the5.3371 -table of the class mentioned in the code. Off of that base, an offset5.3372 -describes the entry that is being used. For Rela hosts, this offset5.3373 -is stored in the reloc's addend. For Rel hosts, we are forced to put5.3374 -this offset in the reloc's section offset. */5.3375 - BFD_RELOC_VTABLE_INHERIT,5.3376 - BFD_RELOC_VTABLE_ENTRY,5.3377 -5.3378 -/* Intel IA64 Relocations. */5.3379 - BFD_RELOC_IA64_IMM14,5.3380 - BFD_RELOC_IA64_IMM22,5.3381 - BFD_RELOC_IA64_IMM64,5.3382 - BFD_RELOC_IA64_DIR32MSB,5.3383 - BFD_RELOC_IA64_DIR32LSB,5.3384 - BFD_RELOC_IA64_DIR64MSB,5.3385 - BFD_RELOC_IA64_DIR64LSB,5.3386 - BFD_RELOC_IA64_GPREL22,5.3387 - BFD_RELOC_IA64_GPREL64I,5.3388 - BFD_RELOC_IA64_GPREL32MSB,5.3389 - BFD_RELOC_IA64_GPREL32LSB,5.3390 - BFD_RELOC_IA64_GPREL64MSB,5.3391 - BFD_RELOC_IA64_GPREL64LSB,5.3392 - BFD_RELOC_IA64_LTOFF22,5.3393 - BFD_RELOC_IA64_LTOFF64I,5.3394 - BFD_RELOC_IA64_PLTOFF22,5.3395 - BFD_RELOC_IA64_PLTOFF64I,5.3396 - BFD_RELOC_IA64_PLTOFF64MSB,5.3397 - BFD_RELOC_IA64_PLTOFF64LSB,5.3398 - BFD_RELOC_IA64_FPTR64I,5.3399 - BFD_RELOC_IA64_FPTR32MSB,5.3400 - BFD_RELOC_IA64_FPTR32LSB,5.3401 - BFD_RELOC_IA64_FPTR64MSB,5.3402 - BFD_RELOC_IA64_FPTR64LSB,5.3403 - BFD_RELOC_IA64_PCREL21B,5.3404 - BFD_RELOC_IA64_PCREL21BI,5.3405 - BFD_RELOC_IA64_PCREL21M,5.3406 - BFD_RELOC_IA64_PCREL21F,5.3407 - BFD_RELOC_IA64_PCREL22,5.3408 - BFD_RELOC_IA64_PCREL60B,5.3409 - BFD_RELOC_IA64_PCREL64I,5.3410 - BFD_RELOC_IA64_PCREL32MSB,5.3411 - BFD_RELOC_IA64_PCREL32LSB,5.3412 - BFD_RELOC_IA64_PCREL64MSB,5.3413 - BFD_RELOC_IA64_PCREL64LSB,5.3414 - BFD_RELOC_IA64_LTOFF_FPTR22,5.3415 - BFD_RELOC_IA64_LTOFF_FPTR64I,5.3416 - BFD_RELOC_IA64_LTOFF_FPTR32MSB,5.3417 - BFD_RELOC_IA64_LTOFF_FPTR32LSB,5.3418 - BFD_RELOC_IA64_LTOFF_FPTR64MSB,5.3419 - BFD_RELOC_IA64_LTOFF_FPTR64LSB,5.3420 - BFD_RELOC_IA64_SEGREL32MSB,5.3421 - BFD_RELOC_IA64_SEGREL32LSB,5.3422 - BFD_RELOC_IA64_SEGREL64MSB,5.3423 - BFD_RELOC_IA64_SEGREL64LSB,5.3424 - BFD_RELOC_IA64_SECREL32MSB,5.3425 - BFD_RELOC_IA64_SECREL32LSB,5.3426 - BFD_RELOC_IA64_SECREL64MSB,5.3427 - BFD_RELOC_IA64_SECREL64LSB,5.3428 - BFD_RELOC_IA64_REL32MSB,5.3429 - BFD_RELOC_IA64_REL32LSB,5.3430 - BFD_RELOC_IA64_REL64MSB,5.3431 - BFD_RELOC_IA64_REL64LSB,5.3432 - BFD_RELOC_IA64_LTV32MSB,5.3433 - BFD_RELOC_IA64_LTV32LSB,5.3434 - BFD_RELOC_IA64_LTV64MSB,5.3435 - BFD_RELOC_IA64_LTV64LSB,5.3436 - BFD_RELOC_IA64_IPLTMSB,5.3437 - BFD_RELOC_IA64_IPLTLSB,5.3438 - BFD_RELOC_IA64_COPY,5.3439 - BFD_RELOC_IA64_LTOFF22X,5.3440 - BFD_RELOC_IA64_LDXMOV,5.3441 - BFD_RELOC_IA64_TPREL14,5.3442 - BFD_RELOC_IA64_TPREL22,5.3443 - BFD_RELOC_IA64_TPREL64I,5.3444 - BFD_RELOC_IA64_TPREL64MSB,5.3445 - BFD_RELOC_IA64_TPREL64LSB,5.3446 - BFD_RELOC_IA64_LTOFF_TPREL22,5.3447 - BFD_RELOC_IA64_DTPMOD64MSB,5.3448 - BFD_RELOC_IA64_DTPMOD64LSB,5.3449 - BFD_RELOC_IA64_LTOFF_DTPMOD22,5.3450 - BFD_RELOC_IA64_DTPREL14,5.3451 - BFD_RELOC_IA64_DTPREL22,5.3452 - BFD_RELOC_IA64_DTPREL64I,5.3453 - BFD_RELOC_IA64_DTPREL32MSB,5.3454 - BFD_RELOC_IA64_DTPREL32LSB,5.3455 - BFD_RELOC_IA64_DTPREL64MSB,5.3456 - BFD_RELOC_IA64_DTPREL64LSB,5.3457 - BFD_RELOC_IA64_LTOFF_DTPREL22,5.3458 -5.3459 -/* Motorola 68HC11 reloc.5.3460 -This is the 8 bit high part of an absolute address. */5.3461 - BFD_RELOC_M68HC11_HI8,5.3462 -5.3463 -/* Motorola 68HC11 reloc.5.3464 -This is the 8 bit low part of an absolute address. */5.3465 - BFD_RELOC_M68HC11_LO8,5.3466 -5.3467 -/* Motorola 68HC11 reloc.5.3468 -This is the 3 bit of a value. */5.3469 - BFD_RELOC_M68HC11_3B,5.3470 -5.3471 -/* Motorola 68HC11 reloc.5.3472 -This reloc marks the beginning of a jump/call instruction.5.3473 -It is used for linker relaxation to correctly identify beginning5.3474 -of instruction and change some branches to use PC-relative5.3475 -addressing mode. */5.3476 - BFD_RELOC_M68HC11_RL_JUMP,5.3477 -5.3478 -/* Motorola 68HC11 reloc.5.3479 -This reloc marks a group of several instructions that gcc generates5.3480 -and for which the linker relaxation pass can modify and/or remove5.3481 -some of them. */5.3482 - BFD_RELOC_M68HC11_RL_GROUP,5.3483 -5.3484 -/* Motorola 68HC11 reloc.5.3485 -This is the 16-bit lower part of an address. It is used for 'call'5.3486 -instruction to specify the symbol address without any special5.3487 -transformation (due to memory bank window). */5.3488 - BFD_RELOC_M68HC11_LO16,5.3489 -5.3490 -/* Motorola 68HC11 reloc.5.3491 -This is a 8-bit reloc that specifies the page number of an address.5.3492 -It is used by 'call' instruction to specify the page number of5.3493 -the symbol. */5.3494 - BFD_RELOC_M68HC11_PAGE,5.3495 -5.3496 -/* Motorola 68HC11 reloc.5.3497 -This is a 24-bit reloc that represents the address with a 16-bit5.3498 -value and a 8-bit page number. The symbol address is transformed5.3499 -to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */5.3500 - BFD_RELOC_M68HC11_24,5.3501 -5.3502 -/* Motorola 68HC12 reloc.5.3503 -This is the 5 bits of a value. */5.3504 - BFD_RELOC_M68HC12_5B,5.3505 -5.3506 -/* NS CR16C Relocations. */5.3507 - BFD_RELOC_16C_NUM08,5.3508 - BFD_RELOC_16C_NUM08_C,5.3509 - BFD_RELOC_16C_NUM16,5.3510 - BFD_RELOC_16C_NUM16_C,5.3511 - BFD_RELOC_16C_NUM32,5.3512 - BFD_RELOC_16C_NUM32_C,5.3513 - BFD_RELOC_16C_DISP04,5.3514 - BFD_RELOC_16C_DISP04_C,5.3515 - BFD_RELOC_16C_DISP08,5.3516 - BFD_RELOC_16C_DISP08_C,5.3517 - BFD_RELOC_16C_DISP16,5.3518 - BFD_RELOC_16C_DISP16_C,5.3519 - BFD_RELOC_16C_DISP24,5.3520 - BFD_RELOC_16C_DISP24_C,5.3521 - BFD_RELOC_16C_DISP24a,5.3522 - BFD_RELOC_16C_DISP24a_C,5.3523 - BFD_RELOC_16C_REG04,5.3524 - BFD_RELOC_16C_REG04_C,5.3525 - BFD_RELOC_16C_REG04a,5.3526 - BFD_RELOC_16C_REG04a_C,5.3527 - BFD_RELOC_16C_REG14,5.3528 - BFD_RELOC_16C_REG14_C,5.3529 - BFD_RELOC_16C_REG16,5.3530 - BFD_RELOC_16C_REG16_C,5.3531 - BFD_RELOC_16C_REG20,5.3532 - BFD_RELOC_16C_REG20_C,5.3533 - BFD_RELOC_16C_ABS20,5.3534 - BFD_RELOC_16C_ABS20_C,5.3535 - BFD_RELOC_16C_ABS24,5.3536 - BFD_RELOC_16C_ABS24_C,5.3537 - BFD_RELOC_16C_IMM04,5.3538 - BFD_RELOC_16C_IMM04_C,5.3539 - BFD_RELOC_16C_IMM16,5.3540 - BFD_RELOC_16C_IMM16_C,5.3541 - BFD_RELOC_16C_IMM20,5.3542 - BFD_RELOC_16C_IMM20_C,5.3543 - BFD_RELOC_16C_IMM24,5.3544 - BFD_RELOC_16C_IMM24_C,5.3545 - BFD_RELOC_16C_IMM32,5.3546 - BFD_RELOC_16C_IMM32_C,5.3547 -5.3548 -/* NS CRX Relocations. */5.3549 - BFD_RELOC_CRX_REL4,5.3550 - BFD_RELOC_CRX_REL8,5.3551 - BFD_RELOC_CRX_REL8_CMP,5.3552 - BFD_RELOC_CRX_REL16,5.3553 - BFD_RELOC_CRX_REL24,5.3554 - BFD_RELOC_CRX_REL32,5.3555 - BFD_RELOC_CRX_REGREL12,5.3556 - BFD_RELOC_CRX_REGREL22,5.3557 - BFD_RELOC_CRX_REGREL28,5.3558 - BFD_RELOC_CRX_REGREL32,5.3559 - BFD_RELOC_CRX_ABS16,5.3560 - BFD_RELOC_CRX_ABS32,5.3561 - BFD_RELOC_CRX_NUM8,5.3562 - BFD_RELOC_CRX_NUM16,5.3563 - BFD_RELOC_CRX_NUM32,5.3564 - BFD_RELOC_CRX_IMM16,5.3565 - BFD_RELOC_CRX_IMM32,5.3566 - BFD_RELOC_CRX_SWITCH8,5.3567 - BFD_RELOC_CRX_SWITCH16,5.3568 - BFD_RELOC_CRX_SWITCH32,5.3569 -5.3570 -/* These relocs are only used within the CRIS assembler. They are not5.3571 -(at present) written to any object files. */5.3572 - BFD_RELOC_CRIS_BDISP8,5.3573 - BFD_RELOC_CRIS_UNSIGNED_5,5.3574 - BFD_RELOC_CRIS_SIGNED_6,5.3575 - BFD_RELOC_CRIS_UNSIGNED_6,5.3576 - BFD_RELOC_CRIS_SIGNED_8,5.3577 - BFD_RELOC_CRIS_UNSIGNED_8,5.3578 - BFD_RELOC_CRIS_SIGNED_16,5.3579 - BFD_RELOC_CRIS_UNSIGNED_16,5.3580 - BFD_RELOC_CRIS_LAPCQ_OFFSET,5.3581 - BFD_RELOC_CRIS_UNSIGNED_4,5.3582 -5.3583 -/* Relocs used in ELF shared libraries for CRIS. */5.3584 - BFD_RELOC_CRIS_COPY,5.3585 - BFD_RELOC_CRIS_GLOB_DAT,5.3586 - BFD_RELOC_CRIS_JUMP_SLOT,5.3587 - BFD_RELOC_CRIS_RELATIVE,5.3588 -5.3589 -/* 32-bit offset to symbol-entry within GOT. */5.3590 - BFD_RELOC_CRIS_32_GOT,5.3591 -5.3592 -/* 16-bit offset to symbol-entry within GOT. */5.3593 - BFD_RELOC_CRIS_16_GOT,5.3594 -5.3595 -/* 32-bit offset to symbol-entry within GOT, with PLT handling. */5.3596 - BFD_RELOC_CRIS_32_GOTPLT,5.3597 -5.3598 -/* 16-bit offset to symbol-entry within GOT, with PLT handling. */5.3599 - BFD_RELOC_CRIS_16_GOTPLT,5.3600 -5.3601 -/* 32-bit offset to symbol, relative to GOT. */5.3602 - BFD_RELOC_CRIS_32_GOTREL,5.3603 -5.3604 -/* 32-bit offset to symbol with PLT entry, relative to GOT. */5.3605 - BFD_RELOC_CRIS_32_PLT_GOTREL,5.3606 -5.3607 -/* 32-bit offset to symbol with PLT entry, relative to this relocation. */5.3608 - BFD_RELOC_CRIS_32_PLT_PCREL,5.3609 -5.3610 -/* Intel i860 Relocations. */5.3611 - BFD_RELOC_860_COPY,5.3612 - BFD_RELOC_860_GLOB_DAT,5.3613 - BFD_RELOC_860_JUMP_SLOT,5.3614 - BFD_RELOC_860_RELATIVE,5.3615 - BFD_RELOC_860_PC26,5.3616 - BFD_RELOC_860_PLT26,5.3617 - BFD_RELOC_860_PC16,5.3618 - BFD_RELOC_860_LOW0,5.3619 - BFD_RELOC_860_SPLIT0,5.3620 - BFD_RELOC_860_LOW1,5.3621 - BFD_RELOC_860_SPLIT1,5.3622 - BFD_RELOC_860_LOW2,5.3623 - BFD_RELOC_860_SPLIT2,5.3624 - BFD_RELOC_860_LOW3,5.3625 - BFD_RELOC_860_LOGOT0,5.3626 - BFD_RELOC_860_SPGOT0,5.3627 - BFD_RELOC_860_LOGOT1,5.3628 - BFD_RELOC_860_SPGOT1,5.3629 - BFD_RELOC_860_LOGOTOFF0,5.3630 - BFD_RELOC_860_SPGOTOFF0,5.3631 - BFD_RELOC_860_LOGOTOFF1,5.3632 - BFD_RELOC_860_SPGOTOFF1,5.3633 - BFD_RELOC_860_LOGOTOFF2,5.3634 - BFD_RELOC_860_LOGOTOFF3,5.3635 - BFD_RELOC_860_LOPC,5.3636 - BFD_RELOC_860_HIGHADJ,5.3637 - BFD_RELOC_860_HAGOT,5.3638 - BFD_RELOC_860_HAGOTOFF,5.3639 - BFD_RELOC_860_HAPC,5.3640 - BFD_RELOC_860_HIGH,5.3641 - BFD_RELOC_860_HIGOT,5.3642 - BFD_RELOC_860_HIGOTOFF,5.3643 -5.3644 -/* OpenRISC Relocations. */5.3645 - BFD_RELOC_OPENRISC_ABS_26,5.3646 - BFD_RELOC_OPENRISC_REL_26,5.3647 -5.3648 -/* H8 elf Relocations. */5.3649 - BFD_RELOC_H8_DIR16A8,5.3650 - BFD_RELOC_H8_DIR16R8,5.3651 - BFD_RELOC_H8_DIR24A8,5.3652 - BFD_RELOC_H8_DIR24R8,5.3653 - BFD_RELOC_H8_DIR32A16,5.3654 -5.3655 -/* Sony Xstormy16 Relocations. */5.3656 - BFD_RELOC_XSTORMY16_REL_12,5.3657 - BFD_RELOC_XSTORMY16_12,5.3658 - BFD_RELOC_XSTORMY16_24,5.3659 - BFD_RELOC_XSTORMY16_FPTR16,5.3660 -5.3661 -/* Relocations used by VAX ELF. */5.3662 - BFD_RELOC_VAX_GLOB_DAT,5.3663 - BFD_RELOC_VAX_JMP_SLOT,5.3664 - BFD_RELOC_VAX_RELATIVE,5.3665 -5.3666 -/* msp430 specific relocation codes */5.3667 - BFD_RELOC_MSP430_10_PCREL,5.3668 - BFD_RELOC_MSP430_16_PCREL,5.3669 - BFD_RELOC_MSP430_16,5.3670 - BFD_RELOC_MSP430_16_PCREL_BYTE,5.3671 - BFD_RELOC_MSP430_16_BYTE,5.3672 - BFD_RELOC_MSP430_2X_PCREL,5.3673 - BFD_RELOC_MSP430_RL_PCREL,5.3674 -5.3675 -/* IQ2000 Relocations. */5.3676 - BFD_RELOC_IQ2000_OFFSET_16,5.3677 - BFD_RELOC_IQ2000_OFFSET_21,5.3678 - BFD_RELOC_IQ2000_UHI16,5.3679 -5.3680 -/* Special Xtensa relocation used only by PLT entries in ELF shared5.3681 -objects to indicate that the runtime linker should set the value5.3682 -to one of its own internal functions or data structures. */5.3683 - BFD_RELOC_XTENSA_RTLD,5.3684 -5.3685 -/* Xtensa relocations for ELF shared objects. */5.3686 - BFD_RELOC_XTENSA_GLOB_DAT,5.3687 - BFD_RELOC_XTENSA_JMP_SLOT,5.3688 - BFD_RELOC_XTENSA_RELATIVE,5.3689 -5.3690 -/* Xtensa relocation used in ELF object files for symbols that may require5.3691 -PLT entries. Otherwise, this is just a generic 32-bit relocation. */5.3692 - BFD_RELOC_XTENSA_PLT,5.3693 -5.3694 -/* Xtensa relocations to mark the difference of two local symbols.5.3695 -These are only needed to support linker relaxation and can be ignored5.3696 -when not relaxing. The field is set to the value of the difference5.3697 -assuming no relaxation. The relocation encodes the position of the5.3698 -first symbol so the linker can determine whether to adjust the field5.3699 -value. */5.3700 - BFD_RELOC_XTENSA_DIFF8,5.3701 - BFD_RELOC_XTENSA_DIFF16,5.3702 - BFD_RELOC_XTENSA_DIFF32,5.3703 -5.3704 -/* Generic Xtensa relocations for instruction operands. Only the slot5.3705 -number is encoded in the relocation. The relocation applies to the5.3706 -last PC-relative immediate operand, or if there are no PC-relative5.3707 -immediates, to the last immediate operand. */5.3708 - BFD_RELOC_XTENSA_SLOT0_OP,5.3709 - BFD_RELOC_XTENSA_SLOT1_OP,5.3710 - BFD_RELOC_XTENSA_SLOT2_OP,5.3711 - BFD_RELOC_XTENSA_SLOT3_OP,5.3712 - BFD_RELOC_XTENSA_SLOT4_OP,5.3713 - BFD_RELOC_XTENSA_SLOT5_OP,5.3714 - BFD_RELOC_XTENSA_SLOT6_OP,5.3715 - BFD_RELOC_XTENSA_SLOT7_OP,5.3716 - BFD_RELOC_XTENSA_SLOT8_OP,5.3717 - BFD_RELOC_XTENSA_SLOT9_OP,5.3718 - BFD_RELOC_XTENSA_SLOT10_OP,5.3719 - BFD_RELOC_XTENSA_SLOT11_OP,5.3720 - BFD_RELOC_XTENSA_SLOT12_OP,5.3721 - BFD_RELOC_XTENSA_SLOT13_OP,5.3722 - BFD_RELOC_XTENSA_SLOT14_OP,5.3723 -5.3724 -/* Alternate Xtensa relocations. Only the slot is encoded in the5.3725 -relocation. The meaning of these relocations is opcode-specific. */5.3726 - BFD_RELOC_XTENSA_SLOT0_ALT,5.3727 - BFD_RELOC_XTENSA_SLOT1_ALT,5.3728 - BFD_RELOC_XTENSA_SLOT2_ALT,5.3729 - BFD_RELOC_XTENSA_SLOT3_ALT,5.3730 - BFD_RELOC_XTENSA_SLOT4_ALT,5.3731 - BFD_RELOC_XTENSA_SLOT5_ALT,5.3732 - BFD_RELOC_XTENSA_SLOT6_ALT,5.3733 - BFD_RELOC_XTENSA_SLOT7_ALT,5.3734 - BFD_RELOC_XTENSA_SLOT8_ALT,5.3735 - BFD_RELOC_XTENSA_SLOT9_ALT,5.3736 - BFD_RELOC_XTENSA_SLOT10_ALT,5.3737 - BFD_RELOC_XTENSA_SLOT11_ALT,5.3738 - BFD_RELOC_XTENSA_SLOT12_ALT,5.3739 - BFD_RELOC_XTENSA_SLOT13_ALT,5.3740 - BFD_RELOC_XTENSA_SLOT14_ALT,5.3741 -5.3742 -/* Xtensa relocations for backward compatibility. These have all been5.3743 -replaced by BFD_RELOC_XTENSA_SLOT0_OP. */5.3744 - BFD_RELOC_XTENSA_OP0,5.3745 - BFD_RELOC_XTENSA_OP1,5.3746 - BFD_RELOC_XTENSA_OP2,5.3747 -5.3748 -/* Xtensa relocation to mark that the assembler expanded the5.3749 -instructions from an original target. The expansion size is5.3750 -encoded in the reloc size. */5.3751 - BFD_RELOC_XTENSA_ASM_EXPAND,5.3752 -5.3753 -/* Xtensa relocation to mark that the linker should simplify5.3754 -assembler-expanded instructions. This is commonly used5.3755 -internally by the linker after analysis of a5.3756 -BFD_RELOC_XTENSA_ASM_EXPAND. */5.3757 - BFD_RELOC_XTENSA_ASM_SIMPLIFY,5.3758 - BFD_RELOC_UNUSED };5.3759 -typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;5.3760 -reloc_howto_type *bfd_reloc_type_lookup5.3761 - (bfd *abfd, bfd_reloc_code_real_type code);5.3762 -5.3763 -const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);5.3764 -5.3765 -/* Extracted from syms.c. */5.3766 -5.3767 -typedef struct bfd_symbol5.3768 -{5.3769 - /* A pointer to the BFD which owns the symbol. This information5.3770 - is necessary so that a back end can work out what additional5.3771 - information (invisible to the application writer) is carried5.3772 - with the symbol.5.3773 -5.3774 - This field is *almost* redundant, since you can use section->owner5.3775 - instead, except that some symbols point to the global sections5.3776 - bfd_{abs,com,und}_section. This could be fixed by making5.3777 - these globals be per-bfd (or per-target-flavor). FIXME. */5.3778 - struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */5.3779 -5.3780 - /* The text of the symbol. The name is left alone, and not copied; the5.3781 - application may not alter it. */5.3782 - const char *name;5.3783 -5.3784 - /* The value of the symbol. This really should be a union of a5.3785 - numeric value with a pointer, since some flags indicate that5.3786 - a pointer to another symbol is stored here. */5.3787 - symvalue value;5.3788 -5.3789 - /* Attributes of a symbol. */5.3790 -#define BSF_NO_FLAGS 0x005.3791 -5.3792 - /* The symbol has local scope; <<static>> in <<C>>. The value5.3793 - is the offset into the section of the data. */5.3794 -#define BSF_LOCAL 0x015.3795 -5.3796 - /* The symbol has global scope; initialized data in <<C>>. The5.3797 - value is the offset into the section of the data. */5.3798 -#define BSF_GLOBAL 0x025.3799 -5.3800 - /* The symbol has global scope and is exported. The value is5.3801 - the offset into the section of the data. */5.3802 -#define BSF_EXPORT BSF_GLOBAL /* No real difference. */5.3803 -5.3804 - /* A normal C symbol would be one of:5.3805 - <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or5.3806 - <<BSF_GLOBAL>>. */5.3807 -5.3808 - /* The symbol is a debugging record. The value has an arbitrary5.3809 - meaning, unless BSF_DEBUGGING_RELOC is also set. */5.3810 -#define BSF_DEBUGGING 0x085.3811 -5.3812 - /* The symbol denotes a function entry point. Used in ELF,5.3813 - perhaps others someday. */5.3814 -#define BSF_FUNCTION 0x105.3815 -5.3816 - /* Used by the linker. */5.3817 -#define BSF_KEEP 0x205.3818 -#define BSF_KEEP_G 0x405.3819 -5.3820 - /* A weak global symbol, overridable without warnings by5.3821 - a regular global symbol of the same name. */5.3822 -#define BSF_WEAK 0x805.3823 -5.3824 - /* This symbol was created to point to a section, e.g. ELF's5.3825 - STT_SECTION symbols. */5.3826 -#define BSF_SECTION_SYM 0x1005.3827 -5.3828 - /* The symbol used to be a common symbol, but now it is5.3829 - allocated. */5.3830 -#define BSF_OLD_COMMON 0x2005.3831 -5.3832 - /* The default value for common data. */5.3833 -#define BFD_FORT_COMM_DEFAULT_VALUE 05.3834 -5.3835 - /* In some files the type of a symbol sometimes alters its5.3836 - location in an output file - ie in coff a <<ISFCN>> symbol5.3837 - which is also <<C_EXT>> symbol appears where it was5.3838 - declared and not at the end of a section. This bit is set5.3839 - by the target BFD part to convey this information. */5.3840 -#define BSF_NOT_AT_END 0x4005.3841 -5.3842 - /* Signal that the symbol is the label of constructor section. */5.3843 -#define BSF_CONSTRUCTOR 0x8005.3844 -5.3845 - /* Signal that the symbol is a warning symbol. The name is a5.3846 - warning. The name of the next symbol is the one to warn about;5.3847 - if a reference is made to a symbol with the same name as the next5.3848 - symbol, a warning is issued by the linker. */5.3849 -#define BSF_WARNING 0x10005.3850 -5.3851 - /* Signal that the symbol is indirect. This symbol is an indirect5.3852 - pointer to the symbol with the same name as the next symbol. */5.3853 -#define BSF_INDIRECT 0x20005.3854 -5.3855 - /* BSF_FILE marks symbols that contain a file name. This is used5.3856 - for ELF STT_FILE symbols. */5.3857 -#define BSF_FILE 0x40005.3858 -5.3859 - /* Symbol is from dynamic linking information. */5.3860 -#define BSF_DYNAMIC 0x80005.3861 -5.3862 - /* The symbol denotes a data object. Used in ELF, and perhaps5.3863 - others someday. */5.3864 -#define BSF_OBJECT 0x100005.3865 -5.3866 - /* This symbol is a debugging symbol. The value is the offset5.3867 - into the section of the data. BSF_DEBUGGING should be set5.3868 - as well. */5.3869 -#define BSF_DEBUGGING_RELOC 0x200005.3870 -5.3871 - /* This symbol is thread local. Used in ELF. */5.3872 -#define BSF_THREAD_LOCAL 0x400005.3873 -5.3874 - flagword flags;5.3875 -5.3876 - /* A pointer to the section to which this symbol is5.3877 - relative. This will always be non NULL, there are special5.3878 - sections for undefined and absolute symbols. */5.3879 - struct bfd_section *section;5.3880 -5.3881 - /* Back end special data. */5.3882 - union5.3883 - {5.3884 - void *p;5.3885 - bfd_vma i;5.3886 - }5.3887 - udata;5.3888 -}5.3889 -asymbol;5.3890 -5.3891 -#define bfd_get_symtab_upper_bound(abfd) \5.3892 - BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))5.3893 -5.3894 -bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);5.3895 -5.3896 -bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);5.3897 -5.3898 -#define bfd_is_local_label_name(abfd, name) \5.3899 - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))5.3900 -5.3901 -bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);5.3902 -5.3903 -#define bfd_is_target_special_symbol(abfd, sym) \5.3904 - BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))5.3905 -5.3906 -#define bfd_canonicalize_symtab(abfd, location) \5.3907 - BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))5.3908 -5.3909 -bfd_boolean bfd_set_symtab5.3910 - (bfd *abfd, asymbol **location, unsigned int count);5.3911 -5.3912 -void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);5.3913 -5.3914 -#define bfd_make_empty_symbol(abfd) \5.3915 - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))5.3916 -5.3917 -asymbol *_bfd_generic_make_empty_symbol (bfd *);5.3918 -5.3919 -#define bfd_make_debug_symbol(abfd,ptr,size) \5.3920 - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))5.3921 -5.3922 -int bfd_decode_symclass (asymbol *symbol);5.3923 -5.3924 -bfd_boolean bfd_is_undefined_symclass (int symclass);5.3925 -5.3926 -void bfd_symbol_info (asymbol *symbol, symbol_info *ret);5.3927 -5.3928 -bfd_boolean bfd_copy_private_symbol_data5.3929 - (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);5.3930 -5.3931 -#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \5.3932 - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \5.3933 - (ibfd, isymbol, obfd, osymbol))5.3934 -5.3935 -/* Extracted from bfd.c. */5.3936 -struct bfd5.3937 -{5.3938 - /* A unique identifier of the BFD */5.3939 - unsigned int id;5.3940 -5.3941 - /* The filename the application opened the BFD with. */5.3942 - const char *filename;5.3943 -5.3944 - /* A pointer to the target jump table. */5.3945 - const struct bfd_target *xvec;5.3946 -5.3947 - /* The IOSTREAM, and corresponding IO vector that provide access5.3948 - to the file backing the BFD. */5.3949 - void *iostream;5.3950 - const struct bfd_iovec *iovec;5.3951 -5.3952 - /* Is the file descriptor being cached? That is, can it be closed as5.3953 - needed, and re-opened when accessed later? */5.3954 - bfd_boolean cacheable;5.3955 -5.3956 - /* Marks whether there was a default target specified when the5.3957 - BFD was opened. This is used to select which matching algorithm5.3958 - to use to choose the back end. */5.3959 - bfd_boolean target_defaulted;5.3960 -5.3961 - /* The caching routines use these to maintain a5.3962 - least-recently-used list of BFDs. */5.3963 - struct bfd *lru_prev, *lru_next;5.3964 -5.3965 - /* When a file is closed by the caching routines, BFD retains5.3966 - state information on the file here... */5.3967 - ufile_ptr where;5.3968 -5.3969 - /* ... and here: (``once'' means at least once). */5.3970 - bfd_boolean opened_once;5.3971 -5.3972 - /* Set if we have a locally maintained mtime value, rather than5.3973 - getting it from the file each time. */5.3974 - bfd_boolean mtime_set;5.3975 -5.3976 - /* File modified time, if mtime_set is TRUE. */5.3977 - long mtime;5.3978 -5.3979 - /* Reserved for an unimplemented file locking extension. */5.3980 - int ifd;5.3981 -5.3982 - /* The format which belongs to the BFD. (object, core, etc.) */5.3983 - bfd_format format;5.3984 -5.3985 - /* The direction with which the BFD was opened. */5.3986 - enum bfd_direction5.3987 - {5.3988 - no_direction = 0,5.3989 - read_direction = 1,5.3990 - write_direction = 2,5.3991 - both_direction = 35.3992 - }5.3993 - direction;5.3994 -5.3995 - /* Format_specific flags. */5.3996 - flagword flags;5.3997 -5.3998 - /* Currently my_archive is tested before adding origin to5.3999 - anything. I believe that this can become always an add of5.4000 - origin, with origin set to 0 for non archive files. */5.4001 - ufile_ptr origin;5.4002 -5.4003 - /* Remember when output has begun, to stop strange things5.4004 - from happening. */5.4005 - bfd_boolean output_has_begun;5.4006 -5.4007 - /* A hash table for section names. */5.4008 - struct bfd_hash_table section_htab;5.4009 -5.4010 - /* Pointer to linked list of sections. */5.4011 - struct bfd_section *sections;5.4012 -5.4013 - /* The place where we add to the section list. */5.4014 - struct bfd_section **section_tail;5.4015 -5.4016 - /* The number of sections. */5.4017 - unsigned int section_count;5.4018 -5.4019 - /* Stuff only useful for object files:5.4020 - The start address. */5.4021 - bfd_vma start_address;5.4022 -5.4023 - /* Used for input and output. */5.4024 - unsigned int symcount;5.4025 -5.4026 - /* Symbol table for output BFD (with symcount entries). */5.4027 - struct bfd_symbol **outsymbols;5.4028 -5.4029 - /* Used for slurped dynamic symbol tables. */5.4030 - unsigned int dynsymcount;5.4031 -5.4032 - /* Pointer to structure which contains architecture information. */5.4033 - const struct bfd_arch_info *arch_info;5.4034 -5.4035 - /* Flag set if symbols from this BFD should not be exported. */5.4036 - bfd_boolean no_export;5.4037 -5.4038 - /* Stuff only useful for archives. */5.4039 - void *arelt_data;5.4040 - struct bfd *my_archive; /* The containing archive BFD. */5.4041 - struct bfd *next; /* The next BFD in the archive. */5.4042 - struct bfd *archive_head; /* The first BFD in the archive. */5.4043 - bfd_boolean has_armap;5.4044 -5.4045 - /* A chain of BFD structures involved in a link. */5.4046 - struct bfd *link_next;5.4047 -5.4048 - /* A field used by _bfd_generic_link_add_archive_symbols. This will5.4049 - be used only for archive elements. */5.4050 - int archive_pass;5.4051 -5.4052 - /* Used by the back end to hold private data. */5.4053 - union5.4054 - {5.4055 - struct aout_data_struct *aout_data;5.4056 - struct artdata *aout_ar_data;5.4057 - struct _oasys_data *oasys_obj_data;5.4058 - struct _oasys_ar_data *oasys_ar_data;5.4059 - struct coff_tdata *coff_obj_data;5.4060 - struct pe_tdata *pe_obj_data;5.4061 - struct xcoff_tdata *xcoff_obj_data;5.4062 - struct ecoff_tdata *ecoff_obj_data;5.4063 - struct ieee_data_struct *ieee_data;5.4064 - struct ieee_ar_data_struct *ieee_ar_data;5.4065 - struct srec_data_struct *srec_data;5.4066 - struct ihex_data_struct *ihex_data;5.4067 - struct tekhex_data_struct *tekhex_data;5.4068 - struct elf_obj_tdata *elf_obj_data;5.4069 - struct nlm_obj_tdata *nlm_obj_data;5.4070 - struct bout_data_struct *bout_data;5.4071 - struct mmo_data_struct *mmo_data;5.4072 - struct sun_core_struct *sun_core_data;5.4073 - struct sco5_core_struct *sco5_core_data;5.4074 - struct trad_core_struct *trad_core_data;5.4075 - struct som_data_struct *som_data;5.4076 - struct hpux_core_struct *hpux_core_data;5.4077 - struct hppabsd_core_struct *hppabsd_core_data;5.4078 - struct sgi_core_struct *sgi_core_data;5.4079 - struct lynx_core_struct *lynx_core_data;5.4080 - struct osf_core_struct *osf_core_data;5.4081 - struct cisco_core_struct *cisco_core_data;5.4082 - struct versados_data_struct *versados_data;5.4083 - struct netbsd_core_struct *netbsd_core_data;5.4084 - struct mach_o_data_struct *mach_o_data;5.4085 - struct mach_o_fat_data_struct *mach_o_fat_data;5.4086 - struct bfd_pef_data_struct *pef_data;5.4087 - struct bfd_pef_xlib_data_struct *pef_xlib_data;5.4088 - struct bfd_sym_data_struct *sym_data;5.4089 - void *any;5.4090 - }5.4091 - tdata;5.4092 -5.4093 - /* Used by the application to hold private data. */5.4094 - void *usrdata;5.4095 -5.4096 - /* Where all the allocated stuff under this BFD goes. This is a5.4097 - struct objalloc *, but we use void * to avoid requiring the inclusion5.4098 - of objalloc.h. */5.4099 - void *memory;5.4100 -};5.4101 -5.4102 -typedef enum bfd_error5.4103 -{5.4104 - bfd_error_no_error = 0,5.4105 - bfd_error_system_call,5.4106 - bfd_error_invalid_target,5.4107 - bfd_error_wrong_format,5.4108 - bfd_error_wrong_object_format,5.4109 - bfd_error_invalid_operation,5.4110 - bfd_error_no_memory,5.4111 - bfd_error_no_symbols,5.4112 - bfd_error_no_armap,5.4113 - bfd_error_no_more_archived_files,5.4114 - bfd_error_malformed_archive,5.4115 - bfd_error_file_not_recognized,5.4116 - bfd_error_file_ambiguously_recognized,5.4117 - bfd_error_no_contents,5.4118 - bfd_error_nonrepresentable_section,5.4119 - bfd_error_no_debug_section,5.4120 - bfd_error_bad_value,5.4121 - bfd_error_file_truncated,5.4122 - bfd_error_file_too_big,5.4123 - bfd_error_invalid_error_code5.4124 -}5.4125 -bfd_error_type;5.4126 -5.4127 -bfd_error_type bfd_get_error (void);5.4128 -5.4129 -void bfd_set_error (bfd_error_type error_tag);5.4130 -5.4131 -const char *bfd_errmsg (bfd_error_type error_tag);5.4132 -5.4133 -void bfd_perror (const char *message);5.4134 -5.4135 -typedef void (*bfd_error_handler_type) (const char *, ...);5.4136 -5.4137 -bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);5.4138 -5.4139 -void bfd_set_error_program_name (const char *);5.4140 -5.4141 -bfd_error_handler_type bfd_get_error_handler (void);5.4142 -5.4143 -long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);5.4144 -5.4145 -long bfd_canonicalize_reloc5.4146 - (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);5.4147 -5.4148 -void bfd_set_reloc5.4149 - (bfd *abfd, asection *sec, arelent **rel, unsigned int count);5.4150 -5.4151 -bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);5.4152 -5.4153 -int bfd_get_arch_size (bfd *abfd);5.4154 -5.4155 -int bfd_get_sign_extend_vma (bfd *abfd);5.4156 -5.4157 -bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);5.4158 -5.4159 -unsigned int bfd_get_gp_size (bfd *abfd);5.4160 -5.4161 -void bfd_set_gp_size (bfd *abfd, unsigned int i);5.4162 -5.4163 -bfd_vma bfd_scan_vma (const char *string, const char **end, int base);5.4164 -5.4165 -bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);5.4166 -5.4167 -#define bfd_copy_private_header_data(ibfd, obfd) \5.4168 - BFD_SEND (obfd, _bfd_copy_private_header_data, \5.4169 - (ibfd, obfd))5.4170 -bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);5.4171 -5.4172 -#define bfd_copy_private_bfd_data(ibfd, obfd) \5.4173 - BFD_SEND (obfd, _bfd_copy_private_bfd_data, \5.4174 - (ibfd, obfd))5.4175 -bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);5.4176 -5.4177 -#define bfd_merge_private_bfd_data(ibfd, obfd) \5.4178 - BFD_SEND (obfd, _bfd_merge_private_bfd_data, \5.4179 - (ibfd, obfd))5.4180 -bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);5.4181 -5.4182 -#define bfd_set_private_flags(abfd, flags) \5.4183 - BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))5.4184 -#define bfd_sizeof_headers(abfd, reloc) \5.4185 - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))5.4186 -5.4187 -#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \5.4188 - BFD_SEND (abfd, _bfd_find_nearest_line, \5.4189 - (abfd, sec, syms, off, file, func, line))5.4190 -5.4191 -#define bfd_debug_info_start(abfd) \5.4192 - BFD_SEND (abfd, _bfd_debug_info_start, (abfd))5.4193 -5.4194 -#define bfd_debug_info_end(abfd) \5.4195 - BFD_SEND (abfd, _bfd_debug_info_end, (abfd))5.4196 -5.4197 -#define bfd_debug_info_accumulate(abfd, section) \5.4198 - BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))5.4199 -5.4200 -#define bfd_stat_arch_elt(abfd, stat) \5.4201 - BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))5.4202 -5.4203 -#define bfd_update_armap_timestamp(abfd) \5.4204 - BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))5.4205 -5.4206 -#define bfd_set_arch_mach(abfd, arch, mach)\5.4207 - BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))5.4208 -5.4209 -#define bfd_relax_section(abfd, section, link_info, again) \5.4210 - BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))5.4211 -5.4212 -#define bfd_gc_sections(abfd, link_info) \5.4213 - BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))5.4214 -5.4215 -#define bfd_merge_sections(abfd, link_info) \5.4216 - BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))5.4217 -5.4218 -#define bfd_is_group_section(abfd, sec) \5.4219 - BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))5.4220 -5.4221 -#define bfd_discard_group(abfd, sec) \5.4222 - BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))5.4223 -5.4224 -#define bfd_link_hash_table_create(abfd) \5.4225 - BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))5.4226 -5.4227 -#define bfd_link_hash_table_free(abfd, hash) \5.4228 - BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))5.4229 -5.4230 -#define bfd_link_add_symbols(abfd, info) \5.4231 - BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))5.4232 -5.4233 -#define bfd_link_just_syms(abfd, sec, info) \5.4234 - BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))5.4235 -5.4236 -#define bfd_final_link(abfd, info) \5.4237 - BFD_SEND (abfd, _bfd_final_link, (abfd, info))5.4238 -5.4239 -#define bfd_free_cached_info(abfd) \5.4240 - BFD_SEND (abfd, _bfd_free_cached_info, (abfd))5.4241 -5.4242 -#define bfd_get_dynamic_symtab_upper_bound(abfd) \5.4243 - BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))5.4244 -5.4245 -#define bfd_print_private_bfd_data(abfd, file)\5.4246 - BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))5.4247 -5.4248 -#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \5.4249 - BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))5.4250 -5.4251 -#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \5.4252 - BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \5.4253 - dyncount, dynsyms, ret))5.4254 -5.4255 -#define bfd_get_dynamic_reloc_upper_bound(abfd) \5.4256 - BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))5.4257 -5.4258 -#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \5.4259 - BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))5.4260 -5.4261 -extern bfd_byte *bfd_get_relocated_section_contents5.4262 - (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,5.4263 - bfd_boolean, asymbol **);5.4264 -5.4265 -bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);5.4266 -5.4267 -struct bfd_preserve5.4268 -{5.4269 - void *marker;5.4270 - void *tdata;5.4271 - flagword flags;5.4272 - const struct bfd_arch_info *arch_info;5.4273 - struct bfd_section *sections;5.4274 - struct bfd_section **section_tail;5.4275 - unsigned int section_count;5.4276 - struct bfd_hash_table section_htab;5.4277 -};5.4278 -5.4279 -bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);5.4280 -5.4281 -void bfd_preserve_restore (bfd *, struct bfd_preserve *);5.4282 -5.4283 -void bfd_preserve_finish (bfd *, struct bfd_preserve *);5.4284 -5.4285 -/* Extracted from archive.c. */5.4286 -symindex bfd_get_next_mapent5.4287 - (bfd *abfd, symindex previous, carsym **sym);5.4288 -5.4289 -bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);5.4290 -5.4291 -bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);5.4292 -5.4293 -/* Extracted from corefile.c. */5.4294 -const char *bfd_core_file_failing_command (bfd *abfd);5.4295 -5.4296 -int bfd_core_file_failing_signal (bfd *abfd);5.4297 -5.4298 -bfd_boolean core_file_matches_executable_p5.4299 - (bfd *core_bfd, bfd *exec_bfd);5.4300 -5.4301 -/* Extracted from targets.c. */5.4302 -#define BFD_SEND(bfd, message, arglist) \5.4303 - ((*((bfd)->xvec->message)) arglist)5.4304 -5.4305 -#ifdef DEBUG_BFD_SEND5.4306 -#undef BFD_SEND5.4307 -#define BFD_SEND(bfd, message, arglist) \5.4308 - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \5.4309 - ((*((bfd)->xvec->message)) arglist) : \5.4310 - (bfd_assert (__FILE__,__LINE__), NULL))5.4311 -#endif5.4312 -#define BFD_SEND_FMT(bfd, message, arglist) \5.4313 - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)5.4314 -5.4315 -#ifdef DEBUG_BFD_SEND5.4316 -#undef BFD_SEND_FMT5.4317 -#define BFD_SEND_FMT(bfd, message, arglist) \5.4318 - (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \5.4319 - (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \5.4320 - (bfd_assert (__FILE__,__LINE__), NULL))5.4321 -#endif5.4322 -5.4323 -enum bfd_flavour5.4324 -{5.4325 - bfd_target_unknown_flavour,5.4326 - bfd_target_aout_flavour,5.4327 - bfd_target_coff_flavour,5.4328 - bfd_target_ecoff_flavour,5.4329 - bfd_target_xcoff_flavour,5.4330 - bfd_target_elf_flavour,5.4331 - bfd_target_ieee_flavour,5.4332 - bfd_target_nlm_flavour,5.4333 - bfd_target_oasys_flavour,5.4334 - bfd_target_tekhex_flavour,5.4335 - bfd_target_srec_flavour,5.4336 - bfd_target_ihex_flavour,5.4337 - bfd_target_som_flavour,5.4338 - bfd_target_os9k_flavour,5.4339 - bfd_target_versados_flavour,5.4340 - bfd_target_msdos_flavour,5.4341 - bfd_target_ovax_flavour,5.4342 - bfd_target_evax_flavour,5.4343 - bfd_target_mmo_flavour,5.4344 - bfd_target_mach_o_flavour,5.4345 - bfd_target_pef_flavour,5.4346 - bfd_target_pef_xlib_flavour,5.4347 - bfd_target_sym_flavour5.4348 -};5.4349 -5.4350 -enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };5.4351 -5.4352 -/* Forward declaration. */5.4353 -typedef struct bfd_link_info _bfd_link_info;5.4354 -5.4355 -typedef struct bfd_target5.4356 -{5.4357 - /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */5.4358 - char *name;5.4359 -5.4360 - /* The "flavour" of a back end is a general indication about5.4361 - the contents of a file. */5.4362 - enum bfd_flavour flavour;5.4363 -5.4364 - /* The order of bytes within the data area of a file. */5.4365 - enum bfd_endian byteorder;5.4366 -5.4367 - /* The order of bytes within the header parts of a file. */5.4368 - enum bfd_endian header_byteorder;5.4369 -5.4370 - /* A mask of all the flags which an executable may have set -5.4371 - from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */5.4372 - flagword object_flags;5.4373 -5.4374 - /* A mask of all the flags which a section may have set - from5.4375 - the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */5.4376 - flagword section_flags;5.4377 -5.4378 - /* The character normally found at the front of a symbol.5.4379 - (if any), perhaps `_'. */5.4380 - char symbol_leading_char;5.4381 -5.4382 - /* The pad character for file names within an archive header. */5.4383 - char ar_pad_char;5.4384 -5.4385 - /* The maximum number of characters in an archive header. */5.4386 - unsigned short ar_max_namelen;5.4387 -5.4388 - /* Entries for byte swapping for data. These are different from the5.4389 - other entry points, since they don't take a BFD as the first argument.5.4390 - Certain other handlers could do the same. */5.4391 - bfd_uint64_t (*bfd_getx64) (const void *);5.4392 - bfd_int64_t (*bfd_getx_signed_64) (const void *);5.4393 - void (*bfd_putx64) (bfd_uint64_t, void *);5.4394 - bfd_vma (*bfd_getx32) (const void *);5.4395 - bfd_signed_vma (*bfd_getx_signed_32) (const void *);5.4396 - void (*bfd_putx32) (bfd_vma, void *);5.4397 - bfd_vma (*bfd_getx16) (const void *);5.4398 - bfd_signed_vma (*bfd_getx_signed_16) (const void *);5.4399 - void (*bfd_putx16) (bfd_vma, void *);5.4400 -5.4401 - /* Byte swapping for the headers. */5.4402 - bfd_uint64_t (*bfd_h_getx64) (const void *);5.4403 - bfd_int64_t (*bfd_h_getx_signed_64) (const void *);5.4404 - void (*bfd_h_putx64) (bfd_uint64_t, void *);5.4405 - bfd_vma (*bfd_h_getx32) (const void *);5.4406 - bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);5.4407 - void (*bfd_h_putx32) (bfd_vma, void *);5.4408 - bfd_vma (*bfd_h_getx16) (const void *);5.4409 - bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);5.4410 - void (*bfd_h_putx16) (bfd_vma, void *);5.4411 -5.4412 - /* Format dependent routines: these are vectors of entry points5.4413 - within the target vector structure, one for each format to check. */5.4414 -5.4415 - /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */5.4416 - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);5.4417 -5.4418 - /* Set the format of a file being written. */5.4419 - bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);5.4420 -5.4421 - /* Write cached information into a file being written, at <<bfd_close>>. */5.4422 - bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);5.4423 -5.4424 -5.4425 - /* Generic entry points. */5.4426 -#define BFD_JUMP_TABLE_GENERIC(NAME) \5.4427 - NAME##_close_and_cleanup, \5.4428 - NAME##_bfd_free_cached_info, \5.4429 - NAME##_new_section_hook, \5.4430 - NAME##_get_section_contents, \5.4431 - NAME##_get_section_contents_in_window5.4432 -5.4433 - /* Called when the BFD is being closed to do any necessary cleanup. */5.4434 - bfd_boolean (*_close_and_cleanup) (bfd *);5.4435 - /* Ask the BFD to free all cached information. */5.4436 - bfd_boolean (*_bfd_free_cached_info) (bfd *);5.4437 - /* Called when a new section is created. */5.4438 - bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);5.4439 - /* Read the contents of a section. */5.4440 - bfd_boolean (*_bfd_get_section_contents)5.4441 - (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);5.4442 - bfd_boolean (*_bfd_get_section_contents_in_window)5.4443 - (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);5.4444 -5.4445 - /* Entry points to copy private data. */5.4446 -#define BFD_JUMP_TABLE_COPY(NAME) \5.4447 - NAME##_bfd_copy_private_bfd_data, \5.4448 - NAME##_bfd_merge_private_bfd_data, \5.4449 - NAME##_bfd_copy_private_section_data, \5.4450 - NAME##_bfd_copy_private_symbol_data, \5.4451 - NAME##_bfd_copy_private_header_data, \5.4452 - NAME##_bfd_set_private_flags, \5.4453 - NAME##_bfd_print_private_bfd_data5.4454 -5.4455 - /* Called to copy BFD general private data from one object file5.4456 - to another. */5.4457 - bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);5.4458 - /* Called to merge BFD general private data from one object file5.4459 - to a common output file when linking. */5.4460 - bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);5.4461 - /* Called to copy BFD private section data from one object file5.4462 - to another. */5.4463 - bfd_boolean (*_bfd_copy_private_section_data)5.4464 - (bfd *, sec_ptr, bfd *, sec_ptr);5.4465 - /* Called to copy BFD private symbol data from one symbol5.4466 - to another. */5.4467 - bfd_boolean (*_bfd_copy_private_symbol_data)5.4468 - (bfd *, asymbol *, bfd *, asymbol *);5.4469 - /* Called to copy BFD private header data from one object file5.4470 - to another. */5.4471 - bfd_boolean (*_bfd_copy_private_header_data)5.4472 - (bfd *, bfd *);5.4473 - /* Called to set private backend flags. */5.4474 - bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);5.4475 -5.4476 - /* Called to print private BFD data. */5.4477 - bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);5.4478 -5.4479 - /* Core file entry points. */5.4480 -#define BFD_JUMP_TABLE_CORE(NAME) \5.4481 - NAME##_core_file_failing_command, \5.4482 - NAME##_core_file_failing_signal, \5.4483 - NAME##_core_file_matches_executable_p5.4484 -5.4485 - char * (*_core_file_failing_command) (bfd *);5.4486 - int (*_core_file_failing_signal) (bfd *);5.4487 - bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);5.4488 -5.4489 - /* Archive entry points. */5.4490 -#define BFD_JUMP_TABLE_ARCHIVE(NAME) \5.4491 - NAME##_slurp_armap, \5.4492 - NAME##_slurp_extended_name_table, \5.4493 - NAME##_construct_extended_name_table, \5.4494 - NAME##_truncate_arname, \5.4495 - NAME##_write_armap, \5.4496 - NAME##_read_ar_hdr, \5.4497 - NAME##_openr_next_archived_file, \5.4498 - NAME##_get_elt_at_index, \5.4499 - NAME##_generic_stat_arch_elt, \5.4500 - NAME##_update_armap_timestamp5.4501 -5.4502 - bfd_boolean (*_bfd_slurp_armap) (bfd *);5.4503 - bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);5.4504 - bfd_boolean (*_bfd_construct_extended_name_table)5.4505 - (bfd *, char **, bfd_size_type *, const char **);5.4506 - void (*_bfd_truncate_arname) (bfd *, const char *, char *);5.4507 - bfd_boolean (*write_armap)5.4508 - (bfd *, unsigned int, struct orl *, unsigned int, int);5.4509 - void * (*_bfd_read_ar_hdr_fn) (bfd *);5.4510 - bfd * (*openr_next_archived_file) (bfd *, bfd *);5.4511 -#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))5.4512 - bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);5.4513 - int (*_bfd_stat_arch_elt) (bfd *, struct stat *);5.4514 - bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);5.4515 -5.4516 - /* Entry points used for symbols. */5.4517 -#define BFD_JUMP_TABLE_SYMBOLS(NAME) \5.4518 - NAME##_get_symtab_upper_bound, \5.4519 - NAME##_canonicalize_symtab, \5.4520 - NAME##_make_empty_symbol, \5.4521 - NAME##_print_symbol, \5.4522 - NAME##_get_symbol_info, \5.4523 - NAME##_bfd_is_local_label_name, \5.4524 - NAME##_bfd_is_target_special_symbol, \5.4525 - NAME##_get_lineno, \5.4526 - NAME##_find_nearest_line, \5.4527 - NAME##_bfd_make_debug_symbol, \5.4528 - NAME##_read_minisymbols, \5.4529 - NAME##_minisymbol_to_symbol5.4530 -5.4531 - long (*_bfd_get_symtab_upper_bound) (bfd *);5.4532 - long (*_bfd_canonicalize_symtab)5.4533 - (bfd *, struct bfd_symbol **);5.4534 - struct bfd_symbol *5.4535 - (*_bfd_make_empty_symbol) (bfd *);5.4536 - void (*_bfd_print_symbol)5.4537 - (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);5.4538 -#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))5.4539 - void (*_bfd_get_symbol_info)5.4540 - (bfd *, struct bfd_symbol *, symbol_info *);5.4541 -#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))5.4542 - bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);5.4543 - bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);5.4544 - alent * (*_get_lineno) (bfd *, struct bfd_symbol *);5.4545 - bfd_boolean (*_bfd_find_nearest_line)5.4546 - (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,5.4547 - const char **, const char **, unsigned int *);5.4548 - /* Back-door to allow format-aware applications to create debug symbols5.4549 - while using BFD for everything else. Currently used by the assembler5.4550 - when creating COFF files. */5.4551 - asymbol * (*_bfd_make_debug_symbol)5.4552 - (bfd *, void *, unsigned long size);5.4553 -#define bfd_read_minisymbols(b, d, m, s) \5.4554 - BFD_SEND (b, _read_minisymbols, (b, d, m, s))5.4555 - long (*_read_minisymbols)5.4556 - (bfd *, bfd_boolean, void **, unsigned int *);5.4557 -#define bfd_minisymbol_to_symbol(b, d, m, f) \5.4558 - BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))5.4559 - asymbol * (*_minisymbol_to_symbol)5.4560 - (bfd *, bfd_boolean, const void *, asymbol *);5.4561 -5.4562 - /* Routines for relocs. */5.4563 -#define BFD_JUMP_TABLE_RELOCS(NAME) \5.4564 - NAME##_get_reloc_upper_bound, \5.4565 - NAME##_canonicalize_reloc, \5.4566 - NAME##_bfd_reloc_type_lookup5.4567 -5.4568 - long (*_get_reloc_upper_bound) (bfd *, sec_ptr);5.4569 - long (*_bfd_canonicalize_reloc)5.4570 - (bfd *, sec_ptr, arelent **, struct bfd_symbol **);5.4571 - /* See documentation on reloc types. */5.4572 - reloc_howto_type *5.4573 - (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);5.4574 -5.4575 - /* Routines used when writing an object file. */5.4576 -#define BFD_JUMP_TABLE_WRITE(NAME) \5.4577 - NAME##_set_arch_mach, \5.4578 - NAME##_set_section_contents5.4579 -5.4580 - bfd_boolean (*_bfd_set_arch_mach)5.4581 - (bfd *, enum bfd_architecture, unsigned long);5.4582 - bfd_boolean (*_bfd_set_section_contents)5.4583 - (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);5.4584 -5.4585 - /* Routines used by the linker. */5.4586 -#define BFD_JUMP_TABLE_LINK(NAME) \5.4587 - NAME##_sizeof_headers, \5.4588 - NAME##_bfd_get_relocated_section_contents, \5.4589 - NAME##_bfd_relax_section, \5.4590 - NAME##_bfd_link_hash_table_create, \5.4591 - NAME##_bfd_link_hash_table_free, \5.4592 - NAME##_bfd_link_add_symbols, \5.4593 - NAME##_bfd_link_just_syms, \5.4594 - NAME##_bfd_final_link, \5.4595 - NAME##_bfd_link_split_section, \5.4596 - NAME##_bfd_gc_sections, \5.4597 - NAME##_bfd_merge_sections, \5.4598 - NAME##_bfd_is_group_section, \5.4599 - NAME##_bfd_discard_group, \5.4600 - NAME##_section_already_linked \5.4601 -5.4602 - int (*_bfd_sizeof_headers) (bfd *, bfd_boolean);5.4603 - bfd_byte * (*_bfd_get_relocated_section_contents)5.4604 - (bfd *, struct bfd_link_info *, struct bfd_link_order *,5.4605 - bfd_byte *, bfd_boolean, struct bfd_symbol **);5.4606 -5.4607 - bfd_boolean (*_bfd_relax_section)5.4608 - (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);5.4609 -5.4610 - /* Create a hash table for the linker. Different backends store5.4611 - different information in this table. */5.4612 - struct bfd_link_hash_table *5.4613 - (*_bfd_link_hash_table_create) (bfd *);5.4614 -5.4615 - /* Release the memory associated with the linker hash table. */5.4616 - void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);5.4617 -5.4618 - /* Add symbols from this object file into the hash table. */5.4619 - bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);5.4620 -5.4621 - /* Indicate that we are only retrieving symbol values from this section. */5.4622 - void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);5.4623 -5.4624 - /* Do a link based on the link_order structures attached to each5.4625 - section of the BFD. */5.4626 - bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);5.4627 -5.4628 - /* Should this section be split up into smaller pieces during linking. */5.4629 - bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);5.4630 -5.4631 - /* Remove sections that are not referenced from the output. */5.4632 - bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);5.4633 -5.4634 - /* Attempt to merge SEC_MERGE sections. */5.4635 - bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);5.4636 -5.4637 - /* Is this section a member of a group? */5.4638 - bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);5.4639 -5.4640 - /* Discard members of a group. */5.4641 - bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);5.4642 -5.4643 - /* Check if SEC has been already linked during a reloceatable or5.4644 - final link. */5.4645 - void (*_section_already_linked) (bfd *, struct bfd_section *);5.4646 -5.4647 - /* Routines to handle dynamic symbols and relocs. */5.4648 -#define BFD_JUMP_TABLE_DYNAMIC(NAME) \5.4649 - NAME##_get_dynamic_symtab_upper_bound, \5.4650 - NAME##_canonicalize_dynamic_symtab, \5.4651 - NAME##_get_synthetic_symtab, \5.4652 - NAME##_get_dynamic_reloc_upper_bound, \5.4653 - NAME##_canonicalize_dynamic_reloc5.4654 -5.4655 - /* Get the amount of memory required to hold the dynamic symbols. */5.4656 - long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);5.4657 - /* Read in the dynamic symbols. */5.4658 - long (*_bfd_canonicalize_dynamic_symtab)5.4659 - (bfd *, struct bfd_symbol **);5.4660 - /* Create synthetized symbols. */5.4661 - long (*_bfd_get_synthetic_symtab)5.4662 - (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,5.4663 - struct bfd_symbol **);5.4664 - /* Get the amount of memory required to hold the dynamic relocs. */5.4665 - long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);5.4666 - /* Read in the dynamic relocs. */5.4667 - long (*_bfd_canonicalize_dynamic_reloc)5.4668 - (bfd *, arelent **, struct bfd_symbol **);5.4669 -5.4670 - /* Opposite endian version of this target. */5.4671 - const struct bfd_target * alternative_target;5.4672 -5.4673 - /* Data for use by back-end routines, which isn't5.4674 - generic enough to belong in this structure. */5.4675 - const void *backend_data;5.4676 -5.4677 -} bfd_target;5.4678 -5.4679 -bfd_boolean bfd_set_default_target (const char *name);5.4680 -5.4681 -const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);5.4682 -5.4683 -const char ** bfd_target_list (void);5.4684 -5.4685 -const bfd_target *bfd_search_for_target5.4686 - (int (*search_func) (const bfd_target *, void *),5.4687 - void *);5.4688 -5.4689 -/* Extracted from format.c. */5.4690 -bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);5.4691 -5.4692 -bfd_boolean bfd_check_format_matches5.4693 - (bfd *abfd, bfd_format format, char ***matching);5.4694 -5.4695 -bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);5.4696 -5.4697 -const char *bfd_format_string (bfd_format format);5.4698 -5.4699 -/* Extracted from linker.c. */5.4700 -bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);5.4701 -5.4702 -#define bfd_link_split_section(abfd, sec) \5.4703 - BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))5.4704 -5.4705 -void bfd_section_already_linked (bfd *abfd, asection *sec);5.4706 -5.4707 -#define bfd_section_already_linked(abfd, sec) \5.4708 - BFD_SEND (abfd, _section_already_linked, (abfd, sec))5.4709 -5.4710 -/* Extracted from simple.c. */5.4711 -bfd_byte *bfd_simple_get_relocated_section_contents5.4712 - (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);5.4713 -5.4714 -#ifdef __cplusplus5.4715 -}5.4716 -#endif5.4717 -#endif
6.1 --- a/src/x86dasm/dis-asm.h Tue Mar 06 09:04:34 2012 +10006.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +00006.3 @@ -1,333 +0,0 @@6.4 -/* Interface between the opcode library and its callers.6.5 -6.6 - Copyright 1999, 2000, 2001, 2002, 2003, 2004, 20056.7 - Free Software Foundation, Inc.6.8 -6.9 - This program is free software; you can redistribute it and/or modify6.10 - it under the terms of the GNU General Public License as published by6.11 - the Free Software Foundation; either version 2, or (at your option)6.12 - any later version.6.13 -6.14 - This program is distributed in the hope that it will be useful,6.15 - but WITHOUT ANY WARRANTY; without even the implied warranty of6.16 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the6.17 - GNU General Public License for more details.6.18 -6.19 - You should have received a copy of the GNU General Public License6.20 - along with this program; if not, write to the Free Software6.21 - Foundation, Inc., 59 Temple Place - Suite 330,6.22 - Boston, MA 02111-1307, USA.6.23 -6.24 - Written by Cygnus Support, 1993.6.25 -6.26 - The opcode library (libopcodes.a) provides instruction decoders for6.27 - a large variety of instruction sets, callable with an identical6.28 - interface, for making instruction-processing programs more independent6.29 - of the instruction set being processed. */6.30 -6.31 -#ifndef DIS_ASM_H6.32 -#define DIS_ASM_H6.33 -6.34 -#ifdef __cplusplus6.35 -extern "C" {6.36 -#endif6.37 -6.38 -#include <stdio.h>6.39 -#include "x86dasm/bfd.h"6.40 -6.41 -typedef int (*fprintf_ftype) (void *, const char*, ...);6.42 -6.43 -enum dis_insn_type {6.44 - dis_noninsn, /* Not a valid instruction */6.45 - dis_nonbranch, /* Not a branch instruction */6.46 - dis_branch, /* Unconditional branch */6.47 - dis_condbranch, /* Conditional branch */6.48 - dis_jsr, /* Jump to subroutine */6.49 - dis_condjsr, /* Conditional jump to subroutine */6.50 - dis_dref, /* Data reference instruction */6.51 - dis_dref2 /* Two data references in instruction */6.52 -};6.53 -6.54 -/* This struct is passed into the instruction decoding routine,6.55 - and is passed back out into each callback. The various fields are used6.56 - for conveying information from your main routine into your callbacks,6.57 - for passing information into the instruction decoders (such as the6.58 - addresses of the callback functions), or for passing information6.59 - back from the instruction decoders to their callers.6.60 -6.61 - It must be initialized before it is first passed; this can be done6.62 - by hand, or using one of the initialization macros below. */6.63 -6.64 -typedef struct disassemble_info {6.65 - fprintf_ftype fprintf_func;6.66 - void *stream;6.67 - void *application_data;6.68 -6.69 - /* Target description. We could replace this with a pointer to the bfd,6.70 - but that would require one. There currently isn't any such requirement6.71 - so to avoid introducing one we record these explicitly. */6.72 - /* The bfd_flavour. This can be bfd_target_unknown_flavour. */6.73 - enum bfd_flavour flavour;6.74 - /* The bfd_arch value. */6.75 - enum bfd_architecture arch;6.76 - /* The bfd_mach value. */6.77 - unsigned long mach;6.78 - /* Endianness (for bi-endian cpus). Mono-endian cpus can ignore this. */6.79 - enum bfd_endian endian;6.80 - /* An arch/mach-specific bitmask of selected instruction subsets, mainly6.81 - for processors with run-time-switchable instruction sets. The default,6.82 - zero, means that there is no constraint. CGEN-based opcodes ports6.83 - may use ISA_foo masks. */6.84 - unsigned long insn_sets;6.85 -6.86 - /* Some targets need information about the current section to accurately6.87 - display insns. If this is NULL, the target disassembler function6.88 - will have to make its best guess. */6.89 - asection *section;6.90 -6.91 - /* An array of pointers to symbols either at the location being disassembled6.92 - or at the start of the function being disassembled. The array is sorted6.93 - so that the first symbol is intended to be the one used. The others are6.94 - present for any misc. purposes. This is not set reliably, but if it is6.95 - not NULL, it is correct. */6.96 - asymbol **symbols;6.97 - /* Number of symbols in array. */6.98 - int num_symbols;6.99 -6.100 - /* For use by the disassembler.6.101 - The top 16 bits are reserved for public use (and are documented here).6.102 - The bottom 16 bits are for the internal use of the disassembler. */6.103 - unsigned long flags;6.104 -#define INSN_HAS_RELOC 0x800000006.105 - void *private_data;6.106 -6.107 - /* Function used to get bytes to disassemble. MEMADDR is the6.108 - address of the stuff to be disassembled, MYADDR is the address to6.109 - put the bytes in, and LENGTH is the number of bytes to read.6.110 - INFO is a pointer to this struct.6.111 - Returns an errno value or 0 for success. */6.112 - int (*read_memory_func)6.113 - (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,6.114 - struct disassemble_info *info);6.115 -6.116 - /* Function which should be called if we get an error that we can't6.117 - recover from. STATUS is the errno value from read_memory_func and6.118 - MEMADDR is the address that we were trying to read. INFO is a6.119 - pointer to this struct. */6.120 - void (*memory_error_func)6.121 - (int status, bfd_vma memaddr, struct disassemble_info *info);6.122 -6.123 - /* Function called to print ADDR. */6.124 - void (*print_address_func)6.125 - (bfd_vma addr, struct disassemble_info *info);6.126 -6.127 - /* Function called to determine if there is a symbol at the given ADDR.6.128 - If there is, the function returns 1, otherwise it returns 0.6.129 - This is used by ports which support an overlay manager where6.130 - the overlay number is held in the top part of an address. In6.131 - some circumstances we want to include the overlay number in the6.132 - address, (normally because there is a symbol associated with6.133 - that address), but sometimes we want to mask out the overlay bits. */6.134 - int (* symbol_at_address_func)6.135 - (bfd_vma addr, struct disassemble_info * info);6.136 -6.137 - /* Function called to check if a SYMBOL is can be displayed to the user.6.138 - This is used by some ports that want to hide special symbols when6.139 - displaying debugging outout. */6.140 - bfd_boolean (* symbol_is_valid)6.141 - (asymbol *, struct disassemble_info * info);6.142 -6.143 - /* These are for buffer_read_memory. */6.144 - bfd_byte *buffer;6.145 - bfd_vma buffer_vma;6.146 - unsigned int buffer_length;6.147 -6.148 - /* This variable may be set by the instruction decoder. It suggests6.149 - the number of bytes objdump should display on a single line. If6.150 - the instruction decoder sets this, it should always set it to6.151 - the same value in order to get reasonable looking output. */6.152 - int bytes_per_line;6.153 -6.154 - /* The next two variables control the way objdump displays the raw data. */6.155 - /* For example, if bytes_per_line is 8 and bytes_per_chunk is 4, the */6.156 - /* output will look like this:6.157 - 00: 00000000 000000006.158 - with the chunks displayed according to "display_endian". */6.159 - int bytes_per_chunk;6.160 - enum bfd_endian display_endian;6.161 -6.162 - /* Number of octets per incremented target address6.163 - Normally one, but some DSPs have byte sizes of 16 or 32 bits. */6.164 - unsigned int octets_per_byte;6.165 -6.166 - /* The number of zeroes we want to see at the end of a section before we6.167 - start skipping them. */6.168 - unsigned int skip_zeroes;6.169 -6.170 - /* The number of zeroes to skip at the end of a section. If the number6.171 - of zeroes at the end is between SKIP_ZEROES_AT_END and SKIP_ZEROES,6.172 - they will be disassembled. If there are fewer than6.173 - SKIP_ZEROES_AT_END, they will be skipped. This is a heuristic6.174 - attempt to avoid disassembling zeroes inserted by section6.175 - alignment. */6.176 - unsigned int skip_zeroes_at_end;6.177 -6.178 - /* Results from instruction decoders. Not all decoders yet support6.179 - this information. This info is set each time an instruction is6.180 - decoded, and is only valid for the last such instruction.6.181 -6.182 - To determine whether this decoder supports this information, set6.183 - insn_info_valid to 0, decode an instruction, then check it. */6.184 -6.185 - char insn_info_valid; /* Branch info has been set. */6.186 - char branch_delay_insns; /* How many sequential insn's will run before6.187 - a branch takes effect. (0 = normal) */6.188 - char data_size; /* Size of data reference in insn, in bytes */6.189 - enum dis_insn_type insn_type; /* Type of instruction */6.190 - bfd_vma target; /* Target address of branch or dref, if known;6.191 - zero if unknown. */6.192 - bfd_vma target2; /* Second target address for dref2 */6.193 -6.194 - /* Command line options specific to the target disassembler. */6.195 - char * disassembler_options;6.196 -6.197 -} disassemble_info;6.198 -6.199 -6.200 -/* Standard disassemblers. Disassemble one instruction at the given6.201 - target address. Return number of octets processed. */6.202 -typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);6.203 -6.204 -extern int print_insn_big_mips (bfd_vma, disassemble_info *);6.205 -extern int print_insn_little_mips (bfd_vma, disassemble_info *);6.206 -extern int print_insn_i386 (bfd_vma, disassemble_info *);6.207 -extern int print_insn_i386_att (bfd_vma, disassemble_info *);6.208 -extern int print_insn_i386_intel (bfd_vma, disassemble_info *);6.209 -extern int print_insn_ia64 (bfd_vma, disassemble_info *);6.210 -extern int print_insn_i370 (bfd_vma, disassemble_info *);6.211 -extern int print_insn_m68hc11 (bfd_vma, disassemble_info *);6.212 -extern int print_insn_m68hc12 (bfd_vma, disassemble_info *);6.213 -extern int print_insn_m68k (bfd_vma, disassemble_info *);6.214 -extern int print_insn_z8001 (bfd_vma, disassemble_info *);6.215 -extern int print_insn_z8002 (bfd_vma, disassemble_info *);6.216 -extern int print_insn_h8300 (bfd_vma, disassemble_info *);6.217 -extern int print_insn_h8300h (bfd_vma, disassemble_info *);6.218 -extern int print_insn_h8300s (bfd_vma, disassemble_info *);6.219 -extern int print_insn_h8500 (bfd_vma, disassemble_info *);6.220 -extern int print_insn_alpha (bfd_vma, disassemble_info *);6.221 -extern int print_insn_big_arm (bfd_vma, disassemble_info *);6.222 -extern int print_insn_little_arm (bfd_vma, disassemble_info *);6.223 -extern int print_insn_sparc (bfd_vma, disassemble_info *);6.224 -extern int print_insn_big_a29k (bfd_vma, disassemble_info *);6.225 -extern int print_insn_little_a29k (bfd_vma, disassemble_info *);6.226 -extern int print_insn_avr (bfd_vma, disassemble_info *);6.227 -extern int print_insn_d10v (bfd_vma, disassemble_info *);6.228 -extern int print_insn_d30v (bfd_vma, disassemble_info *);6.229 -extern int print_insn_dlx (bfd_vma, disassemble_info *);6.230 -extern int print_insn_fr30 (bfd_vma, disassemble_info *);6.231 -extern int print_insn_hppa (bfd_vma, disassemble_info *);6.232 -extern int print_insn_i860 (bfd_vma, disassemble_info *);6.233 -extern int print_insn_i960 (bfd_vma, disassemble_info *);6.234 -extern int print_insn_ip2k (bfd_vma, disassemble_info *);6.235 -extern int print_insn_m32r (bfd_vma, disassemble_info *);6.236 -extern int print_insn_m88k (bfd_vma, disassemble_info *);6.237 -extern int print_insn_maxq_little (bfd_vma, disassemble_info *);6.238 -extern int print_insn_maxq_big (bfd_vma, disassemble_info *);6.239 -extern int print_insn_mcore (bfd_vma, disassemble_info *);6.240 -extern int print_insn_mmix (bfd_vma, disassemble_info *);6.241 -extern int print_insn_mn10200 (bfd_vma, disassemble_info *);6.242 -extern int print_insn_mn10300 (bfd_vma, disassemble_info *);6.243 -extern int print_insn_msp430 (bfd_vma, disassemble_info *);6.244 -extern int print_insn_ns32k (bfd_vma, disassemble_info *);6.245 -extern int print_insn_crx (bfd_vma, disassemble_info *);6.246 -extern int print_insn_openrisc (bfd_vma, disassemble_info *);6.247 -extern int print_insn_big_or32 (bfd_vma, disassemble_info *);6.248 -extern int print_insn_little_or32 (bfd_vma, disassemble_info *);6.249 -extern int print_insn_pdp11 (bfd_vma, disassemble_info *);6.250 -extern int print_insn_pj (bfd_vma, disassemble_info *);6.251 -extern int print_insn_big_powerpc (bfd_vma, disassemble_info *);6.252 -extern int print_insn_little_powerpc (bfd_vma, disassemble_info *);6.253 -extern int print_insn_rs6000 (bfd_vma, disassemble_info *);6.254 -extern int print_insn_s390 (bfd_vma, disassemble_info *);6.255 -extern int print_insn_sh (bfd_vma, disassemble_info *);6.256 -extern int print_insn_tic30 (bfd_vma, disassemble_info *);6.257 -extern int print_insn_tic4x (bfd_vma, disassemble_info *);6.258 -extern int print_insn_tic54x (bfd_vma, disassemble_info *);6.259 -extern int print_insn_tic80 (bfd_vma, disassemble_info *);6.260 -extern int print_insn_v850 (bfd_vma, disassemble_info *);6.261 -extern int print_insn_vax (bfd_vma, disassemble_info *);6.262 -extern int print_insn_w65 (bfd_vma, disassemble_info *);6.263 -extern int print_insn_xstormy16 (bfd_vma, disassemble_info *);6.264 -extern int print_insn_xtensa (bfd_vma, disassemble_info *);6.265 -extern int print_insn_sh64 (bfd_vma, disassemble_info *);6.266 -extern int print_insn_sh64x_media (bfd_vma, disassemble_info *);6.267 -extern int print_insn_frv (bfd_vma, disassemble_info *);6.268 -extern int print_insn_iq2000 (bfd_vma, disassemble_info *);6.269 -6.270 -extern disassembler_ftype arc_get_disassembler (void *);6.271 -extern disassembler_ftype cris_get_disassembler (bfd *);6.272 -6.273 -extern void print_mips_disassembler_options (FILE *);6.274 -extern void print_ppc_disassembler_options (FILE *);6.275 -extern void print_arm_disassembler_options (FILE *);6.276 -extern void parse_arm_disassembler_option (char *);6.277 -extern int get_arm_regname_num_options (void);6.278 -extern int set_arm_regname_option (int);6.279 -extern int get_arm_regnames (int, const char **, const char **, const char ***);6.280 -extern bfd_boolean arm_symbol_is_valid (asymbol *, struct disassemble_info *);6.281 -6.282 -/* Fetch the disassembler for a given BFD, if that support is available. */6.283 -extern disassembler_ftype disassembler (bfd *);6.284 -6.285 -/* Amend the disassemble_info structure as necessary for the target architecture.6.286 - Should only be called after initialising the info->arch field. */6.287 -extern void disassemble_init_for_target (struct disassemble_info * info);6.288 -6.289 -/* Document any target specific options available from the disassembler. */6.290 -extern void disassembler_usage (FILE *);6.291 -6.292 -6.293 -/* This block of definitions is for particular callers who read instructions6.294 - into a buffer before calling the instruction decoder. */6.295 -6.296 -/* Here is a function which callers may wish to use for read_memory_func.6.297 - It gets bytes from a buffer. */6.298 -extern int buffer_read_memory6.299 - (bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *);6.300 -6.301 -/* This function goes with buffer_read_memory.6.302 - It prints a message using info->fprintf_func and info->stream. */6.303 -extern void perror_memory (int, bfd_vma, struct disassemble_info *);6.304 -6.305 -6.306 -/* Just print the address in hex. This is included for completeness even6.307 - though both GDB and objdump provide their own (to print symbolic6.308 - addresses). */6.309 -extern void generic_print_address6.310 - (bfd_vma, struct disassemble_info *);6.311 -6.312 -/* Always true. */6.313 -extern int generic_symbol_at_address6.314 - (bfd_vma, struct disassemble_info *);6.315 -6.316 -/* Also always true. */6.317 -extern bfd_boolean generic_symbol_is_valid6.318 - (asymbol *, struct disassemble_info *);6.319 -6.320 -/* Method to initialize a disassemble_info struct. This should be6.321 - called by all applications creating such a struct. */6.322 -extern void init_disassemble_info (struct disassemble_info *info, void *stream,6.323 - fprintf_ftype fprintf_func);6.324 -6.325 -/* For compatibility with existing code. */6.326 -#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \6.327 - init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))6.328 -#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \6.329 - init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))6.330 -6.331 -6.332 -#ifdef __cplusplus6.333 -}6.334 -#endif6.335 -6.336 -#endif /* ! defined (DIS_ASM_H) */
7.1 --- a/src/x86dasm/dis-buf.c Tue Mar 06 09:04:34 2012 +10007.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +00007.3 @@ -1,126 +0,0 @@7.4 -/* Disassemble from a buffer, for GNU.7.5 - Copyright 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 20057.6 - Free Software Foundation, Inc.7.7 -7.8 -This program is free software; you can redistribute it and/or modify7.9 -it under the terms of the GNU General Public License as published by7.10 -the Free Software Foundation; either version 2 of the License, or7.11 -(at your option) any later version.7.12 -7.13 -This program is distributed in the hope that it will be useful,7.14 -but WITHOUT ANY WARRANTY; without even the implied warranty of7.15 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the7.16 -GNU General Public License for more details.7.17 -7.18 -You should have received a copy of the GNU General Public License7.19 -along with this program; if not, write to the Free Software7.20 -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */7.21 -7.22 -#include "x86dasm/sysdep.h"7.23 -#include "x86dasm/dis-asm.h"7.24 -#include <errno.h>7.25 -#include "gettext.h"7.26 -7.27 -/* Get LENGTH bytes from info's buffer, at target address memaddr.7.28 - Transfer them to myaddr. */7.29 -int7.30 -buffer_read_memory (memaddr, myaddr, length, info)7.31 - bfd_vma memaddr;7.32 - bfd_byte *myaddr;7.33 - unsigned int length;7.34 - struct disassemble_info *info;7.35 -{7.36 - unsigned int opb = info->octets_per_byte;7.37 - uintptr_t octets = memaddr * opb;7.38 -7.39 - memcpy (myaddr, info->buffer + octets, length);7.40 -7.41 - return 0;7.42 -}7.43 -7.44 -/* Print an error message. We can assume that this is in response to7.45 - an error return from buffer_read_memory. */7.46 -void7.47 -perror_memory (status, memaddr, info)7.48 - int status;7.49 - bfd_vma memaddr;7.50 - struct disassemble_info *info;7.51 -{7.52 - if (status != EIO)7.53 - /* Can't happen. */7.54 - info->fprintf_func (info->stream, _("Unknown error %d\n"), status);7.55 - else7.56 - {7.57 - char buf[30];7.58 -7.59 - /* Actually, address between memaddr and memaddr + len was7.60 - out of bounds. */7.61 - sprintf_vma (buf, memaddr);7.62 - info->fprintf_func (info->stream,7.63 - _("Address 0x%s is out of bounds.\n"), buf);7.64 - }7.65 -}7.66 -7.67 -/* This could be in a separate file, to save miniscule amounts of space7.68 - in statically linked executables. */7.69 -7.70 -/* Just print the address is hex. This is included for completeness even7.71 - though both GDB and objdump provide their own (to print symbolic7.72 - addresses). */7.73 -7.74 -void7.75 -generic_print_address (addr, info)7.76 - bfd_vma addr;7.77 - struct disassemble_info *info;7.78 -{7.79 - char buf[30];7.80 -7.81 - sprintf_vma (buf, addr);7.82 - (*info->fprintf_func) (info->stream, "0x%s", buf);7.83 -}7.84 -7.85 -#if 07.86 -/* Just concatenate the address as hex. This is included for7.87 - completeness even though both GDB and objdump provide their own (to7.88 - print symbolic addresses). */7.89 -7.90 -void generic_strcat_address PARAMS ((bfd_vma, char *, int));7.91 -7.92 -void7.93 -generic_strcat_address (addr, buf, len)7.94 - bfd_vma addr;7.95 - char *buf;7.96 - int len;7.97 -{7.98 - if (buf != (char *)NULL && len > 0)7.99 - {7.100 - char tmpBuf[30];7.101 -7.102 - sprintf_vma (tmpBuf, addr);7.103 - if ((strlen (buf) + strlen (tmpBuf)) <= (unsigned int) len)7.104 - strcat (buf, tmpBuf);7.105 - else7.106 - strncat (buf, tmpBuf, (len - strlen(buf)));7.107 - }7.108 - return;7.109 -}7.110 -#endif7.111 -7.112 -/* Just return true. */7.113 -7.114 -int7.115 -generic_symbol_at_address (addr, info)7.116 - bfd_vma addr ATTRIBUTE_UNUSED;7.117 - struct disassemble_info *info ATTRIBUTE_UNUSED;7.118 -{7.119 - return 1;7.120 -}7.121 -7.122 -/* Just return TRUE. */7.123 -7.124 -bfd_boolean7.125 -generic_symbol_is_valid (asymbol * sym ATTRIBUTE_UNUSED,7.126 - struct disassemble_info *info ATTRIBUTE_UNUSED)7.127 -{7.128 - return TRUE;7.129 -}
8.1 --- a/src/x86dasm/dis-init.c Tue Mar 06 09:04:34 2012 +10008.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +00008.3 @@ -1,43 +0,0 @@8.4 -/* Initialize "struct disassemble_info".8.5 -8.6 - Copyright 2003 Free Software Foundation, Inc.8.7 -8.8 - This program is free software; you can redistribute it and/or8.9 - modify it under the terms of the GNU General Public License as8.10 - published by the Free Software Foundation; either version 2 of the8.11 - License, or (at your option) any later version.8.12 -8.13 - This program is distributed in the hope that it will be useful, but8.14 - WITHOUT ANY WARRANTY; without even the implied warranty of8.15 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU8.16 - General Public License for more details.8.17 -8.18 - You should have received a copy of the GNU General Public License8.19 - along with this program; if not, write to the Free Software8.20 - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA8.21 - 02111-1307, USA. */8.22 -8.23 -#include "x86dasm/sysdep.h"8.24 -#include "x86dasm/dis-asm.h"8.25 -#include "x86dasm/bfd.h"8.26 -8.27 -void8.28 -init_disassemble_info (struct disassemble_info *info, void *stream,8.29 - fprintf_ftype fprintf_func)8.30 -{8.31 - memset (info, 0, sizeof (*info));8.32 -8.33 - info->flavour = bfd_target_unknown_flavour;8.34 - info->arch = bfd_arch_unknown;8.35 - info->endian = BFD_ENDIAN_UNKNOWN;8.36 - info->octets_per_byte = 1;8.37 - info->fprintf_func = fprintf_func;8.38 - info->stream = stream;8.39 - info->read_memory_func = buffer_read_memory;8.40 - info->memory_error_func = perror_memory;8.41 - info->print_address_func = generic_print_address;8.42 - info->symbol_at_address_func = generic_symbol_at_address;8.43 - info->symbol_is_valid = generic_symbol_is_valid;8.44 - info->display_endian = BFD_ENDIAN_UNKNOWN;8.45 -}8.46 -
9.1 --- a/src/x86dasm/i386-dis.c Tue Mar 06 09:04:34 2012 +10009.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +00009.3 @@ -1,4379 +0,0 @@9.4 -/* Print i386 instructions for GDB, the GNU debugger.9.5 - Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,9.6 - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.9.7 -9.8 - This file is part of GDB.9.9 -9.10 - This program is free software; you can redistribute it and/or modify9.11 - it under the terms of the GNU General Public License as published by9.12 - the Free Software Foundation; either version 2 of the License, or9.13 - (at your option) any later version.9.14 -9.15 - This program is distributed in the hope that it will be useful,9.16 - but WITHOUT ANY WARRANTY; without even the implied warranty of9.17 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9.18 - GNU General Public License for more details.9.19 -9.20 - You should have received a copy of the GNU General Public License9.21 - along with this program; if not, write to the Free Software9.22 - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */9.23 -9.24 -/* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)9.25 - July 19889.26 - modified by John Hassey (hassey@dg-rtp.dg.com)9.27 - x86-64 support added by Jan Hubicka (jh@suse.cz)9.28 - VIA PadLock support by Michal Ludvig (mludvig@suse.cz). */9.29 -9.30 -/* The main tables describing the instructions is essentially a copy9.31 - of the "Opcode Map" chapter (Appendix A) of the Intel 803869.32 - Programmers Manual. Usually, there is a capital letter, followed9.33 - by a small letter. The capital letter tell the addressing mode,9.34 - and the small letter tells about the operand size. Refer to9.35 - the Intel manual for details. */9.36 -9.37 -#include "x86dasm/dis-asm.h"9.38 -#include "x86dasm/sysdep.h"9.39 -#include "xlat/xlatdasm.h"9.40 -#include "gettext.h"9.41 -9.42 -#define MAXLEN 209.43 -9.44 -#include <setjmp.h>9.45 -9.46 -#ifndef UNIXWARE_COMPAT9.47 -/* Set non-zero for broken, compatible instructions. Set to zero for9.48 - non-broken opcodes. */9.49 -#define UNIXWARE_COMPAT 19.50 -#endif9.51 -9.52 -static int fetch_data (struct disassemble_info *, bfd_byte *);9.53 -static void ckprefix (void);9.54 -static const char *prefix_name (int, int);9.55 -static int print_insn (bfd_vma, disassemble_info *);9.56 -static void dofloat (int);9.57 -static void OP_ST (int, int);9.58 -static void OP_STi (int, int);9.59 -static int putop (const char *, int);9.60 -static void oappend (const char *);9.61 -static void append_seg (void);9.62 -static void OP_indirE (int, int);9.63 -static void OP_E (int, int);9.64 -static void OP_G (int, int);9.65 -static bfd_vma get64 (void);9.66 -static bfd_signed_vma get32 (void);9.67 -static bfd_signed_vma get32s (void);9.68 -static int get16 (void);9.69 -static void set_op (bfd_vma, int);9.70 -static void OP_REG (int, int);9.71 -static void OP_IMREG (int, int);9.72 -static void OP_I (int, int);9.73 -static void OP_I64 (int, int);9.74 -static void OP_sI (int, int);9.75 -static void OP_J (int, int);9.76 -static void OP_SEG (int, int);9.77 -static void OP_DIR (int, int);9.78 -static void OP_OFF (int, int);9.79 -static void OP_OFF64 (int, int);9.80 -static void ptr_reg (int, int);9.81 -static void OP_ESreg (int, int);9.82 -static void OP_DSreg (int, int);9.83 -static void OP_C (int, int);9.84 -static void OP_D (int, int);9.85 -static void OP_T (int, int);9.86 -static void OP_Rd (int, int);9.87 -static void OP_MMX (int, int);9.88 -static void OP_XMM (int, int);9.89 -static void OP_EM (int, int);9.90 -static void OP_EX (int, int);9.91 -static void OP_MS (int, int);9.92 -static void OP_XS (int, int);9.93 -static void OP_M (int, int);9.94 -static void OP_0fae (int, int);9.95 -static void OP_0f07 (int, int);9.96 -static void NOP_Fixup (int, int);9.97 -static void OP_3DNowSuffix (int, int);9.98 -static void OP_SIMD_Suffix (int, int);9.99 -static void SIMD_Fixup (int, int);9.100 -static void PNI_Fixup (int, int);9.101 -static void INVLPG_Fixup (int, int);9.102 -static void BadOp (void);9.103 -9.104 -struct dis_private {9.105 - /* Points to first byte not fetched. */9.106 - bfd_byte *max_fetched;9.107 - bfd_byte the_buffer[MAXLEN];9.108 - bfd_vma insn_start;9.109 - int orig_sizeflag;9.110 - jmp_buf bailout;9.111 -};9.112 -9.113 -/* The opcode for the fwait instruction, which we treat as a prefix9.114 - when we can. */9.115 -#define FWAIT_OPCODE (0x9b)9.116 -9.117 -/* Set to 1 for 64bit mode disassembly. */9.118 -static int mode_64bit;9.119 -9.120 -/* Flags for the prefixes for the current instruction. See below. */9.121 -static int prefixes;9.122 -9.123 -/* REX prefix the current instruction. See below. */9.124 -static int rex;9.125 -/* Bits of REX we've already used. */9.126 -static int rex_used;9.127 -#define REX_MODE64 89.128 -#define REX_EXTX 49.129 -#define REX_EXTY 29.130 -#define REX_EXTZ 19.131 -/* Mark parts used in the REX prefix. When we are testing for9.132 - empty prefix (for 8bit register REX extension), just mask it9.133 - out. Otherwise test for REX bit is excuse for existence of REX9.134 - only in case value is nonzero. */9.135 -#define USED_REX(value) \9.136 - { \9.137 - if (value) \9.138 - rex_used |= (rex & value) ? (value) | 0x40 : 0; \9.139 - else \9.140 - rex_used |= 0x40; \9.141 - }9.142 -9.143 -/* Flags for prefixes which we somehow handled when printing the9.144 - current instruction. */9.145 -static int used_prefixes;9.146 -9.147 -/* Flags stored in PREFIXES. */9.148 -#define PREFIX_REPZ 19.149 -#define PREFIX_REPNZ 29.150 -#define PREFIX_LOCK 49.151 -#define PREFIX_CS 89.152 -#define PREFIX_SS 0x109.153 -#define PREFIX_DS 0x209.154 -#define PREFIX_ES 0x409.155 -#define PREFIX_FS 0x809.156 -#define PREFIX_GS 0x1009.157 -#define PREFIX_DATA 0x2009.158 -#define PREFIX_ADDR 0x4009.159 -#define PREFIX_FWAIT 0x8009.160 -9.161 -/* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)9.162 - to ADDR (exclusive) are valid. Returns 1 for success, longjmps9.163 - on error. */9.164 -#define FETCH_DATA(info, addr) \9.165 - ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \9.166 - ? 1 : fetch_data ((info), (addr)))9.167 -9.168 -static int9.169 -fetch_data (struct disassemble_info *info, bfd_byte *addr)9.170 -{9.171 - int status;9.172 - struct dis_private *priv = (struct dis_private *) info->private_data;9.173 - bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);9.174 -9.175 - status = (*info->read_memory_func) (start,9.176 - priv->max_fetched,9.177 - addr - priv->max_fetched,9.178 - info);9.179 - if (status != 0)9.180 - {9.181 - /* If we did manage to read at least one byte, then9.182 - print_insn_i386 will do something sensible. Otherwise, print9.183 - an error. We do that here because this is where we know9.184 - STATUS. */9.185 - if (priv->max_fetched == priv->the_buffer)9.186 - (*info->memory_error_func) (status, start, info);9.187 - longjmp (priv->bailout, 1);9.188 - }9.189 - else9.190 - priv->max_fetched = addr;9.191 - return 1;9.192 -}9.193 -9.194 -#define XX NULL, 09.195 -9.196 -#define Eb OP_E, b_mode9.197 -#define Ev OP_E, v_mode9.198 -#define Ed OP_E, d_mode9.199 -#define Eq OP_E, q_mode9.200 -#define Edq OP_E, dq_mode9.201 -#define Edqw OP_E, dqw_mode9.202 -#define indirEv OP_indirE, v_mode9.203 -#define indirEp OP_indirE, f_mode9.204 -#define Ew OP_E, w_mode9.205 -#define Ma OP_E, v_mode9.206 -#define M OP_M, 0 /* lea, lgdt, etc. */9.207 -#define Mp OP_M, f_mode /* 32 or 48 bit memory operand for LDS, LES etc */9.208 -#define Gb OP_G, b_mode9.209 -#define Gv OP_G, v_mode9.210 -#define Gd OP_G, d_mode9.211 -#define Gdq OP_G, dq_mode9.212 -#define Gw OP_G, w_mode9.213 -#define Rd OP_Rd, d_mode9.214 -#define Rm OP_Rd, m_mode9.215 -#define Ib OP_I, b_mode9.216 -#define sIb OP_sI, b_mode /* sign extened byte */9.217 -#define Iv OP_I, v_mode9.218 -#define Iq OP_I, q_mode9.219 -#define Iv64 OP_I64, v_mode9.220 -#define Iw OP_I, w_mode9.221 -#define I1 OP_I, const_1_mode9.222 -#define Jb OP_J, b_mode9.223 -#define Jv OP_J, v_mode9.224 -#define Cm OP_C, m_mode9.225 -#define Dm OP_D, m_mode9.226 -#define Td OP_T, d_mode9.227 -9.228 -#define RMeAX OP_REG, eAX_reg9.229 -#define RMeBX OP_REG, eBX_reg9.230 -#define RMeCX OP_REG, eCX_reg9.231 -#define RMeDX OP_REG, eDX_reg9.232 -#define RMeSP OP_REG, eSP_reg9.233 -#define RMeBP OP_REG, eBP_reg9.234 -#define RMeSI OP_REG, eSI_reg9.235 -#define RMeDI OP_REG, eDI_reg9.236 -#define RMrAX OP_REG, rAX_reg9.237 -#define RMrBX OP_REG, rBX_reg9.238 -#define RMrCX OP_REG, rCX_reg9.239 -#define RMrDX OP_REG, rDX_reg9.240 -#define RMrSP OP_REG, rSP_reg9.241 -#define RMrBP OP_REG, rBP_reg9.242 -#define RMrSI OP_REG, rSI_reg9.243 -#define RMrDI OP_REG, rDI_reg9.244 -#define RMAL OP_REG, al_reg9.245 -#define RMAL OP_REG, al_reg9.246 -#define RMCL OP_REG, cl_reg9.247 -#define RMDL OP_REG, dl_reg9.248 -#define RMBL OP_REG, bl_reg9.249 -#define RMAH OP_REG, ah_reg9.250 -#define RMCH OP_REG, ch_reg9.251 -#define RMDH OP_REG, dh_reg9.252 -#define RMBH OP_REG, bh_reg9.253 -#define RMAX OP_REG, ax_reg9.254 -#define RMDX OP_REG, dx_reg9.255 -9.256 -#define eAX OP_IMREG, eAX_reg9.257 -#define eBX OP_IMREG, eBX_reg9.258 -#define eCX OP_IMREG, eCX_reg9.259 -#define eDX OP_IMREG, eDX_reg9.260 -#define eSP OP_IMREG, eSP_reg9.261 -#define eBP OP_IMREG, eBP_reg9.262 -#define eSI OP_IMREG, eSI_reg9.263 -#define eDI OP_IMREG, eDI_reg9.264 -#define AL OP_IMREG, al_reg9.265 -#define AL OP_IMREG, al_reg9.266 -#define CL OP_IMREG, cl_reg9.267 -#define DL OP_IMREG, dl_reg9.268 -#define BL OP_IMREG, bl_reg9.269 -#define AH OP_IMREG, ah_reg9.270 -#define CH OP_IMREG, ch_reg9.271 -#define DH OP_IMREG, dh_reg9.272 -#define BH OP_IMREG, bh_reg9.273 -#define AX OP_IMREG, ax_reg9.274 -#define DX OP_IMREG, dx_reg9.275 -#define indirDX OP_IMREG, indir_dx_reg9.276 -9.277 -#define Sw OP_SEG, w_mode9.278 -#define Ap OP_DIR, 09.279 -#define Ob OP_OFF, b_mode9.280 -#define Ob64 OP_OFF64, b_mode9.281 -#define Ov OP_OFF, v_mode9.282 -#define Ov64 OP_OFF64, v_mode9.283 -#define Xb OP_DSreg, eSI_reg9.284 -#define Xv OP_DSreg, eSI_reg9.285 -#define Yb OP_ESreg, eDI_reg9.286 -#define Yv OP_ESreg, eDI_reg9.287 -#define DSBX OP_DSreg, eBX_reg9.288 -9.289 -#define es OP_REG, es_reg9.290 -#define ss OP_REG, ss_reg9.291 -#define cs OP_REG, cs_reg9.292 -#define ds OP_REG, ds_reg9.293 -#define fs OP_REG, fs_reg9.294 -#define gs OP_REG, gs_reg9.295 -9.296 -#define MX OP_MMX, 09.297 -#define XM OP_XMM, 09.298 -#define EM OP_EM, v_mode9.299 -#define EX OP_EX, v_mode9.300 -#define MS OP_MS, v_mode9.301 -#define XS OP_XS, v_mode9.302 -#define OPSUF OP_3DNowSuffix, 09.303 -#define OPSIMD OP_SIMD_Suffix, 09.304 -9.305 -#define cond_jump_flag NULL, cond_jump_mode9.306 -#define loop_jcxz_flag NULL, loop_jcxz_mode9.307 -9.308 -/* bits in sizeflag */9.309 -#define SUFFIX_ALWAYS 49.310 -#define AFLAG 29.311 -#define DFLAG 19.312 -9.313 -#define b_mode 1 /* byte operand */9.314 -#define v_mode 2 /* operand size depends on prefixes */9.315 -#define w_mode 3 /* word operand */9.316 -#define d_mode 4 /* double word operand */9.317 -#define q_mode 5 /* quad word operand */9.318 -#define t_mode 6 /* ten-byte operand */9.319 -#define x_mode 7 /* 16-byte XMM operand */9.320 -#define m_mode 8 /* d_mode in 32bit, q_mode in 64bit mode. */9.321 -#define cond_jump_mode 99.322 -#define loop_jcxz_mode 109.323 -#define dq_mode 11 /* operand size depends on REX prefixes. */9.324 -#define dqw_mode 12 /* registers like dq_mode, memory like w_mode. */9.325 -#define f_mode 13 /* 4- or 6-byte pointer operand */9.326 -#define const_1_mode 149.327 -9.328 -#define es_reg 1009.329 -#define cs_reg 1019.330 -#define ss_reg 1029.331 -#define ds_reg 1039.332 -#define fs_reg 1049.333 -#define gs_reg 1059.334 -9.335 -#define eAX_reg 1089.336 -#define eCX_reg 1099.337 -#define eDX_reg 1109.338 -#define eBX_reg 1119.339 -#define eSP_reg 1129.340 -#define eBP_reg 1139.341 -#define eSI_reg 1149.342 -#define eDI_reg 1159.343 -9.344 -#define al_reg 1169.345 -#define cl_reg 1179.346 -#define dl_reg 1189.347 -#define bl_reg 1199.348 -#define ah_reg 1209.349 -#define ch_reg 1219.350 -#define dh_reg 1229.351 -#define bh_reg 1239.352 -9.353 -#define ax_reg 1249.354 -#define cx_reg 1259.355 -#define dx_reg 1269.356 -#define bx_reg 1279.357 -#define sp_reg 1289.358 -#define bp_reg 1299.359 -#define si_reg 1309.360 -#define di_reg 1319.361 -9.362 -#define rAX_reg 1329.363 -#define rCX_reg 1339.364 -#define rDX_reg 1349.365 -#define rBX_reg 1359.366 -#define rSP_reg 1369.367 -#define rBP_reg 1379.368 -#define rSI_reg 1389.369 -#define rDI_reg 1399.370 -9.371 -#define indir_dx_reg 1509.372 -9.373 -#define FLOATCODE 19.374 -#define USE_GROUPS 29.375 -#define USE_PREFIX_USER_TABLE 39.376 -#define X86_64_SPECIAL 49.377 -9.378 -#define FLOAT NULL, NULL, FLOATCODE, NULL, 0, NULL, 09.379 -9.380 -#define GRP1b NULL, NULL, USE_GROUPS, NULL, 0, NULL, 09.381 -#define GRP1S NULL, NULL, USE_GROUPS, NULL, 1, NULL, 09.382 -#define GRP1Ss NULL, NULL, USE_GROUPS, NULL, 2, NULL, 09.383 -#define GRP2b NULL, NULL, USE_GROUPS, NULL, 3, NULL, 09.384 -#define GRP2S NULL, NULL, USE_GROUPS, NULL, 4, NULL, 09.385 -#define GRP2b_one NULL, NULL, USE_GROUPS, NULL, 5, NULL, 09.386 -#define GRP2S_one NULL, NULL, USE_GROUPS, NULL, 6, NULL, 09.387 -#define GRP2b_cl NULL, NULL, USE_GROUPS, NULL, 7, NULL, 09.388 -#define GRP2S_cl NULL, NULL, USE_GROUPS, NULL, 8, NULL, 09.389 -#define GRP3b NULL, NULL, USE_GROUPS, NULL, 9, NULL, 09.390 -#define GRP3S NULL, NULL, USE_GROUPS, NULL, 10, NULL, 09.391 -#define GRP4 NULL, NULL, USE_GROUPS, NULL, 11, NULL, 09.392 -#define GRP5 NULL, NULL, USE_GROUPS, NULL, 12, NULL, 09.393 -#define GRP6 NULL, NULL, USE_GROUPS, NULL, 13, NULL, 09.394 -#define GRP7 NULL, NULL, USE_GROUPS, NULL, 14, NULL, 09.395 -#define GRP8 NULL, NULL, USE_GROUPS, NULL, 15, NULL, 09.396 -#define GRP9 NULL, NULL, USE_GROUPS, NULL, 16, NULL, 09.397 -#define GRP10 NULL, NULL, USE_GROUPS, NULL, 17, NULL, 09.398 -#define GRP11 NULL, NULL, USE_GROUPS, NULL, 18, NULL, 09.399 -#define GRP12 NULL, NULL, USE_GROUPS, NULL, 19, NULL, 09.400 -#define GRP13 NULL, NULL, USE_GROUPS, NULL, 20, NULL, 09.401 -#define GRP14 NULL, NULL, USE_GROUPS, NULL, 21, NULL, 09.402 -#define GRPAMD NULL, NULL, USE_GROUPS, NULL, 22, NULL, 09.403 -#define GRPPADLCK1 NULL, NULL, USE_GROUPS, NULL, 23, NULL, 09.404 -#define GRPPADLCK2 NULL, NULL, USE_GROUPS, NULL, 24, NULL, 09.405 -9.406 -#define PREGRP0 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 0, NULL, 09.407 -#define PREGRP1 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 1, NULL, 09.408 -#define PREGRP2 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 2, NULL, 09.409 -#define PREGRP3 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 3, NULL, 09.410 -#define PREGRP4 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 4, NULL, 09.411 -#define PREGRP5 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 5, NULL, 09.412 -#define PREGRP6 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 6, NULL, 09.413 -#define PREGRP7 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 7, NULL, 09.414 -#define PREGRP8 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 8, NULL, 09.415 -#define PREGRP9 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 9, NULL, 09.416 -#define PREGRP10 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 10, NULL, 09.417 -#define PREGRP11 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 11, NULL, 09.418 -#define PREGRP12 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 12, NULL, 09.419 -#define PREGRP13 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 13, NULL, 09.420 -#define PREGRP14 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 14, NULL, 09.421 -#define PREGRP15 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 15, NULL, 09.422 -#define PREGRP16 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 16, NULL, 09.423 -#define PREGRP17 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 17, NULL, 09.424 -#define PREGRP18 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 18, NULL, 09.425 -#define PREGRP19 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 19, NULL, 09.426 -#define PREGRP20 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 20, NULL, 09.427 -#define PREGRP21 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 21, NULL, 09.428 -#define PREGRP22 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 22, NULL, 09.429 -#define PREGRP23 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 23, NULL, 09.430 -#define PREGRP24 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 24, NULL, 09.431 -#define PREGRP25 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 25, NULL, 09.432 -#define PREGRP26 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 26, NULL, 09.433 -#define PREGRP27 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 27, NULL, 09.434 -#define PREGRP28 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 28, NULL, 09.435 -#define PREGRP29 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 29, NULL, 09.436 -#define PREGRP30 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 30, NULL, 09.437 -#define PREGRP31 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 31, NULL, 09.438 -#define PREGRP32 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 32, NULL, 09.439 -9.440 -#define X86_64_0 NULL, NULL, X86_64_SPECIAL, NULL, 0, NULL, 09.441 -9.442 -typedef void (*op_rtn) (int bytemode, int sizeflag);9.443 -9.444 -struct dis386 {9.445 - const char *name;9.446 - op_rtn op1;9.447 - int bytemode1;9.448 - op_rtn op2;9.449 - int bytemode2;9.450 - op_rtn op3;9.451 - int bytemode3;9.452 -};9.453 -9.454 -/* Upper case letters in the instruction names here are macros.9.455 - 'A' => print 'b' if no register operands or suffix_always is true9.456 - 'B' => print 'b' if suffix_always is true9.457 - 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand9.458 - . size prefix9.459 - 'E' => print 'e' if 32-bit form of jcxz9.460 - 'F' => print 'w' or 'l' depending on address size prefix (loop insns)9.461 - 'H' => print ",pt" or ",pn" branch hint9.462 - 'I' => honor following macro letter even in Intel mode (implemented only9.463 - . for some of the macro letters)9.464 - 'J' => print 'l'9.465 - 'L' => print 'l' if suffix_always is true9.466 - 'N' => print 'n' if instruction has no wait "prefix"9.467 - 'O' => print 'd', or 'o'9.468 - 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,9.469 - . or suffix_always is true. print 'q' if rex prefix is present.9.470 - 'Q' => print 'w', 'l' or 'q' if no register operands or suffix_always9.471 - . is true9.472 - 'R' => print 'w', 'l' or 'q' ("wd" or "dq" in intel mode)9.473 - 'S' => print 'w', 'l' or 'q' if suffix_always is true9.474 - 'T' => print 'q' in 64bit mode and behave as 'P' otherwise9.475 - 'U' => print 'q' in 64bit mode and behave as 'Q' otherwise9.476 - 'W' => print 'b' or 'w' ("w" or "de" in intel mode)9.477 - 'X' => print 's', 'd' depending on data16 prefix (for XMM)9.478 - 'Y' => 'q' if instruction has an REX 64bit overwrite prefix9.479 -9.480 - Many of the above letters print nothing in Intel mode. See "putop"9.481 - for the details.9.482 -9.483 - Braces '{' and '}', and vertical bars '|', indicate alternative9.484 - mnemonic strings for AT&T, Intel, X86_64 AT&T, and X86_64 Intel9.485 - modes. In cases where there are only two alternatives, the X86_649.486 - instruction is reserved, and "(bad)" is printed.9.487 -*/9.488 -9.489 -static const struct dis386 dis386[] = {9.490 - /* 00 */9.491 - { "addB", Eb, Gb, XX },9.492 - { "addS", Ev, Gv, XX },9.493 - { "addB", Gb, Eb, XX },9.494 - { "addS", Gv, Ev, XX },9.495 - { "addB", AL, Ib, XX },9.496 - { "addS", eAX, Iv, XX },9.497 - { "push{T|}", es, XX, XX },9.498 - { "pop{T|}", es, XX, XX },9.499 - /* 08 */9.500 - { "orB", Eb, Gb, XX },9.501 - { "orS", Ev, Gv, XX },9.502 - { "orB", Gb, Eb, XX },9.503 - { "orS", Gv, Ev, XX },9.504 - { "orB", AL, Ib, XX },9.505 - { "orS", eAX, Iv, XX },9.506 - { "push{T|}", cs, XX, XX },9.507 - { "(bad)", XX, XX, XX }, /* 0x0f extended opcode escape */9.508 - /* 10 */9.509 - { "adcB", Eb, Gb, XX },9.510 - { "adcS", Ev, Gv, XX },9.511 - { "adcB", Gb, Eb, XX },9.512 - { "adcS", Gv, Ev, XX },9.513 - { "adcB", AL, Ib, XX },9.514 - { "adcS", eAX, Iv, XX },9.515 - { "push{T|}", ss, XX, XX },9.516 - { "popT|}", ss, XX, XX },9.517 - /* 18 */9.518 - { "sbbB", Eb, Gb, XX },9.519 - { "sbbS", Ev, Gv, XX },9.520 - { "sbbB", Gb, Eb, XX },9.521 - { "sbbS", Gv, Ev, XX },9.522 - { "sbbB", AL, Ib, XX },9.523 - { "sbbS", eAX, Iv, XX },9.524 - { "push{T|}", ds, XX, XX },9.525 - { "pop{T|}", ds, XX, XX },9.526 - /* 20 */9.527 - { "andB", Eb, Gb, XX },9.528 - { "andS", Ev, Gv, XX },9.529 - { "andB", Gb, Eb, XX },9.530 - { "andS", Gv, Ev, XX },9.531 - { "andB", AL, Ib, XX },9.532 - { "andS", eAX, Iv, XX },9.533 - { "(bad)", XX, XX, XX }, /* SEG ES prefix */9.534 - { "daa{|}", XX, XX, XX },9.535 - /* 28 */9.536 - { "subB", Eb, Gb, XX },9.537 - { "subS", Ev, Gv, XX },9.538 - { "subB", Gb, Eb, XX },9.539 - { "subS", Gv, Ev, XX },9.540 - { "subB", AL, Ib, XX },9.541 - { "subS", eAX, Iv, XX },9.542 - { "(bad)", XX, XX, XX }, /* SEG CS prefix */9.543 - { "das{|}", XX, XX, XX },9.544 - /* 30 */9.545 - { "xorB", Eb, Gb, XX },9.546 - { "xorS", Ev, Gv, XX },9.547 - { "xorB", Gb, Eb, XX },9.548 - { "xorS", Gv, Ev, XX },9.549 - { "xorB", AL, Ib, XX },9.550 - { "xorS", eAX, Iv, XX },9.551 - { "(bad)", XX, XX, XX }, /* SEG SS prefix */9.552 - { "aaa{|}", XX, XX, XX },9.553 - /* 38 */9.554 - { "cmpB", Eb, Gb, XX },9.555 - { "cmpS", Ev, Gv, XX },9.556 - { "cmpB", Gb, Eb, XX },9.557 - { "cmpS", Gv, Ev, XX },9.558 - { "cmpB", AL, Ib, XX },9.559 - { "cmpS", eAX, Iv, XX },9.560 - { "(bad)", XX, XX, XX }, /* SEG DS prefix */9.561 - { "aas{|}", XX, XX, XX },9.562 - /* 40 */9.563 - { "inc{S|}", RMeAX, XX, XX },9.564 - { "inc{S|}", RMeCX, XX, XX },9.565 - { "inc{S|}", RMeDX, XX, XX },9.566 - { "inc{S|}", RMeBX, XX, XX },9.567 - { "inc{S|}", RMeSP, XX, XX },9.568 - { "inc{S|}", RMeBP, XX, XX },9.569 - { "inc{S|}", RMeSI, XX, XX },9.570 - { "inc{S|}", RMeDI, XX, XX },9.571 - /* 48 */9.572 - { "dec{S|}", RMeAX, XX, XX },9.573 - { "dec{S|}", RMeCX, XX, XX },9.574 - { "dec{S|}", RMeDX, XX, XX },9.575 - { "dec{S|}", RMeBX, XX, XX },9.576 - { "dec{S|}", RMeSP, XX, XX },9.577 - { "dec{S|}", RMeBP, XX, XX },9.578 - { "dec{S|}", RMeSI, XX, XX },9.579 - { "dec{S|}", RMeDI, XX, XX },9.580 - /* 50 */9.581 - { "pushS", RMrAX, XX, XX },9.582 - { "pushS", RMrCX, XX, XX },9.583 - { "pushS", RMrDX, XX, XX },9.584 - { "pushS", RMrBX, XX, XX },9.585 - { "pushS", RMrSP, XX, XX },9.586 - { "pushS", RMrBP, XX, XX },9.587 - { "pushS", RMrSI, XX, XX },9.588 - { "pushS", RMrDI, XX, XX },9.589 - /* 58 */9.590 - { "popS", RMrAX, XX, XX },9.591 - { "popS", RMrCX, XX, XX },9.592 - { "popS", RMrDX, XX, XX },9.593 - { "popS", RMrBX, XX, XX },9.594 - { "popS", RMrSP, XX, XX },9.595 - { "popS", RMrBP, XX, XX },9.596 - { "popS", RMrSI, XX, XX },9.597 - { "popS", RMrDI, XX, XX },9.598 - /* 60 */9.599 - { "pusha{P|}", XX, XX, XX },9.600 - { "popa{P|}", XX, XX, XX },9.601 - { "bound{S|}", Gv, Ma, XX },9.602 - { X86_64_0 },9.603 - { "(bad)", XX, XX, XX }, /* seg fs */9.604 - { "(bad)", XX, XX, XX }, /* seg gs */9.605 - { "(bad)", XX, XX, XX }, /* op size prefix */9.606 - { "(bad)", XX, XX, XX }, /* adr size prefix */9.607 - /* 68 */9.608 - { "pushT", Iq, XX, XX },9.609 - { "imulS", Gv, Ev, Iv },9.610 - { "pushT", sIb, XX, XX },9.611 - { "imulS", Gv, Ev, sIb },9.612 - { "ins{b||b|}", Yb, indirDX, XX },9.613 - { "ins{R||R|}", Yv, indirDX, XX },9.614 - { "outs{b||b|}", indirDX, Xb, XX },9.615 - { "outs{R||R|}", indirDX, Xv, XX },9.616 - /* 70 */9.617 - { "joH", Jb, XX, cond_jump_flag },9.618 - { "jnoH", Jb, XX, cond_jump_flag },9.619 - { "jbH", Jb, XX, cond_jump_flag },9.620 - { "jaeH", Jb, XX, cond_jump_flag },9.621 - { "jeH", Jb, XX, cond_jump_flag },9.622 - { "jneH", Jb, XX, cond_jump_flag },9.623 - { "jbeH", Jb, XX, cond_jump_flag },9.624 - { "jaH", Jb, XX, cond_jump_flag },9.625 - /* 78 */9.626 - { "jsH", Jb, XX, cond_jump_flag },9.627 - { "jnsH", Jb, XX, cond_jump_flag },9.628 - { "jpH", Jb, XX, cond_jump_flag },9.629 - { "jnpH", Jb, XX, cond_jump_flag },9.630 - { "jlH", Jb, XX, cond_jump_flag },9.631 - { "jgeH", Jb, XX, cond_jump_flag },9.632 - { "jleH", Jb, XX, cond_jump_flag },9.633 - { "jgH", Jb, XX, cond_jump_flag },9.634 - /* 80 */9.635 - { GRP1b },9.636 - { GRP1S },9.637 - { "(bad)", XX, XX, XX },9.638 - { GRP1Ss },9.639 - { "testB", Eb, Gb, XX },9.640 - { "testS", Ev, Gv, XX },9.641 - { "xchgB", Eb, Gb, XX },9.642 - { "xchgS", Ev, Gv, XX },9.643 - /* 88 */9.644 - { "movB", Eb, Gb, XX },9.645 - { "movS", Ev, Gv, XX },9.646 - { "movB", Gb, Eb, XX },9.647 - { "movS", Gv, Ev, XX },9.648 - { "movQ", Ev, Sw, XX },9.649 - { "leaS", Gv, M, XX },9.650 - { "movQ", Sw, Ev, XX },9.651 - { "popU", Ev, XX, XX },9.652 - /* 90 */9.653 - { "nop", NOP_Fixup, 0, XX, XX },9.654 - { "xchgS", RMeCX, eAX, XX },9.655 - { "xchgS", RMeDX, eAX, XX },9.656 - { "xchgS", RMeBX, eAX, XX },9.657 - { "xchgS", RMeSP, eAX, XX },9.658 - { "xchgS", RMeBP, eAX, XX },9.659 - { "xchgS", RMeSI, eAX, XX },9.660 - { "xchgS", RMeDI, eAX, XX },9.661 - /* 98 */9.662 - { "cW{tR||tR|}", XX, XX, XX },9.663 - { "cR{tO||tO|}", XX, XX, XX },9.664 - { "Jcall{T|}", Ap, XX, XX },9.665 - { "(bad)", XX, XX, XX }, /* fwait */9.666 - { "pushfT", XX, XX, XX },9.667 - { "popfT", XX, XX, XX },9.668 - { "sahf{|}", XX, XX, XX },9.669 - { "lahf{|}", XX, XX, XX },9.670 - /* a0 */9.671 - { "movB", AL, Ob64, XX },9.672 - { "movS", eAX, Ov64, XX },9.673 - { "movB", Ob64, AL, XX },9.674 - { "movS", Ov64, eAX, XX },9.675 - { "movs{b||b|}", Yb, Xb, XX },9.676 - { "movs{R||R|}", Yv, Xv, XX },9.677 - { "cmps{b||b|}", Xb, Yb, XX },9.678 - { "cmps{R||R|}", Xv, Yv, XX },9.679 - /* a8 */9.680 - { "testB", AL, Ib, XX },9.681 - { "testS", eAX, Iv, XX },9.682 - { "stosB", Yb, AL, XX },9.683 - { "stosS", Yv, eAX, XX },9.684 - { "lodsB", AL, Xb, XX },9.685 - { "lodsS", eAX, Xv, XX },9.686 - { "scasB", AL, Yb, XX },9.687 - { "scasS", eAX, Yv, XX },9.688 - /* b0 */9.689 - { "movB", RMAL, Ib, XX },9.690 - { "movB", RMCL, Ib, XX },9.691 - { "movB", RMDL, Ib, XX },9.692 - { "movB", RMBL, Ib, XX },9.693 - { "movB", RMAH, Ib, XX },9.694 - { "movB", RMCH, Ib, XX },9.695 - { "movB", RMDH, Ib, XX },9.696 - { "movB", RMBH, Ib, XX },9.697 - /* b8 */9.698 - { "movS", RMeAX, Iv64, XX },9.699 - { "movS", RMeCX, Iv64, XX },9.700 - { "movS", RMeDX, Iv64, XX },9.701 - { "movS", RMeBX, Iv64, XX },9.702 - { "movS", RMeSP, Iv64, XX },9.703 - { "movS", RMeBP, Iv64, XX },9.704 - { "movS", RMeSI, Iv64, XX },9.705 - { "movS", RMeDI, Iv64, XX },9.706 - /* c0 */9.707 - { GRP2b },9.708 - { GRP2S },9.709 - { "retT", Iw, XX, XX },9.710 - { "retT", XX, XX, XX },9.711 - { "les{S|}", Gv, Mp, XX },9.712 - { "ldsS", Gv, Mp, XX },9.713 - { "movA", Eb, Ib, XX },9.714 - { "movQ", Ev, Iv, XX },9.715 - /* c8 */9.716 - { "enterT", Iw, Ib, XX },9.717 - { "leaveT", XX, XX, XX },9.718 - { "lretP", Iw, XX, XX },9.719 - { "lretP", XX, XX, XX },9.720 - { "int3", XX, XX, XX },9.721 - { "int", Ib, XX, XX },9.722 - { "into{|}", XX, XX, XX },9.723 - { "iretP", XX, XX, XX },9.724 - /* d0 */9.725 - { GRP2b_one },9.726 - { GRP2S_one },9.727 - { GRP2b_cl },9.728 - { GRP2S_cl },9.729 - { "aam{|}", sIb, XX, XX },9.730 - { "aad{|}", sIb, XX, XX },9.731 - { "(bad)", XX, XX, XX },9.732 - { "xlat", DSBX, XX, XX },9.733 - /* d8 */9.734 - { FLOAT },9.735 - { FLOAT },9.736 - { FLOAT },9.737 - { FLOAT },9.738 - { FLOAT },9.739 - { FLOAT },9.740 - { FLOAT },9.741 - { FLOAT },9.742 - /* e0 */9.743 - { "loopneFH", Jb, XX, loop_jcxz_flag },9.744 - { "loopeFH", Jb, XX, loop_jcxz_flag },9.745 - { "loopFH", Jb, XX, loop_jcxz_flag },9.746 - { "jEcxzH", Jb, XX, loop_jcxz_flag },9.747 - { "inB", AL, Ib, XX },9.748 - { "inS", eAX, Ib, XX },9.749 - { "outB", Ib, AL, XX },9.750 - { "outS", Ib, eAX, XX },9.751 - /* e8 */9.752 - { "callT", Jv, XX, XX },9.753 - { "jmpT", Jv, XX, XX },9.754 - { "Jjmp{T|}", Ap, XX, XX },9.755 - { "jmp", Jb, XX, XX },9.756 - { "inB", AL, indirDX, XX },9.757 - { "inS", eAX, indirDX, XX },9.758 - { "outB", indirDX, AL, XX },9.759 - { "outS", indirDX, eAX, XX },9.760 - /* f0 */9.761 - { "(bad)", XX, XX, XX }, /* lock prefix */9.762 - { "icebp", XX, XX, XX },9.763 - { "(bad)", XX, XX, XX }, /* repne */9.764 - { "(bad)", XX, XX, XX }, /* repz */9.765 - { "hlt", XX, XX, XX },9.766 - { "cmc", XX, XX, XX },9.767 - { GRP3b },9.768 - { GRP3S },9.769 - /* f8 */9.770 - { "clc", XX, XX, XX },9.771 - { "stc", XX, XX, XX },9.772 - { "cli", XX, XX, XX },9.773 - { "sti", XX, XX, XX },9.774 - { "cld", XX, XX, XX },9.775 - { "std", XX, XX, XX },9.776 - { GRP4 },9.777 - { GRP5 },9.778 -};9.779 -9.780 -static const struct dis386 dis386_twobyte[] = {9.781 - /* 00 */9.782 - { GRP6 },9.783 - { GRP7 },9.784 - { "larS", Gv, Ew, XX },9.785 - { "lslS", Gv, Ew, XX },9.786 - { "(bad)", XX, XX, XX },9.787 - { "syscall", XX, XX, XX },9.788 - { "clts", XX, XX, XX },9.789 - { "sysretP", XX, XX, XX },9.790 - /* 08 */9.791 - { "invd", XX, XX, XX },9.792 - { "wbinvd", XX, XX, XX },9.793 - { "(bad)", XX, XX, XX },9.794 - { "ud2a", XX, XX, XX },9.795 - { "(bad)", XX, XX, XX },9.796 - { GRPAMD },9.797 - { "femms", XX, XX, XX },9.798 - { "", MX, EM, OPSUF }, /* See OP_3DNowSuffix. */9.799 - /* 10 */9.800 - { PREGRP8 },9.801 - { PREGRP9 },9.802 - { PREGRP30 },9.803 - { "movlpX", EX, XM, SIMD_Fixup, 'h' },9.804 - { "unpcklpX", XM, EX, XX },9.805 - { "unpckhpX", XM, EX, XX },9.806 - { PREGRP31 },9.807 - { "movhpX", EX, XM, SIMD_Fixup, 'l' },9.808 - /* 18 */9.809 - { GRP14 },9.810 - { "(bad)", XX, XX, XX },9.811 - { "(bad)", XX, XX, XX },9.812 - { "(bad)", XX, XX, XX },9.813 - { "(bad)", XX, XX, XX },9.814 - { "(bad)", XX, XX, XX },9.815 - { "(bad)", XX, XX, XX },9.816 - { "(bad)", XX, XX, XX },9.817 - /* 20 */9.818 - { "movL", Rm, Cm, XX },9.819 - { "movL", Rm, Dm, XX },9.820 - { "movL", Cm, Rm, XX },9.821 - { "movL", Dm, Rm, XX },9.822 - { "movL", Rd, Td, XX },9.823 - { "(bad)", XX, XX, XX },9.824 - { "movL", Td, Rd, XX },9.825 - { "(bad)", XX, XX, XX },9.826 - /* 28 */9.827 - { "movapX", XM, EX, XX },9.828 - { "movapX", EX, XM, XX },9.829 - { PREGRP2 },9.830 - { "movntpX", Ev, XM, XX },9.831 - { PREGRP4 },9.832 - { PREGRP3 },9.833 - { "ucomisX", XM,EX, XX },9.834 - { "comisX", XM,EX, XX },9.835 - /* 30 */9.836 - { "wrmsr", XX, XX, XX },9.837 - { "rdtsc", XX, XX, XX },9.838 - { "rdmsr", XX, XX, XX },9.839 - { "rdpmc", XX, XX, XX },9.840 - { "sysenter", XX, XX, XX },9.841 - { "sysexit", XX, XX, XX },9.842 - { "(bad)", XX, XX, XX },9.843 - { "(bad)", XX, XX, XX },9.844 - /* 38 */9.845 - { "(bad)", XX, XX, XX },9.846 - { "(bad)", XX, XX, XX },9.847 - { "(bad)", XX, XX, XX },9.848 - { "(bad)", XX, XX, XX },9.849 - { "(bad)", XX, XX, XX },9.850 - { "(bad)", XX, XX, XX },9.851 - { "(bad)", XX, XX, XX },9.852 - { "(bad)", XX, XX, XX },9.853 - /* 40 */9.854 - { "cmovo", Gv, Ev, XX },9.855 - { "cmovno", Gv, Ev, XX },9.856 - { "cmovb", Gv, Ev, XX },9.857 - { "cmovae", Gv, Ev, XX },9.858 - { "cmove", Gv, Ev, XX },9.859 - { "cmovne", Gv, Ev, XX },9.860 - { "cmovbe", Gv, Ev, XX },9.861 - { "cmova", Gv, Ev, XX },9.862 - /* 48 */9.863 - { "cmovs", Gv, Ev, XX },9.864 - { "cmovns", Gv, Ev, XX },9.865 - { "cmovp", Gv, Ev, XX },9.866 - { "cmovnp", Gv, Ev, XX },9.867 - { "cmovl", Gv, Ev, XX },9.868 - { "cmovge", Gv, Ev, XX },9.869 - { "cmovle", Gv, Ev, XX },9.870 - { "cmovg", Gv, Ev, XX },9.871 - /* 50 */9.872 - { "movmskpX", Gdq, XS, XX },9.873 - { PREGRP13 },9.874 - { PREGRP12 },9.875 - { PREGRP11 },9.876 - { "andpX", XM, EX, XX },9.877 - { "andnpX", XM, EX, XX },9.878 - { "orpX", XM, EX, XX },9.879 - { "xorpX", XM, EX, XX },9.880 - /* 58 */9.881 - { PREGRP0 },9.882 - { PREGRP10 },9.883 - { PREGRP17 },9.884 - { PREGRP16 },9.885 - { PREGRP14 },9.886 - { PREGRP7 },9.887 - { PREGRP5 },9.888 - { PREGRP6 },9.889 - /* 60 */9.890 - { "punpcklbw", MX, EM, XX },9.891 - { "punpcklwd", MX, EM, XX },9.892 - { "punpckldq", MX, EM, XX },9.893 - { "packsswb", MX, EM, XX },9.894 - { "pcmpgtb", MX, EM, XX },9.895 - { "pcmpgtw", MX, EM, XX },9.896 - { "pcmpgtd", MX, EM, XX },9.897 - { "packuswb", MX, EM, XX },9.898 - /* 68 */9.899 - { "punpckhbw", MX, EM, XX },9.900 - { "punpckhwd", MX, EM, XX },9.901 - { "punpckhdq", MX, EM, XX },9.902 - { "packssdw", MX, EM, XX },9.903 - { PREGRP26 },9.904 - { PREGRP24 },9.905 - { "movd", MX, Edq, XX },9.906 - { PREGRP19 },9.907 - /* 70 */9.908 - { PREGRP22 },9.909 - { GRP10 },9.910 - { GRP11 },9.911 - { GRP12 },9.912 - { "pcmpeqb", MX, EM, XX },9.913 - { "pcmpeqw", MX, EM, XX },9.914 - { "pcmpeqd", MX, EM, XX },9.915 - { "emms", XX, XX, XX },9.916 - /* 78 */9.917 - { "(bad)", XX, XX, XX },9.918 - { "(bad)", XX, XX, XX },9.919 - { "(bad)", XX, XX, XX },9.920 - { "(bad)", XX, XX, XX },9.921 - { PREGRP28 },9.922 - { PREGRP29 },9.923 - { PREGRP23 },9.924 - { PREGRP20 },9.925 - /* 80 */9.926 - { "joH", Jv, XX, cond_jump_flag },9.927 - { "jnoH", Jv, XX, cond_jump_flag },9.928 - { "jbH", Jv, XX, cond_jump_flag },9.929 - { "jaeH", Jv, XX, cond_jump_flag },9.930 - { "jeH", Jv, XX, cond_jump_flag },9.931 - { "jneH", Jv, XX, cond_jump_flag },9.932 - { "jbeH", Jv, XX, cond_jump_flag },9.933 - { "jaH", Jv, XX, cond_jump_flag },9.934 - /* 88 */9.935 - { "jsH", Jv, XX, cond_jump_flag },9.936 - { "jnsH", Jv, XX, cond_jump_flag },9.937 - { "jpH", Jv, XX, cond_jump_flag },9.938 - { "jnpH", Jv, XX, cond_jump_flag },9.939 - { "jlH", Jv, XX, cond_jump_flag },9.940 - { "jgeH", Jv, XX, cond_jump_flag },9.941 - { "jleH", Jv, XX, cond_jump_flag },9.942 - { "jgH", Jv, XX, cond_jump_flag },9.943 - /* 90 */9.944 - { "seto", Eb, XX, XX },9.945 - { "setno", Eb, XX, XX },9.946 - { "setb", Eb, XX, XX },9.947 - { "setae", Eb, XX, XX },9.948 - { "sete", Eb, XX, XX },9.949 - { "setne", Eb, XX, XX },9.950 - { "setbe", Eb, XX, XX },9.951 - { "seta", Eb, XX, XX },9.952 - /* 98 */9.953 - { "sets", Eb, XX, XX },9.954 - { "setns", Eb, XX, XX },9.955 - { "setp", Eb, XX, XX },9.956 - { "setnp", Eb, XX, XX },9.957 - { "setl", Eb, XX, XX },9.958 - { "setge", Eb, XX, XX },9.959 - { "setle", Eb, XX, XX },9.960 - { "setg", Eb, XX, XX },9.961 - /* a0 */9.962 - { "pushT", fs, XX, XX },9.963 - { "popT", fs, XX, XX },9.964 - { "cpuid", XX, XX, XX },9.965 - { "btS", Ev, Gv, XX },9.966 - { "shldS", Ev, Gv, Ib },9.967 - { "shldS", Ev, Gv, CL },9.968 - { GRPPADLCK2 },9.969 - { GRPPADLCK1 },9.970 - /* a8 */9.971 - { "pushT", gs, XX, XX },9.972 - { "popT", gs, XX, XX },9.973 - { "rsm", XX, XX, XX },9.974 - { "btsS", Ev, Gv, XX },9.975 - { "shrdS", Ev, Gv, Ib },9.976 - { "shrdS", Ev, Gv, CL },9.977 - { GRP13 },9.978 - { "imulS", Gv, Ev, XX },9.979 - /* b0 */9.980 - { "cmpxchgB", Eb, Gb, XX },9.981 - { "cmpxchgS", Ev, Gv, XX },9.982 - { "lssS", Gv, Mp, XX },9.983 - { "btrS", Ev, Gv, XX },9.984 - { "lfsS", Gv, Mp, XX },9.985 - { "lgsS", Gv, Mp, XX },9.986 - { "movz{bR|x|bR|x}", Gv, Eb, XX },9.987 - { "movz{wR|x|wR|x}", Gv, Ew, XX }, /* yes, there really is movzww ! */9.988 - /* b8 */9.989 - { "(bad)", XX, XX, XX },9.990 - { "ud2b", XX, XX, XX },9.991 - { GRP8 },9.992 - { "btcS", Ev, Gv, XX },9.993 - { "bsfS", Gv, Ev, XX },9.994 - { "bsrS", Gv, Ev, XX },9.995 - { "movs{bR|x|bR|x}", Gv, Eb, XX },9.996 - { "movs{wR|x|wR|x}", Gv, Ew, XX }, /* yes, there really is movsww ! */9.997 - /* c0 */9.998 - { "xaddB", Eb, Gb, XX },9.999 - { "xaddS", Ev, Gv, XX },9.1000 - { PREGRP1 },9.1001 - { "movntiS", Ev, Gv, XX },9.1002 - { "pinsrw", MX, Edqw, Ib },9.1003 - { "pextrw", Gdq, MS, Ib },9.1004 - { "shufpX", XM, EX, Ib },9.1005 - { GRP9 },9.1006 - /* c8 */9.1007 - { "bswap", RMeAX, XX, XX },9.1008 - { "bswap", RMeCX, XX, XX },9.1009 - { "bswap", RMeDX, XX, XX },9.1010 - { "bswap", RMeBX, XX, XX },9.1011 - { "bswap", RMeSP, XX, XX },9.1012 - { "bswap", RMeBP, XX, XX },9.1013 - { "bswap", RMeSI, XX, XX },9.1014 - { "bswap", RMeDI, XX, XX },9.1015 - /* d0 */9.1016 - { PREGRP27 },9.1017 - { "psrlw", MX, EM, XX },9.1018 - { "psrld", MX, EM, XX },9.1019 - { "psrlq", MX, EM, XX },9.1020 - { "paddq", MX, EM, XX },9.1021 - { "pmullw", MX, EM, XX },9.1022 - { PREGRP21 },9.1023 - { "pmovmskb", Gdq, MS, XX },9.1024 - /* d8 */9.1025 - { "psubusb", MX, EM, XX },9.1026 - { "psubusw", MX, EM, XX },9.1027 - { "pminub", MX, EM, XX },9.1028 - { "pand", MX, EM, XX },9.1029 - { "paddusb", MX, EM, XX },9.1030 - { "paddusw", MX, EM, XX },9.1031 - { "pmaxub", MX, EM, XX },9.1032 - { "pandn", MX, EM, XX },9.1033 - /* e0 */9.1034 - { "pavgb", MX, EM, XX },9.1035 - { "psraw", MX, EM, XX },9.1036 - { "psrad", MX, EM, XX },9.1037 - { "pavgw", MX, EM, XX },9.1038 - { "pmulhuw", MX, EM, XX },9.1039 - { "pmulhw", MX, EM, XX },9.1040 - { PREGRP15 },9.1041 - { PREGRP25 },9.1042 - /* e8 */9.1043 - { "psubsb", MX, EM, XX },9.1044 - { "psubsw", MX, EM, XX },9.1045 - { "pminsw", MX, EM, XX },9.1046 - { "por", MX, EM, XX },9.1047 - { "paddsb", MX, EM, XX },9.1048 - { "paddsw", MX, EM, XX },9.1049 - { "pmaxsw", MX, EM, XX },9.1050 - { "pxor", MX, EM, XX },9.1051 - /* f0 */9.1052 - { PREGRP32 },9.1053 - { "psllw", MX, EM, XX },9.1054 - { "pslld", MX, EM, XX },9.1055 - { "psllq", MX, EM, XX },9.1056 - { "pmuludq", MX, EM, XX },9.1057 - { "pmaddwd", MX, EM, XX },9.1058 - { "psadbw", MX, EM, XX },9.1059 - { PREGRP18 },9.1060 - /* f8 */9.1061 - { "psubb", MX, EM, XX },9.1062 - { "psubw", MX, EM, XX },9.1063 - { "psubd", MX, EM, XX },9.1064 - { "psubq", MX, EM, XX },9.1065 - { "paddb", MX, EM, XX },9.1066 - { "paddw", MX, EM, XX },9.1067 - { "paddd", MX, EM, XX },9.1068 - { "(bad)", XX, XX, XX }9.1069 -};9.1070 -9.1071 -static const unsigned char onebyte_has_modrm[256] = {9.1072 - /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */9.1073 - /* ------------------------------- */9.1074 - /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */9.1075 - /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */9.1076 - /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */9.1077 - /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */9.1078 - /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */9.1079 - /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */9.1080 - /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */9.1081 - /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */9.1082 - /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */9.1083 - /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */9.1084 - /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */9.1085 - /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */9.1086 - /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */9.1087 - /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */9.1088 - /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */9.1089 - /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */9.1090 - /* ------------------------------- */9.1091 - /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */9.1092 -};9.1093 -9.1094 -static const unsigned char twobyte_has_modrm[256] = {9.1095 - /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */9.1096 - /* ------------------------------- */9.1097 - /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */9.1098 - /* 10 */ 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, /* 1f */9.1099 - /* 20 */ 1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1, /* 2f */9.1100 - /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */9.1101 - /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */9.1102 - /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */9.1103 - /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */9.1104 - /* 70 */ 1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1, /* 7f */9.1105 - /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */9.1106 - /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */9.1107 - /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */9.1108 - /* b0 */ 1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1, /* bf */9.1109 - /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */9.1110 - /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */9.1111 - /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */9.1112 - /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 /* ff */9.1113 - /* ------------------------------- */9.1114 - /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */9.1115 -};9.1116 -9.1117 -static const unsigned char twobyte_uses_SSE_prefix[256] = {9.1118 - /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */9.1119 - /* ------------------------------- */9.1120 - /* 00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0f */9.1121 - /* 10 */ 1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0, /* 1f */9.1122 - /* 20 */ 0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0, /* 2f */9.1123 - /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */9.1124 - /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */9.1125 - /* 50 */ 0,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* 5f */9.1126 - /* 60 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1, /* 6f */9.1127 - /* 70 */ 1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1, /* 7f */9.1128 - /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */9.1129 - /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 9f */9.1130 - /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* af */9.1131 - /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* bf */9.1132 - /* c0 */ 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* cf */9.1133 - /* d0 */ 1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, /* df */9.1134 - /* e0 */ 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, /* ef */9.1135 - /* f0 */ 1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0 /* ff */9.1136 - /* ------------------------------- */9.1137 - /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */9.1138 -};9.1139 -9.1140 -static char obuf[100];9.1141 -static char *obufp;9.1142 -static char scratchbuf[100];9.1143 -static unsigned char *start_codep;9.1144 -static unsigned char *insn_codep;9.1145 -static unsigned char *codep;9.1146 -static disassemble_info *the_info;9.1147 -static int mod;9.1148 -static int rm;9.1149 -static int reg;9.1150 -static unsigned char need_modrm;9.1151 -9.1152 -/* If we are accessing mod/rm/reg without need_modrm set, then the9.1153 - values are stale. Hitting this abort likely indicates that you9.1154 - need to update onebyte_has_modrm or twobyte_has_modrm. */9.1155 -#define MODRM_CHECK if (!need_modrm) abort ()9.1156 -9.1157 -static const char **names64;9.1158 -static const char **names32;9.1159 -static const char **names16;9.1160 -static const char **names8;9.1161 -static const char **names8rex;9.1162 -static const char **names_seg;9.1163 -static const char **index16;9.1164 -9.1165 -static const char *intel_names64[] = {9.1166 - "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",9.1167 - "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"9.1168 -};9.1169 -static const char *intel_names32[] = {9.1170 - "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",9.1171 - "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"9.1172 -};9.1173 -static const char *intel_names16[] = {9.1174 - "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",9.1175 - "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"9.1176 -};9.1177 -static const char *intel_names8[] = {9.1178 - "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",9.1179 -};9.1180 -static const char *intel_names8rex[] = {9.1181 - "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",9.1182 - "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"9.1183 -};9.1184 -static const char *intel_names_seg[] = {9.1185 - "es", "cs", "ss", "ds", "fs", "gs", "?", "?",9.1186 -};9.1187 -static const char *intel_index16[] = {9.1188 - "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"9.1189 -};9.1190 -9.1191 -static const char *att_names64[] = {9.1192 - "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",9.1193 - "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"9.1194 -};9.1195 -static const char *att_names32[] = {9.1196 - "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",9.1197 - "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"9.1198 -};9.1199 -static const char *att_names16[] = {9.1200 - "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",9.1201 - "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"9.1202 -};9.1203 -static const char *att_names8[] = {9.1204 - "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",9.1205 -};9.1206 -static const char *att_names8rex[] = {9.1207 - "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",9.1208 - "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"9.1209 -};9.1210 -static const char *att_names_seg[] = {9.1211 - "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",9.1212 -};9.1213 -static const char *att_index16[] = {9.1214 - "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"9.1215 -};9.1216 -9.1217 -static const struct dis386 grps[][8] = {9.1218 - /* GRP1b */9.1219 - {9.1220 - { "addA", Eb, Ib, XX },9.1221 - { "orA", Eb, Ib, XX },9.1222 - { "adcA", Eb, Ib, XX },9.1223 - { "sbbA", Eb, Ib, XX },9.1224 - { "andA", Eb, Ib, XX },9.1225 - { "subA", Eb, Ib, XX },9.1226 - { "xorA", Eb, Ib, XX },9.1227 - { "cmpA", Eb, Ib, XX }9.1228 - },9.1229 - /* GRP1S */9.1230 - {9.1231 - { "addQ", Ev, Iv, XX },9.1232 - { "orQ", Ev, Iv, XX },9.1233 - { "adcQ", Ev, Iv, XX },9.1234 - { "sbbQ", Ev, Iv, XX },9.1235 - { "andQ", Ev, Iv, XX },9.1236 - { "subQ", Ev, Iv, XX },9.1237 - { "xorQ", Ev, Iv, XX },9.1238 - { "cmpQ", Ev, Iv, XX }9.1239 - },9.1240 - /* GRP1Ss */9.1241 - {9.1242 - { "addQ", Ev, sIb, XX },9.1243 - { "orQ", Ev, sIb, XX },9.1244 - { "adcQ", Ev, sIb, XX },9.1245 - { "sbbQ", Ev, sIb, XX },9.1246 - { "andQ", Ev, sIb, XX },9.1247 - { "subQ", Ev, sIb, XX },9.1248 - { "xorQ", Ev, sIb, XX },9.1249 - { "cmpQ", Ev, sIb, XX }9.1250 - },9.1251 - /* GRP2b */9.1252 - {9.1253 - { "rolA", Eb, Ib, XX },9.1254 - { "rorA", Eb, Ib, XX },9.1255 - { "rclA", Eb, Ib, XX },9.1256 - { "rcrA", Eb, Ib, XX },9.1257 - { "shlA", Eb, Ib, XX },9.1258 - { "shrA", Eb, Ib, XX },9.1259 - { "(bad)", XX, XX, XX },9.1260 - { "sarA", Eb, Ib, XX },9.1261 - },9.1262 - /* GRP2S */9.1263 - {9.1264 - { "rolQ", Ev, Ib, XX },9.1265 - { "rorQ", Ev, Ib, XX },9.1266 - { "rclQ", Ev, Ib, XX },9.1267 - { "rcrQ", Ev, Ib, XX },9.1268 - { "shlQ", Ev, Ib, XX },9.1269 - { "shrQ", Ev, Ib, XX },9.1270 - { "(bad)", XX, XX, XX },9.1271 - { "sarQ", Ev, Ib, XX },9.1272 - },9.1273 - /* GRP2b_one */9.1274 - {9.1275 - { "rolA", Eb, I1, XX },9.1276 - { "rorA", Eb, I1, XX },9.1277 - { "rclA", Eb, I1, XX },9.1278 - { "rcrA", Eb, I1, XX },9.1279 - { "shlA", Eb, I1, XX },9.1280 - { "shrA", Eb, I1, XX },9.1281 - { "(bad)", XX, XX, XX },9.1282 - { "sarA", Eb, I1, XX },9.1283 - },9.1284 - /* GRP2S_one */9.1285 - {9.1286 - { "rolQ", Ev, I1, XX },9.1287 - { "rorQ", Ev, I1, XX },9.1288 - { "rclQ", Ev, I1, XX },9.1289 - { "rcrQ", Ev, I1, XX },9.1290 - { "shlQ", Ev, I1, XX },9.1291 - { "shrQ", Ev, I1, XX },9.1292 - { "(bad)", XX, XX, XX},9.1293 - { "sarQ", Ev, I1, XX },9.1294 - },9.1295 - /* GRP2b_cl */9.1296 - {9.1297 - { "rolA", Eb, CL, XX },9.1298 - { "rorA", Eb, CL, XX },9.1299 - { "rclA", Eb, CL, XX },9.1300 - { "rcrA", Eb, CL, XX },9.1301 - { "shlA", Eb, CL, XX },9.1302 - { "shrA", Eb, CL, XX },9.1303 - { "(bad)", XX, XX, XX },9.1304 - { "sarA", Eb, CL, XX },9.1305 - },9.1306 - /* GRP2S_cl */9.1307 - {9.1308 - { "rolQ", Ev, CL, XX },9.1309 - { "rorQ", Ev, CL, XX },9.1310 - { "rclQ", Ev, CL, XX },9.1311 - { "rcrQ", Ev, CL, XX },9.1312 - { "shlQ", Ev, CL, XX },9.1313 - { "shrQ", Ev, CL, XX },9.1314 - { "(bad)", XX, XX, XX },9.1315 - { "sarQ", Ev, CL, XX }9.1316 - },9.1317 - /* GRP3b */9.1318 - {9.1319 - { "testA", Eb, Ib, XX },9.1320 - { "(bad)", Eb, XX, XX },9.1321 - { "notA", Eb, XX, XX },9.1322 - { "negA", Eb, XX, XX },9.1323 - { "mulA", Eb, XX, XX }, /* Don't print the implicit %al register, */9.1324 - { "imulA", Eb, XX, XX }, /* to distinguish these opcodes from other */9.1325 - { "divA", Eb, XX, XX }, /* mul/imul opcodes. Do the same for div */9.1326 - { "idivA", Eb, XX, XX } /* and idiv for consistency. */9.1327 - },9.1328 - /* GRP3S */9.1329 - {9.1330 - { "testQ", Ev, Iv, XX },9.1331 - { "(bad)", XX, XX, XX },9.1332 - { "notQ", Ev, XX, XX },9.1333 - { "negQ", Ev, XX, XX },9.1334 - { "mulQ", Ev, XX, XX }, /* Don't print the implicit register. */9.1335 - { "imulQ", Ev, XX, XX },9.1336 - { "divQ", Ev, XX, XX },9.1337 - { "idivQ", Ev, XX, XX },9.1338 - },9.1339 - /* GRP4 */9.1340 - {9.1341 - { "incA", Eb, XX, XX },9.1342 - { "decA", Eb, XX, XX },9.1343 - { "(bad)", XX, XX, XX },9.1344 - { "(bad)", XX, XX, XX },9.1345 - { "(bad)", XX, XX, XX },9.1346 - { "(bad)", XX, XX, XX },9.1347 - { "(bad)", XX, XX, XX },9.1348 - { "(bad)", XX, XX, XX },9.1349 - },9.1350 - /* GRP5 */9.1351 - {9.1352 - { "incQ", Ev, XX, XX },9.1353 - { "decQ", Ev, XX, XX },9.1354 - { "callT", indirEv, XX, XX },9.1355 - { "JcallT", indirEp, XX, XX },9.1356 - { "jmpT", indirEv, XX, XX },9.1357 - { "JjmpT", indirEp, XX, XX },9.1358 - { "pushU", Ev, XX, XX },9.1359 - { "(bad)", XX, XX, XX },9.1360 - },9.1361 - /* GRP6 */9.1362 - {9.1363 - { "sldtQ", Ev, XX, XX },9.1364 - { "strQ", Ev, XX, XX },9.1365 - { "lldt", Ew, XX, XX },9.1366 - { "ltr", Ew, XX, XX },9.1367 - { "verr", Ew, XX, XX },9.1368 - { "verw", Ew, XX, XX },9.1369 - { "(bad)", XX, XX, XX },9.1370 - { "(bad)", XX, XX, XX }9.1371 - },9.1372 - /* GRP7 */9.1373 - {9.1374 - { "sgdtIQ", M, XX, XX },9.1375 - { "sidtIQ", PNI_Fixup, 0, XX, XX },9.1376 - { "lgdt{Q|Q||}", M, XX, XX },9.1377 - { "lidt{Q|Q||}", M, XX, XX },9.1378 - { "smswQ", Ev, XX, XX },9.1379 - { "(bad)", XX, XX, XX },9.1380 - { "lmsw", Ew, XX, XX },9.1381 - { "invlpg", INVLPG_Fixup, w_mode, XX, XX },9.1382 - },9.1383 - /* GRP8 */9.1384 - {9.1385 - { "(bad)", XX, XX, XX },9.1386 - { "(bad)", XX, XX, XX },9.1387 - { "(bad)", XX, XX, XX },9.1388 - { "(bad)", XX, XX, XX },9.1389 - { "btQ", Ev, Ib, XX },9.1390 - { "btsQ", Ev, Ib, XX },9.1391 - { "btrQ", Ev, Ib, XX },9.1392 - { "btcQ", Ev, Ib, XX },9.1393 - },9.1394 - /* GRP9 */9.1395 - {9.1396 - { "(bad)", XX, XX, XX },9.1397 - { "cmpxchg8b", Eq, XX, XX },9.1398 - { "(bad)", XX, XX, XX },9.1399 - { "(bad)", XX, XX, XX },9.1400 - { "(bad)", XX, XX, XX },9.1401 - { "(bad)", XX, XX, XX },9.1402 - { "(bad)", XX, XX, XX },9.1403 - { "(bad)", XX, XX, XX },9.1404 - },9.1405 - /* GRP10 */9.1406 - {9.1407 - { "(bad)", XX, XX, XX },9.1408 - { "(bad)", XX, XX, XX },9.1409 - { "psrlw", MS, Ib, XX },9.1410 - { "(bad)", XX, XX, XX },9.1411 - { "psraw", MS, Ib, XX },9.1412 - { "(bad)", XX, XX, XX },9.1413 - { "psllw", MS, Ib, XX },9.1414 - { "(bad)", XX, XX, XX },9.1415 - },9.1416 - /* GRP11 */9.1417 - {9.1418 - { "(bad)", XX, XX, XX },9.1419 - { "(bad)", XX, XX, XX },9.1420 - { "psrld", MS, Ib, XX },9.1421 - { "(bad)", XX, XX, XX },9.1422 - { "psrad", MS, Ib, XX },9.1423 - { "(bad)", XX, XX, XX },9.1424 - { "pslld", MS, Ib, XX },9.1425 - { "(bad)", XX, XX, XX },9.1426 - },9.1427 - /* GRP12 */9.1428 - {9.1429 - { "(bad)", XX, XX, XX },9.1430 - { "(bad)", XX, XX, XX },9.1431 - { "psrlq", MS, Ib, XX },9.1432 - { "psrldq", MS, Ib, XX },9.1433 - { "(bad)", XX, XX, XX },9.1434 - { "(bad)", XX, XX, XX },9.1435 - { "psllq", MS, Ib, XX },9.1436 - { "pslldq", MS, Ib, XX },9.1437 - },9.1438 - /* GRP13 */9.1439 - {9.1440 - { "fxsave", Ev, XX, XX },9.1441 - { "fxrstor", Ev, XX, XX },9.1442 - { "ldmxcsr", Ev, XX, XX },9.1443 - { "stmxcsr", Ev, XX, XX },9.1444 - { "(bad)", XX, XX, XX },9.1445 - { "lfence", OP_0fae, 0, XX, XX },9.1446 - { "mfence", OP_0fae, 0, XX, XX },9.1447 - { "clflush", OP_0fae, 0, XX, XX },9.1448 - },9.1449 - /* GRP14 */9.1450 - {9.1451 - { "prefetchnta", Ev, XX, XX },9.1452 - { "prefetcht0", Ev, XX, XX },9.1453 - { "prefetcht1", Ev, XX, XX },9.1454 - { "prefetcht2", Ev, XX, XX },9.1455 - { "(bad)", XX, XX, XX },9.1456 - { "(bad)", XX, XX, XX },9.1457 - { "(bad)", XX, XX, XX },9.1458 - { "(bad)", XX, XX, XX },9.1459 - },9.1460 - /* GRPAMD */9.1461 - {9.1462 - { "prefetch", Eb, XX, XX },9.1463 - { "prefetchw", Eb, XX, XX },9.1464 - { "(bad)", XX, XX, XX },9.1465 - { "(bad)", XX, XX, XX },9.1466 - { "(bad)", XX, XX, XX },9.1467 - { "(bad)", XX, XX, XX },9.1468 - { "(bad)", XX, XX, XX },9.1469 - { "(bad)", XX, XX, XX },9.1470 - },9.1471 - /* GRPPADLCK1 */9.1472 - {9.1473 - { "xstorerng", OP_0f07, 0, XX, XX },9.1474 - { "xcryptecb", OP_0f07, 0, XX, XX },9.1475 - { "xcryptcbc", OP_0f07, 0, XX, XX },9.1476 - { "(bad)", OP_0f07, 0, XX, XX },9.1477 - { "xcryptcfb", OP_0f07, 0, XX, XX },9.1478 - { "xcryptofb", OP_0f07, 0, XX, XX },9.1479 - { "(bad)", OP_0f07, 0, XX, XX },9.1480 - { "(bad)", OP_0f07, 0, XX, XX },9.1481 - },9.1482 - /* GRPPADLCK2 */9.1483 - {9.1484 - { "montmul", OP_0f07, 0, XX, XX },9.1485 - { "xsha1", OP_0f07, 0, XX, XX },9.1486 - { "xsha256", OP_0f07, 0, XX, XX },9.1487 - { "(bad)", OP_0f07, 0, XX, XX },9.1488 - { "(bad)", OP_0f07, 0, XX, XX },9.1489 - { "(bad)", OP_0f07, 0, XX, XX },9.1490 - { "(bad)", OP_0f07, 0, XX, XX },9.1491 - { "(bad)", OP_0f07, 0, XX, XX },9.1492 - }9.1493 -};9.1494 -9.1495 -static const struct dis386 prefix_user_table[][4] = {9.1496 - /* PREGRP0 */9.1497 - {9.1498 - { "addps", XM, EX, XX },9.1499 - { "addss", XM, EX, XX },9.1500 - { "addpd", XM, EX, XX },9.1501 - { "addsd", XM, EX, XX },9.1502 - },9.1503 - /* PREGRP1 */9.1504 - {9.1505 - { "", XM, EX, OPSIMD }, /* See OP_SIMD_SUFFIX. */9.1506 - { "", XM, EX, OPSIMD },9.1507 - { "", XM, EX, OPSIMD },9.1508 - { "", XM, EX, OPSIMD },9.1509 - },9.1510 - /* PREGRP2 */9.1511 - {9.1512 - { "cvtpi2ps", XM, EM, XX },9.1513 - { "cvtsi2ssY", XM, Ev, XX },9.1514 - { "cvtpi2pd", XM, EM, XX },9.1515 - { "cvtsi2sdY", XM, Ev, XX },9.1516 - },9.1517 - /* PREGRP3 */9.1518 - {9.1519 - { "cvtps2pi", MX, EX, XX },9.1520 - { "cvtss2siY", Gv, EX, XX },9.1521 - { "cvtpd2pi", MX, EX, XX },9.1522 - { "cvtsd2siY", Gv, EX, XX },9.1523 - },9.1524 - /* PREGRP4 */9.1525 - {9.1526 - { "cvttps2pi", MX, EX, XX },9.1527 - { "cvttss2siY", Gv, EX, XX },9.1528 - { "cvttpd2pi", MX, EX, XX },9.1529 - { "cvttsd2siY", Gv, EX, XX },9.1530 - },9.1531 - /* PREGRP5 */9.1532 - {9.1533 - { "divps", XM, EX, XX },9.1534 - { "divss", XM, EX, XX },9.1535 - { "divpd", XM, EX, XX },9.1536 - { "divsd", XM, EX, XX },9.1537 - },9.1538 - /* PREGRP6 */9.1539 - {9.1540 - { "maxps", XM, EX, XX },9.1541 - { "maxss", XM, EX, XX },9.1542 - { "maxpd", XM, EX, XX },9.1543 - { "maxsd", XM, EX, XX },9.1544 - },9.1545 - /* PREGRP7 */9.1546 - {9.1547 - { "minps", XM, EX, XX },9.1548 - { "minss", XM, EX, XX },9.1549 - { "minpd", XM, EX, XX },9.1550 - { "minsd", XM, EX, XX },9.1551 - },9.1552 - /* PREGRP8 */9.1553 - {9.1554 - { "movups", XM, EX, XX },9.1555 - { "movss", XM, EX, XX },9.1556 - { "movupd", XM, EX, XX },9.1557 - { "movsd", XM, EX, XX },9.1558 - },9.1559 - /* PREGRP9 */9.1560 - {9.1561 - { "movups", EX, XM, XX },9.1562 - { "movss", EX, XM, XX },9.1563 - { "movupd", EX, XM, XX },9.1564 - { "movsd", EX, XM, XX },9.1565 - },9.1566 - /* PREGRP10 */9.1567 - {9.1568 - { "mulps", XM, EX, XX },9.1569 - { "mulss", XM, EX, XX },9.1570 - { "mulpd", XM, EX, XX },9.1571 - { "mulsd", XM, EX, XX },9.1572 - },9.1573 - /* PREGRP11 */9.1574 - {9.1575 - { "rcpps", XM, EX, XX },9.1576 - { "rcpss", XM, EX, XX },9.1577 - { "(bad)", XM, EX, XX },9.1578 - { "(bad)", XM, EX, XX },9.1579 - },9.1580 - /* PREGRP12 */9.1581 - {9.1582 - { "rsqrtps", XM, EX, XX },9.1583 - { "rsqrtss", XM, EX, XX },9.1584 - { "(bad)", XM, EX, XX },9.1585 - { "(bad)", XM, EX, XX },9.1586 - },9.1587 - /* PREGRP13 */9.1588 - {9.1589 - { "sqrtps", XM, EX, XX },9.1590 - { "sqrtss", XM, EX, XX },9.1591 - { "sqrtpd", XM, EX, XX },9.1592 - { "sqrtsd", XM, EX, XX },9.1593 - },9.1594 - /* PREGRP14 */9.1595 - {9.1596 - { "subps", XM, EX, XX },9.1597 - { "subss", XM, EX, XX },9.1598 - { "subpd", XM, EX, XX },9.1599 - { "subsd", XM, EX, XX },9.1600 - },9.1601 - /* PREGRP15 */9.1602 - {9.1603 - { "(bad)", XM, EX, XX },9.1604 - { "cvtdq2pd", XM, EX, XX },9.1605 - { "cvttpd2dq", XM, EX, XX },9.1606 - { "cvtpd2dq", XM, EX, XX },9.1607 - },9.1608 - /* PREGRP16 */9.1609 - {9.1610 - { "cvtdq2ps", XM, EX, XX },9.1611 - { "cvttps2dq",XM, EX, XX },9.1612 - { "cvtps2dq",XM, EX, XX },9.1613 - { "(bad)", XM, EX, XX },9.1614 - },9.1615 - /* PREGRP17 */9.1616 - {9.1617 - { "cvtps2pd", XM, EX, XX },9.1618 - { "cvtss2sd", XM, EX, XX },9.1619 - { "cvtpd2ps", XM, EX, XX },9.1620 - { "cvtsd2ss", XM, EX, XX },9.1621 - },9.1622 - /* PREGRP18 */9.1623 - {9.1624 - { "maskmovq", MX, MS, XX },9.1625 - { "(bad)", XM, EX, XX },9.1626 - { "maskmovdqu", XM, EX, XX },9.1627 - { "(bad)", XM, EX, XX },9.1628 - },9.1629 - /* PREGRP19 */9.1630 - {9.1631 - { "movq", MX, EM, XX },9.1632 - { "movdqu", XM, EX, XX },9.1633 - { "movdqa", XM, EX, XX },9.1634 - { "(bad)", XM, EX, XX },9.1635 - },9.1636 - /* PREGRP20 */9.1637 - {9.1638 - { "movq", EM, MX, XX },9.1639 - { "movdqu", EX, XM, XX },9.1640 - { "movdqa", EX, XM, XX },9.1641 - { "(bad)", EX, XM, XX },9.1642 - },9.1643 - /* PREGRP21 */9.1644 - {9.1645 - { "(bad)", EX, XM, XX },9.1646 - { "movq2dq", XM, MS, XX },9.1647 - { "movq", EX, XM, XX },9.1648 - { "movdq2q", MX, XS, XX },9.1649 - },9.1650 - /* PREGRP22 */9.1651 - {9.1652 - { "pshufw", MX, EM, Ib },9.1653 - { "pshufhw", XM, EX, Ib },9.1654 - { "pshufd", XM, EX, Ib },9.1655 - { "pshuflw", XM, EX, Ib },9.1656 - },9.1657 - /* PREGRP23 */9.1658 - {9.1659 - { "movd", Edq, MX, XX },9.1660 - { "movq", XM, EX, XX },9.1661 - { "movd", Edq, XM, XX },9.1662 - { "(bad)", Ed, XM, XX },9.1663 - },9.1664 - /* PREGRP24 */9.1665 - {9.1666 - { "(bad)", MX, EX, XX },9.1667 - { "(bad)", XM, EX, XX },9.1668 - { "punpckhqdq", XM, EX, XX },9.1669 - { "(bad)", XM, EX, XX },9.1670 - },9.1671 - /* PREGRP25 */9.1672 - {9.1673 - { "movntq", EM, MX, XX },9.1674 - { "(bad)", EM, XM, XX },9.1675 - { "movntdq", EM, XM, XX },9.1676 - { "(bad)", EM, XM, XX },9.1677 - },9.1678 - /* PREGRP26 */9.1679 - {9.1680 - { "(bad)", MX, EX, XX },9.1681 - { "(bad)", XM, EX, XX },9.1682 - { "punpcklqdq", XM, EX, XX },9.1683 - { "(bad)", XM, EX, XX },9.1684 - },9.1685 - /* PREGRP27 */9.1686 - {9.1687 - { "(bad)", MX, EX, XX },9.1688 - { "(bad)", XM, EX, XX },9.1689 - { "addsubpd", XM, EX, XX },9.1690 - { "addsubps", XM, EX, XX },9.1691 - },9.1692 - /* PREGRP28 */9.1693 - {9.1694 - { "(bad)", MX, EX, XX },9.1695 - { "(bad)", XM, EX, XX },9.1696 - { "haddpd", XM, EX, XX },9.1697 - { "haddps", XM, EX, XX },9.1698 - },9.1699 - /* PREGRP29 */9.1700 - {9.1701 - { "(bad)", MX, EX, XX },9.1702 - { "(bad)", XM, EX, XX },9.1703 - { "hsubpd", XM, EX, XX },9.1704 - { "hsubps", XM, EX, XX },9.1705 - },9.1706 - /* PREGRP30 */9.1707 - {9.1708 - { "movlpX", XM, EX, SIMD_Fixup, 'h' }, /* really only 2 operands */9.1709 - { "movsldup", XM, EX, XX },9.1710 - { "movlpd", XM, EX, XX },9.1711 - { "movddup", XM, EX, XX },9.1712 - },9.1713 - /* PREGRP31 */9.1714 - {9.1715 - { "movhpX", XM, EX, SIMD_Fixup, 'l' },9.1716 - { "movshdup", XM, EX, XX },9.1717 - { "movhpd", XM, EX, XX },9.1718 - { "(bad)", XM, EX, XX },9.1719 - },9.1720 - /* PREGRP32 */9.1721 - {9.1722 - { "(bad)", XM, EX, XX },9.1723 - { "(bad)", XM, EX, XX },9.1724 - { "(bad)", XM, EX, XX },9.1725 - { "lddqu", XM, M, XX },9.1726 - },9.1727 -};9.1728 -9.1729 -static const struct dis386 x86_64_table[][2] = {9.1730 - {9.1731 - { "arpl", Ew, Gw, XX },9.1732 - { "movs{||lq|xd}", Gv, Ed, XX },9.1733 - },9.1734 -};9.1735 -9.1736 -#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")9.1737 -9.1738 -static void9.1739 -ckprefix (void)9.1740 -{9.1741 - int newrex;9.1742 - rex = 0;9.1743 - prefixes = 0;9.1744 - used_prefixes = 0;9.1745 - rex_used = 0;9.1746 - while (1)9.1747 - {9.1748 - FETCH_DATA (the_info, codep + 1);9.1749 - newrex = 0;9.1750 - switch (*codep)9.1751 - {9.1752 - /* REX prefixes family. */9.1753 - case 0x40:9.1754 - case 0x41:9.1755 - case 0x42:9.1756 - case 0x43:9.1757 - case 0x44:9.1758 - case 0x45:9.1759 - case 0x46:9.1760 - case 0x47:9.1761 - case 0x48:9.1762 - case 0x49:9.1763 - case 0x4a:9.1764 - case 0x4b:9.1765 - case 0x4c:9.1766 - case 0x4d:9.1767 - case 0x4e:9.1768 - case 0x4f:9.1769 - if (mode_64bit)9.1770 - newrex = *codep;9.1771 - else9.1772 - return;9.1773 - break;9.1774 - case 0xf3:9.1775 - prefixes |= PREFIX_REPZ;9.1776 - break;9.1777 - case 0xf2:9.1778 - prefixes |= PREFIX_REPNZ;9.1779 - break;9.1780 - case 0xf0:9.1781 - prefixes |= PREFIX_LOCK;9.1782 - break;9.1783 - case 0x2e:9.1784 - prefixes |= PREFIX_CS;9.1785 - break;9.1786 - case 0x36:9.1787 - prefixes |= PREFIX_SS;9.1788 - break;9.1789 - case 0x3e:9.1790 - prefixes |= PREFIX_DS;9.1791 - break;9.1792 - case 0x26:9.1793 - prefixes |= PREFIX_ES;9.1794 - break;9.1795 - case 0x64:9.1796 - prefixes |= PREFIX_FS;9.1797 - break;9.1798 - case 0x65:9.1799 - prefixes |= PREFIX_GS;9.1800 - break;9.1801 - case 0x66:9.1802 - prefixes |= PREFIX_DATA;9.1803 - break;9.1804 - case 0x67:9.1805 - prefixes |= PREFIX_ADDR;9.1806 - break;9.1807 - case FWAIT_OPCODE:9.1808 - /* fwait is really an instruction. If there are prefixes9.1809 - before the fwait, they belong to the fwait, *not* to the9.1810 - following instruction. */9.1811 - if (prefixes)9.1812 - {9.1813 - prefixes |= PREFIX_FWAIT;9.1814 - codep++;9.1815 - return;9.1816 - }9.1817 - prefixes = PREFIX_FWAIT;9.1818 - break;9.1819 - default:9.1820 - return;9.1821 - }9.1822 - /* Rex is ignored when followed by another prefix. */9.1823 - if (rex)9.1824 - {9.1825 - oappend (prefix_name (rex, 0));9.1826 - oappend (" ");9.1827 - }9.1828 - rex = newrex;9.1829 - codep++;9.1830 - }9.1831 -}9.1832 -9.1833 -/* Return the name of the prefix byte PREF, or NULL if PREF is not a9.1834 - prefix byte. */9.1835 -9.1836 -static const char *9.1837 -prefix_name (int pref, int sizeflag)9.1838 -{9.1839 - switch (pref)9.1840 - {9.1841 - /* REX prefixes family. */9.1842 - case 0x40:9.1843 - return "rex";9.1844 - case 0x41:9.1845 - return "rexZ";9.1846 - case 0x42:9.1847 - return "rexY";9.1848 - case 0x43:9.1849 - return "rexYZ";9.1850 - case 0x44:9.1851 - return "rexX";9.1852 - case 0x45:9.1853 - return "rexXZ";9.1854 - case 0x46:9.1855 - return "rexXY";9.1856 - case 0x47:9.1857 - return "rexXYZ";9.1858 - case 0x48:9.1859 - return "rex64";9.1860 - case 0x49:9.1861 - return "rex64Z";9.1862 - case 0x4a:9.1863 - return "rex64Y";9.1864 - case 0x4b:9.1865 - return "rex64YZ";9.1866 - case 0x4c:9.1867 - return "rex64X";9.1868 - case 0x4d:9.1869 - return "rex64XZ";9.1870 - case 0x4e:9.1871 - return "rex64XY";9.1872 - case 0x4f:9.1873 - return "rex64XYZ";9.1874 - case 0xf3:9.1875 - return "repz";9.1876 - case 0xf2:9.1877 - return "repnz";9.1878 - case 0xf0:9.1879 - return "lock";9.1880 - case 0x2e:9.1881 - return "cs";9.1882 - case 0x36:9.1883 - return "ss";9.1884 - case 0x3e:9.1885 - return "ds";9.1886 - case 0x26:9.1887 - return "es";9.1888 - case 0x64:9.1889 - return "fs";9.1890 - case 0x65:9.1891 - return "gs";9.1892 - case 0x66:9.1893 - return (sizeflag & DFLAG) ? "data16" : "data32";9.1894 - case 0x67:9.1895 - if (mode_64bit)9.1896 - return (sizeflag & AFLAG) ? "addr32" : "addr64";9.1897 - else9.1898 - return ((sizeflag & AFLAG) && !mode_64bit) ? "addr16" : "addr32";9.1899 - case FWAIT_OPCODE:9.1900 - return "fwait";9.1901 - default:9.1902 - return NULL;9.1903 - }9.1904 -}9.1905 -9.1906 -static char op1out[100], op2out[100], op3out[100];9.1907 -static int op_ad, op_index[3];9.1908 -static int two_source_ops;9.1909 -static bfd_vma op_address[3];9.1910 -static bfd_vma op_riprel[3];9.1911 -static bfd_vma start_pc;9.1912 -9.1913 -/*9.1914 - * On the 386's of 1988, the maximum length of an instruction is 15 bytes.9.1915 - * (see topic "Redundant prefixes" in the "Differences from 8086"9.1916 - * section of the "Virtual 8086 Mode" chapter.)9.1917 - * 'pc' should be the address of this instruction, it will9.1918 - * be used to print the target address if this is a relative jump or call9.1919 - * The function returns the length of this instruction in bytes.9.1920 - */9.1921 -9.1922 -static char intel_syntax;9.1923 -static char open_char;9.1924 -static char close_char;9.1925 -static char separator_char;9.1926 -static char scale_char;9.1927 -9.1928 -/* Here for backwards compatibility. When gdb stops using9.1929 - print_insn_i386_att and print_insn_i386_intel these functions can9.1930 - disappear, and print_insn_i386 be merged into print_insn. */9.1931 -int9.1932 -print_insn_i386_att (bfd_vma pc, disassemble_info *info)9.1933 -{9.1934 - intel_syntax = 0;9.1935 -9.1936 - return print_insn (pc, info);9.1937 -}9.1938 -9.1939 -int9.1940 -print_insn_i386_intel (bfd_vma pc, disassemble_info *info)9.1941 -{9.1942 - intel_syntax = 1;9.1943 -9.1944 - return print_insn (pc, info);9.1945 -}9.1946 -9.1947 -int9.1948 -print_insn_i386 (bfd_vma pc, disassemble_info *info)9.1949 -{9.1950 - intel_syntax = -1;9.1951 -9.1952 - return print_insn (pc, info);9.1953 -}9.1954 -9.1955 -static int9.1956 -print_insn (bfd_vma pc, disassemble_info *info)9.1957 -{9.1958 - const struct dis386 *dp;9.1959 - int i;9.1960 - char *first, *second, *third;9.1961 - int needcomma;9.1962 - unsigned char uses_SSE_prefix, uses_LOCK_prefix;9.1963 - int sizeflag;9.1964 - const char *p;9.1965 - struct dis_private priv;9.1966 -9.1967 - mode_64bit = (info->mach == bfd_mach_x86_64_intel_syntax9.1968 - || info->mach == bfd_mach_x86_64);9.1969 -9.1970 - if (intel_syntax == (char) -1)9.1971 - intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax9.1972 - || info->mach == bfd_mach_x86_64_intel_syntax);9.1973 -9.1974 - if (info->mach == bfd_mach_i386_i3869.1975 - || info->mach == bfd_mach_x86_649.1976 - || info->mach == bfd_mach_i386_i386_intel_syntax9.1977 - || info->mach == bfd_mach_x86_64_intel_syntax)9.1978 - priv.orig_sizeflag = AFLAG | DFLAG;9.1979 - else if (info->mach == bfd_mach_i386_i8086)9.1980 - priv.orig_sizeflag = 0;9.1981 - else9.1982 - abort ();9.1983 -9.1984 - for (p = info->disassembler_options; p != NULL; )9.1985 - {9.1986 - if (strncmp (p, "x86-64", 6) == 0)9.1987 - {9.1988 - mode_64bit = 1;9.1989 - priv.orig_sizeflag = AFLAG | DFLAG;9.1990 - }9.1991 - else if (strncmp (p, "i386", 4) == 0)9.1992 - {9.1993 - mode_64bit = 0;9.1994 - priv.orig_sizeflag = AFLAG | DFLAG;9.1995 - }9.1996 - else if (strncmp (p, "i8086", 5) == 0)9.1997 - {9.1998 - mode_64bit = 0;9.1999 - priv.orig_sizeflag = 0;9.2000 - }9.2001 - else if (strncmp (p, "intel", 5) == 0)9.2002 - {9.2003 - intel_syntax = 1;9.2004 - }9.2005 - else if (strncmp (p, "att", 3) == 0)9.2006 - {9.2007 - intel_syntax = 0;9.2008 - }9.2009 - else if (strncmp (p, "addr", 4) == 0)9.2010 - {9.2011 - if (p[4] == '1' && p[5] == '6')9.2012 - priv.orig_sizeflag &= ~AFLAG;9.2013 - else if (p[4] == '3' && p[5] == '2')9.2014 - priv.orig_sizeflag |= AFLAG;9.2015 - }9.2016 - else if (strncmp (p, "data", 4) == 0)9.2017 - {9.2018 - if (p[4] == '1' && p[5] == '6')9.2019 - priv.orig_sizeflag &= ~DFLAG;9.2020 - else if (p[4] == '3' && p[5] == '2')9.2021 - priv.orig_sizeflag |= DFLAG;9.2022 - }9.2023 - else if (strncmp (p, "suffix", 6) == 0)9.2024 - priv.orig_sizeflag |= SUFFIX_ALWAYS;9.2025 -9.2026 - p = strchr (p, ',');9.2027 - if (p != NULL)9.2028 - p++;9.2029 - }9.2030 -9.2031 - if (intel_syntax)9.2032 - {9.2033 - names64 = intel_names64;9.2034 - names32 = intel_names32;9.2035 - names16 = intel_names16;9.2036 - names8 = intel_names8;9.2037 - names8rex = intel_names8rex;9.2038 - names_seg = intel_names_seg;9.2039 - index16 = intel_index16;9.2040 - open_char = '[';9.2041 - close_char = ']';9.2042 - separator_char = '+';9.2043 - scale_char = '*';9.2044 - }9.2045 - else9.2046 - {9.2047 - names64 = att_names64;9.2048 - names32 = att_names32;9.2049 - names16 = att_names16;9.2050 - names8 = att_names8;9.2051 - names8rex = att_names8rex;9.2052 - names_seg = att_names_seg;9.2053 - index16 = att_index16;9.2054 - open_char = '(';9.2055 - close_char = ')';9.2056 - separator_char = ',';9.2057 - scale_char = ',';9.2058 - }9.2059 -9.2060 - /* The output looks better if we put 7 bytes on a line, since that9.2061 - puts most long word instructions on a single line. */9.2062 - info->bytes_per_line = 7;9.2063 -9.2064 - info->private_data = &priv;9.2065 - priv.max_fetched = priv.the_buffer;9.2066 - priv.insn_start = pc;9.2067 -9.2068 - obuf[0] = 0;9.2069 - op1out[0] = 0;9.2070 - op2out[0] = 0;9.2071 - op3out[0] = 0;9.2072 -9.2073 - op_index[0] = op_index[1] = op_index[2] = -1;9.2074 -9.2075 - the_info = info;9.2076 - start_pc = pc;9.2077 - start_codep = priv.the_buffer;9.2078 - codep = priv.the_buffer;9.2079 -9.2080 - if (setjmp (priv.bailout) != 0)9.2081 - {9.2082 - const char *name;9.2083 -9.2084 - /* Getting here means we tried for data but didn't get it. That9.2085 - means we have an incomplete instruction of some sort. Just9.2086 - print the first byte as a prefix or a .byte pseudo-op. */9.2087 - if (codep > priv.the_buffer)9.2088 - {9.2089 - name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);9.2090 - if (name != NULL)9.2091 - (*info->fprintf_func) (info->stream, "%s", name);9.2092 - else9.2093 - {9.2094 - /* Just print the first byte as a .byte instruction. */9.2095 - (*info->fprintf_func) (info->stream, ".byte 0x%x",9.2096 - (unsigned int) priv.the_buffer[0]);9.2097 - }9.2098 -9.2099 - return 1;9.2100 - }9.2101 -9.2102 - return -1;9.2103 - }9.2104 -9.2105 - obufp = obuf;9.2106 - ckprefix ();9.2107 -9.2108 - insn_codep = codep;9.2109 - sizeflag = priv.orig_sizeflag;9.2110 -9.2111 - FETCH_DATA (info, codep + 1);9.2112 - two_source_ops = (*codep == 0x62) || (*codep == 0xc8);9.2113 -9.2114 - if ((prefixes & PREFIX_FWAIT)9.2115 - && ((*codep < 0xd8) || (*codep > 0xdf)))9.2116 - {9.2117 - const char *name;9.2118 -9.2119 - /* fwait not followed by floating point instruction. Print the9.2120 - first prefix, which is probably fwait itself. */9.2121 - name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);9.2122 - if (name == NULL)9.2123 - name = INTERNAL_DISASSEMBLER_ERROR;9.2124 - (*info->fprintf_func) (info->stream, "%s", name);9.2125 - return 1;9.2126 - }9.2127 -9.2128 - if (*codep == 0x0f)9.2129 - {9.2130 - FETCH_DATA (info, codep + 2);9.2131 - dp = &dis386_twobyte[*++codep];9.2132 - need_modrm = twobyte_has_modrm[*codep];9.2133 - uses_SSE_prefix = twobyte_uses_SSE_prefix[*codep];9.2134 - uses_LOCK_prefix = (*codep & ~0x02) == 0x20;9.2135 - }9.2136 - else9.2137 - {9.2138 - dp = &dis386[*codep];9.2139 - need_modrm = onebyte_has_modrm[*codep];9.2140 - uses_SSE_prefix = 0;9.2141 - uses_LOCK_prefix = 0;9.2142 - }9.2143 - codep++;9.2144 -9.2145 - if (!uses_SSE_prefix && (prefixes & PREFIX_REPZ))9.2146 - {9.2147 - oappend ("repz ");9.2148 - used_prefixes |= PREFIX_REPZ;9.2149 - }9.2150 - if (!uses_SSE_prefix && (prefixes & PREFIX_REPNZ))9.2151 - {9.2152 - oappend ("repnz ");9.2153 - used_prefixes |= PREFIX_REPNZ;9.2154 - }9.2155 - if (!uses_LOCK_prefix && (prefixes & PREFIX_LOCK))9.2156 - {9.2157 - oappend ("lock ");9.2158 - used_prefixes |= PREFIX_LOCK;9.2159 - }9.2160 -9.2161 - if (prefixes & PREFIX_ADDR)9.2162 - {9.2163 - sizeflag ^= AFLAG;9.2164 - if (dp->bytemode3 != loop_jcxz_mode || intel_syntax)9.2165 - {9.2166 - if ((sizeflag & AFLAG) || mode_64bit)9.2167 - oappend ("addr32 ");9.2168 - else9.2169 - oappend ("addr16 ");9.2170 - used_prefixes |= PREFIX_ADDR;9.2171 - }9.2172 - }9.2173 -9.2174 - if (!uses_SSE_prefix && (prefixes & PREFIX_DATA))9.2175 - {9.2176 - sizeflag ^= DFLAG;9.2177 - if (dp->bytemode3 == cond_jump_mode9.2178 - && dp->bytemode1 == v_mode9.2179 - && !intel_syntax)9.2180 - {9.2181 - if (sizeflag & DFLAG)9.2182 - oappend ("data32 ");9.2183 - else9.2184 - oappend ("data16 ");9.2185 - used_prefixes |= PREFIX_DATA;9.2186 - }9.2187 - }9.2188 -9.2189 - if (need_modrm)9.2190 - {9.2191 - FETCH_DATA (info, codep + 1);9.2192 - mod = (*codep >> 6) & 3;9.2193 - reg = (*codep >> 3) & 7;9.2194 - rm = *codep & 7;9.2195 - }9.2196 -9.2197 - if (dp->name == NULL && dp->bytemode1 == FLOATCODE)9.2198 - {9.2199 - dofloat (sizeflag);9.2200 - }9.2201 - else9.2202 - {9.2203 - int index;9.2204 - if (dp->name == NULL)9.2205 - {9.2206 - switch (dp->bytemode1)9.2207 - {9.2208 - case USE_GROUPS:9.2209 - dp = &grps[dp->bytemode2][reg];9.2210 - break;9.2211 -9.2212 - case USE_PREFIX_USER_TABLE:9.2213 - index = 0;9.2214 - used_prefixes |= (prefixes & PREFIX_REPZ);9.2215 - if (prefixes & PREFIX_REPZ)9.2216 - index = 1;9.2217 - else9.2218 - {9.2219 - used_prefixes |= (prefixes & PREFIX_DATA);9.2220 - if (prefixes & PREFIX_DATA)9.2221 - index = 2;9.2222 - else9.2223 - {9.2224 - used_prefixes |= (prefixes & PREFIX_REPNZ);9.2225 - if (prefixes & PREFIX_REPNZ)9.2226 - index = 3;9.2227 - }9.2228 - }9.2229 - dp = &prefix_user_table[dp->bytemode2][index];9.2230 - break;9.2231 -9.2232 - case X86_64_SPECIAL:9.2233 - dp = &x86_64_table[dp->bytemode2][mode_64bit];9.2234 - break;9.2235 -9.2236 - default:9.2237 - oappend (INTERNAL_DISASSEMBLER_ERROR);9.2238 - break;9.2239 - }9.2240 - }9.2241 -9.2242 - if (putop (dp->name, sizeflag) == 0)9.2243 - {9.2244 - obufp = op1out;9.2245 - op_ad = 2;9.2246 - if (dp->op1)9.2247 - (*dp->op1) (dp->bytemode1, sizeflag);9.2248 -9.2249 - obufp = op2out;9.2250 - op_ad = 1;9.2251 - if (dp->op2)9.2252 - (*dp->op2) (dp->bytemode2, sizeflag);9.2253 -9.2254 - obufp = op3out;9.2255 - op_ad = 0;9.2256 - if (dp->op3)9.2257 - (*dp->op3) (dp->bytemode3, sizeflag);9.2258 - }9.2259 - }9.2260 -9.2261 - /* See if any prefixes were not used. If so, print the first one9.2262 - separately. If we don't do this, we'll wind up printing an9.2263 - instruction stream which does not precisely correspond to the9.2264 - bytes we are disassembling. */9.2265 - if ((prefixes & ~used_prefixes) != 0)9.2266 - {9.2267 - const char *name;9.2268 -9.2269 - name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);9.2270 - if (name == NULL)9.2271 - name = INTERNAL_DISASSEMBLER_ERROR;9.2272 - (*info->fprintf_func) (info->stream, "%s", name);9.2273 - return 1;9.2274 - }9.2275 - if (rex & ~rex_used)9.2276 - {9.2277 - const char *name;9.2278 - name = prefix_name (rex | 0x40, priv.orig_sizeflag);9.2279 - if (name == NULL)9.2280 - name = INTERNAL_DISASSEMBLER_ERROR;9.2281 - (*info->fprintf_func) (info->stream, "%s ", name);9.2282 - }9.2283 -9.2284 - obufp = obuf + strlen (obuf);9.2285 - for (i = strlen (obuf); i < 6; i++)9.2286 - oappend (" ");9.2287 - oappend (" ");9.2288 - (*info->fprintf_func) (info->stream, "%s", obuf);9.2289 -9.2290 - /* The enter and bound instructions are printed with operands in the same9.2291 - order as the intel book; everything else is printed in reverse order. */9.2292 - if (intel_syntax || two_source_ops)9.2293 - {9.2294 - first = op1out;9.2295 - second = op2out;9.2296 - third = op3out;9.2297 - op_ad = op_index[0];9.2298 - op_index[0] = op_index[2];9.2299 - op_index[2] = op_ad;9.2300 - }9.2301 - else9.2302 - {9.2303 - first = op3out;9.2304 - second = op2out;9.2305 - third = op1out;9.2306 - }9.2307 - needcomma = 0;9.2308 - if (*first)9.2309 - {9.2310 - if (op_index[0] != -1 && !op_riprel[0])9.2311 - (*info->print_address_func) ((bfd_vma) op_address[op_index[0]], info);9.2312 - else9.2313 - (*info->fprintf_func) (info->stream, "%s", first);9.2314 - needcomma = 1;9.2315 - }9.2316 - if (*second)9.2317 - {9.2318 - if (needcomma)9.2319 - (*info->fprintf_func) (info->stream, ",");9.2320 - if (op_index[1] != -1 && !op_riprel[1])9.2321 - (*info->print_address_func) ((bfd_vma) op_address[op_index[1]], info);9.2322 - else9.2323 - (*info->fprintf_func) (info->stream, "%s", second);9.2324 - needcomma = 1;9.2325 - }9.2326 - if (*third)9.2327 - {9.2328 - if (needcomma)9.2329 - (*info->fprintf_func) (info->stream, ",");9.2330 - if (op_index[2] != -1 && !op_riprel[2])9.2331 - (*info->print_address_func) ((bfd_vma) op_address[op_index[2]], info);9.2332 - else9.2333 - (*info->fprintf_func) (info->stream, "%s", third);9.2334 - }9.2335 - for (i = 0; i < 3; i++)9.2336 - if (op_index[i] != -1 && op_riprel[i])9.2337 - {9.2338 - (*info->fprintf_func) (info->stream, " # ");9.2339 - (*info->print_address_func) ((bfd_vma) (start_pc + codep - start_codep9.2340 - + op_address[op_index[i]]), info);9.2341 - }9.2342 - return codep - priv.the_buffer;9.2343 -}9.2344 -9.2345 -static const char *float_mem[] = {9.2346 - /* d8 */9.2347 - "fadd{s||s|}",9.2348 - "fmul{s||s|}",9.2349 - "fcom{s||s|}",9.2350 - "fcomp{s||s|}",9.2351 - "fsub{s||s|}",9.2352 - "fsubr{s||s|}",9.2353 - "fdiv{s||s|}",9.2354 - "fdivr{s||s|}",9.2355 - /* d9 */9.2356 - "fld{s||s|}",9.2357 - "(bad)",9.2358 - "fst{s||s|}",9.2359 - "fstp{s||s|}",9.2360 - "fldenvIC",9.2361 - "fldcw",9.2362 - "fNstenvIC",9.2363 - "fNstcw",9.2364 - /* da */9.2365 - "fiadd{l||l|}",9.2366 - "fimul{l||l|}",9.2367 - "ficom{l||l|}",9.2368 - "ficomp{l||l|}",9.2369 - "fisub{l||l|}",9.2370 - "fisubr{l||l|}",9.2371 - "fidiv{l||l|}",9.2372 - "fidivr{l||l|}",9.2373 - /* db */9.2374 - "fild{l||l|}",9.2375 - "fisttp{l||l|}",9.2376 - "fist{l||l|}",9.2377 - "fistp{l||l|}",9.2378 - "(bad)",9.2379 - "fld{t||t|}",9.2380 - "(bad)",9.2381 - "fstp{t||t|}",9.2382 - /* dc */9.2383 - "fadd{l||l|}",9.2384 - "fmul{l||l|}",9.2385 - "fcom{l||l|}",9.2386 - "fcomp{l||l|}",9.2387 - "fsub{l||l|}",9.2388 - "fsubr{l||l|}",9.2389 - "fdiv{l||l|}",9.2390 - "fdivr{l||l|}",9.2391 - /* dd */9.2392 - "fld{l||l|}",9.2393 - "fisttp{ll||ll|}",9.2394 - "fst{l||l|}",9.2395 - "fstp{l||l|}",9.2396 - "frstorIC",9.2397 - "(bad)",9.2398 - "fNsaveIC",9.2399 - "fNstsw",9.2400 - /* de */9.2401 - "fiadd",9.2402 - "fimul",9.2403 - "ficom",9.2404 - "ficomp",9.2405 - "fisub",9.2406 - "fisubr",9.2407 - "fidiv",9.2408 - "fidivr",9.2409 - /* df */9.2410 - "fild",9.2411 - "fisttp",9.2412 - "fist",9.2413 - "fistp",9.2414 - "fbld",9.2415 - "fild{ll||ll|}",9.2416 - "fbstp",9.2417 - "fistp{ll||ll|}",9.2418 -};9.2419 -9.2420 -static const unsigned char float_mem_mode[] = {9.2421 - /* d8 */9.2422 - d_mode,9.2423 - d_mode,9.2424 - d_mode,9.2425 - d_mode,9.2426 - d_mode,9.2427 - d_mode,9.2428 - d_mode,9.2429 - d_mode,9.2430 - /* d9 */9.2431 - d_mode,9.2432 - 0,9.2433 - d_mode,9.2434 - d_mode,9.2435 - 0,9.2436 - w_mode,9.2437 - 0,9.2438 - w_mode,9.2439 - /* da */9.2440 - d_mode,9.2441 - d_mode,9.2442 - d_mode,9.2443 - d_mode,9.2444 - d_mode,9.2445 - d_mode,9.2446 - d_mode,9.2447 - d_mode,9.2448 - /* db */9.2449 - d_mode,9.2450 - d_mode,9.2451 - d_mode,9.2452 - d_mode,9.2453 - 0,9.2454 - t_mode,9.2455 - 0,9.2456 - t_mode,9.2457 - /* dc */9.2458 - q_mode,9.2459 - q_mode,9.2460 - q_mode,9.2461 - q_mode,9.2462 - q_mode,9.2463 - q_mode,9.2464 - q_mode,9.2465 - q_mode,9.2466 - /* dd */9.2467 - q_mode,9.2468 - q_mode,9.2469 - q_mode,9.2470 - q_mode,9.2471 - 0,9.2472 - 0,9.2473 - 0,9.2474 - w_mode,9.2475 - /* de */9.2476 - w_mode,9.2477 - w_mode,9.2478 - w_mode,9.2479 - w_mode,9.2480 - w_mode,9.2481 - w_mode,9.2482 - w_mode,9.2483 - w_mode,9.2484 - /* df */9.2485 - w_mode,9.2486 - w_mode,9.2487 - w_mode,9.2488 - w_mode,9.2489 - t_mode,9.2490 - q_mode,9.2491 - t_mode,9.2492 - q_mode9.2493 -};9.2494 -9.2495 -#define ST OP_ST, 09.2496 -#define STi OP_STi, 09.2497 -9.2498 -#define FGRPd9_2 NULL, NULL, 0, NULL, 0, NULL, 09.2499 -#define FGRPd9_4 NULL, NULL, 1, NULL, 0, NULL, 09.2500 -#define FGRPd9_5 NULL, NULL, 2, NULL, 0, NULL, 09.2501 -#define FGRPd9_6 NULL, NULL, 3, NULL, 0, NULL, 09.2502 -#define FGRPd9_7 NULL, NULL, 4, NULL, 0, NULL, 09.2503 -#define FGRPda_5 NULL, NULL, 5, NULL, 0, NULL, 09.2504 -#define FGRPdb_4 NULL, NULL, 6, NULL, 0, NULL, 09.2505 -#define FGRPde_3 NULL, NULL, 7, NULL, 0, NULL, 09.2506 -#define FGRPdf_4 NULL, NULL, 8, NULL, 0, NULL, 09.2507 -9.2508 -static const struct dis386 float_reg[][8] = {9.2509 - /* d8 */9.2510 - {9.2511 - { "fadd", ST, STi, XX },9.2512 - { "fmul", ST, STi, XX },9.2513 - { "fcom", STi, XX, XX },9.2514 - { "fcomp", STi, XX, XX },9.2515 - { "fsub", ST, STi, XX },9.2516 - { "fsubr", ST, STi, XX },9.2517 - { "fdiv", ST, STi, XX },9.2518 - { "fdivr", ST, STi, XX },9.2519 - },9.2520 - /* d9 */9.2521 - {9.2522 - { "fld", STi, XX, XX },9.2523 - { "fxch", STi, XX, XX },9.2524 - { FGRPd9_2 },9.2525 - { "(bad)", XX, XX, XX },9.2526 - { FGRPd9_4 },9.2527 - { FGRPd9_5 },9.2528 - { FGRPd9_6 },9.2529 - { FGRPd9_7 },9.2530 - },9.2531 - /* da */9.2532 - {9.2533 - { "fcmovb", ST, STi, XX },9.2534 - { "fcmove", ST, STi, XX },9.2535 - { "fcmovbe",ST, STi, XX },9.2536 - { "fcmovu", ST, STi, XX },9.2537 - { "(bad)", XX, XX, XX },9.2538 - { FGRPda_5 },9.2539 - { "(bad)", XX, XX, XX },9.2540 - { "(bad)", XX, XX, XX },9.2541 - },9.2542 - /* db */9.2543 - {9.2544 - { "fcmovnb",ST, STi, XX },9.2545 - { "fcmovne",ST, STi, XX },9.2546 - { "fcmovnbe",ST, STi, XX },9.2547 - { "fcmovnu",ST, STi, XX },9.2548 - { FGRPdb_4 },9.2549 - { "fucomi", ST, STi, XX },9.2550 - { "fcomi", ST, STi, XX },9.2551 - { "(bad)", XX, XX, XX },9.2552 - },9.2553 - /* dc */9.2554 - {9.2555 - { "fadd", STi, ST, XX },9.2556 - { "fmul", STi, ST, XX },9.2557 - { "(bad)", XX, XX, XX },9.2558 - { "(bad)", XX, XX, XX },9.2559 -#if UNIXWARE_COMPAT9.2560 - { "fsub", STi, ST, XX },9.2561 - { "fsubr", STi, ST, XX },9.2562 - { "fdiv", STi, ST, XX },9.2563 - { "fdivr", STi, ST, XX },9.2564 -#else9.2565 - { "fsubr", STi, ST, XX },9.2566 - { "fsub", STi, ST, XX },9.2567 - { "fdivr", STi, ST, XX },9.2568 - { "fdiv", STi, ST, XX },9.2569 -#endif9.2570 - },9.2571 - /* dd */9.2572 - {9.2573 - { "ffree", STi, XX, XX },9.2574 - { "(bad)", XX, XX, XX },9.2575 - { "fst", STi, XX, XX },9.2576 - { "fstp", STi, XX, XX },9.2577 - { "fucom", STi, XX, XX },9.2578 - { "fucomp", STi, XX, XX },9.2579 - { "(bad)", XX, XX, XX },9.2580 - { "(bad)", XX, XX, XX },9.2581 - },9.2582 - /* de */9.2583 - {9.2584 - { "faddp", STi, ST, XX },9.2585 - { "fmulp", STi, ST, XX },9.2586 - { "(bad)", XX, XX, XX },9.2587 - { FGRPde_3 },9.2588 -#if UNIXWARE_COMPAT9.2589 - { "fsubp", STi, ST, XX },9.2590 - { "fsubrp", STi, ST, XX },9.2591 - { "fdivp", STi, ST, XX },9.2592 - { "fdivrp", STi, ST, XX },9.2593 -#else9.2594 - { "fsubrp", STi, ST, XX },9.2595 - { "fsubp", STi, ST, XX },9.2596 - { "fdivrp", STi, ST, XX },9.2597 - { "fdivp", STi, ST, XX },9.2598 -#endif9.2599 - },9.2600 - /* df */9.2601 - {9.2602 - { "ffreep", STi, XX, XX },9.2603 - { "(bad)", XX, XX, XX },9.2604 - { "(bad)", XX, XX, XX },9.2605 - { "(bad)", XX, XX, XX },9.2606 - { FGRPdf_4 },9.2607 - { "fucomip",ST, STi, XX },9.2608 - { "fcomip", ST, STi, XX },9.2609 - { "(bad)", XX, XX, XX },9.2610 - },9.2611 -};9.2612 -9.2613 -static char *fgrps[][8] = {9.2614 - /* d9_2 0 */9.2615 - {9.2616 - "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",9.2617 - },9.2618 -9.2619 - /* d9_4 1 */9.2620 - {9.2621 - "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",9.2622 - },9.2623 -9.2624 - /* d9_5 2 */9.2625 - {9.2626 - "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",9.2627 - },9.2628 -9.2629 - /* d9_6 3 */9.2630 - {9.2631 - "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",9.2632 - },9.2633 -9.2634 - /* d9_7 4 */9.2635 - {9.2636 - "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",9.2637 - },9.2638 -9.2639 - /* da_5 5 */9.2640 - {9.2641 - "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",9.2642 - },9.2643 -9.2644 - /* db_4 6 */9.2645 - {9.2646 - "feni(287 only)","fdisi(287 only)","fNclex","fNinit",9.2647 - "fNsetpm(287 only)","(bad)","(bad)","(bad)",9.2648 - },9.2649 -9.2650 - /* de_3 7 */9.2651 - {9.2652 - "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",9.2653 - },9.2654 -9.2655 - /* df_4 8 */9.2656 - {9.2657 - "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",9.2658 - },9.2659 -};9.2660 -9.2661 -static void9.2662 -dofloat (int sizeflag)9.2663 -{9.2664 - const struct dis386 *dp;9.2665 - unsigned char floatop;9.2666 -9.2667 - floatop = codep[-1];9.2668 -9.2669 - if (mod != 3)9.2670 - {9.2671 - int fp_indx = (floatop - 0xd8) * 8 + reg;9.2672 -9.2673 - putop (float_mem[fp_indx], sizeflag);9.2674 - obufp = op1out;9.2675 - OP_E (float_mem_mode[fp_indx], sizeflag);9.2676 - return;9.2677 - }9.2678 - /* Skip mod/rm byte. */9.2679 - MODRM_CHECK;9.2680 - codep++;9.2681 -9.2682 - dp = &float_reg[floatop - 0xd8][reg];9.2683 - if (dp->name == NULL)9.2684 - {9.2685 - putop (fgrps[dp->bytemode1][rm], sizeflag);9.2686 -9.2687 - /* Instruction fnstsw is only one with strange arg. */9.2688 - if (floatop == 0xdf && codep[-1] == 0xe0)9.2689 - strcpy (op1out, names16[0]);9.2690 - }9.2691 - else9.2692 - {9.2693 - putop (dp->name, sizeflag);9.2694 -9.2695 - obufp = op1out;9.2696 - if (dp->op1)9.2697 - (*dp->op1) (dp->bytemode1, sizeflag);9.2698 - obufp = op2out;9.2699 - if (dp->op2)9.2700 - (*dp->op2) (dp->bytemode2, sizeflag);9.2701 - }9.2702 -}9.2703 -9.2704 -static void9.2705 -OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.2706 -{9.2707 - oappend ("%st");9.2708 -}9.2709 -9.2710 -static void9.2711 -OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.2712 -{9.2713 - sprintf (scratchbuf, "%%st(%d)", rm);9.2714 - oappend (scratchbuf + intel_syntax);9.2715 -}9.2716 -9.2717 -/* Capital letters in template are macros. */9.2718 -static int9.2719 -putop (const char *template, int sizeflag)9.2720 -{9.2721 - const char *p;9.2722 - int alt = 0;9.2723 -9.2724 - for (p = template; *p; p++)9.2725 - {9.2726 - switch (*p)9.2727 - {9.2728 - default:9.2729 - *obufp++ = *p;9.2730 - break;9.2731 - case '{':9.2732 - alt = 0;9.2733 - if (intel_syntax)9.2734 - alt += 1;9.2735 - if (mode_64bit)9.2736 - alt += 2;9.2737 - while (alt != 0)9.2738 - {9.2739 - while (*++p != '|')9.2740 - {9.2741 - if (*p == '}')9.2742 - {9.2743 - /* Alternative not valid. */9.2744 - strcpy (obuf, "(bad)");9.2745 - obufp = obuf + 5;9.2746 - return 1;9.2747 - }9.2748 - else if (*p == '\0')9.2749 - abort ();9.2750 - }9.2751 - alt--;9.2752 - }9.2753 - /* Fall through. */9.2754 - case 'I':9.2755 - alt = 1;9.2756 - continue;9.2757 - case '|':9.2758 - while (*++p != '}')9.2759 - {9.2760 - if (*p == '\0')9.2761 - abort ();9.2762 - }9.2763 - break;9.2764 - case '}':9.2765 - break;9.2766 - case 'A':9.2767 - if (intel_syntax)9.2768 - break;9.2769 - if (mod != 3 || (sizeflag & SUFFIX_ALWAYS))9.2770 - *obufp++ = 'b';9.2771 - break;9.2772 - case 'B':9.2773 - if (intel_syntax)9.2774 - break;9.2775 - if (sizeflag & SUFFIX_ALWAYS)9.2776 - *obufp++ = 'b';9.2777 - break;9.2778 - case 'C':9.2779 - if (intel_syntax && !alt)9.2780 - break;9.2781 - if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))9.2782 - {9.2783 - if (sizeflag & DFLAG)9.2784 - *obufp++ = intel_syntax ? 'd' : 'l';9.2785 - else9.2786 - *obufp++ = intel_syntax ? 'w' : 's';9.2787 - used_prefixes |= (prefixes & PREFIX_DATA);9.2788 - }9.2789 - break;9.2790 - case 'E': /* For jcxz/jecxz */9.2791 - if (mode_64bit)9.2792 - {9.2793 - if (sizeflag & AFLAG)9.2794 - *obufp++ = 'r';9.2795 - else9.2796 - *obufp++ = 'e';9.2797 - }9.2798 - else9.2799 - if (sizeflag & AFLAG)9.2800 - *obufp++ = 'e';9.2801 - used_prefixes |= (prefixes & PREFIX_ADDR);9.2802 - break;9.2803 - case 'F':9.2804 - if (intel_syntax)9.2805 - break;9.2806 - if ((prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS))9.2807 - {9.2808 - if (sizeflag & AFLAG)9.2809 - *obufp++ = mode_64bit ? 'q' : 'l';9.2810 - else9.2811 - *obufp++ = mode_64bit ? 'l' : 'w';9.2812 - used_prefixes |= (prefixes & PREFIX_ADDR);9.2813 - }9.2814 - break;9.2815 - case 'H':9.2816 - if (intel_syntax)9.2817 - break;9.2818 - if ((prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_CS9.2819 - || (prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_DS)9.2820 - {9.2821 - used_prefixes |= prefixes & (PREFIX_CS | PREFIX_DS);9.2822 - *obufp++ = ',';9.2823 - *obufp++ = 'p';9.2824 - if (prefixes & PREFIX_DS)9.2825 - *obufp++ = 't';9.2826 - else9.2827 - *obufp++ = 'n';9.2828 - }9.2829 - break;9.2830 - case 'J':9.2831 - if (intel_syntax)9.2832 - break;9.2833 - *obufp++ = 'l';9.2834 - break;9.2835 - case 'L':9.2836 - if (intel_syntax)9.2837 - break;9.2838 - if (sizeflag & SUFFIX_ALWAYS)9.2839 - *obufp++ = 'l';9.2840 - break;9.2841 - case 'N':9.2842 - if ((prefixes & PREFIX_FWAIT) == 0)9.2843 - *obufp++ = 'n';9.2844 - else9.2845 - used_prefixes |= PREFIX_FWAIT;9.2846 - break;9.2847 - case 'O':9.2848 - USED_REX (REX_MODE64);9.2849 - if (rex & REX_MODE64)9.2850 - *obufp++ = 'o';9.2851 - else9.2852 - *obufp++ = 'd';9.2853 - break;9.2854 - case 'T':9.2855 - if (intel_syntax)9.2856 - break;9.2857 - if (mode_64bit)9.2858 - {9.2859 - *obufp++ = 'q';9.2860 - break;9.2861 - }9.2862 - /* Fall through. */9.2863 - case 'P':9.2864 - if (intel_syntax)9.2865 - break;9.2866 - if ((prefixes & PREFIX_DATA)9.2867 - || (rex & REX_MODE64)9.2868 - || (sizeflag & SUFFIX_ALWAYS))9.2869 - {9.2870 - USED_REX (REX_MODE64);9.2871 - if (rex & REX_MODE64)9.2872 - *obufp++ = 'q';9.2873 - else9.2874 - {9.2875 - if (sizeflag & DFLAG)9.2876 - *obufp++ = 'l';9.2877 - else9.2878 - *obufp++ = 'w';9.2879 - used_prefixes |= (prefixes & PREFIX_DATA);9.2880 - }9.2881 - }9.2882 - break;9.2883 - case 'U':9.2884 - if (intel_syntax)9.2885 - break;9.2886 - if (mode_64bit)9.2887 - {9.2888 - *obufp++ = 'q';9.2889 - break;9.2890 - }9.2891 - /* Fall through. */9.2892 - case 'Q':9.2893 - if (intel_syntax && !alt)9.2894 - break;9.2895 - USED_REX (REX_MODE64);9.2896 - if (mod != 3 || (sizeflag & SUFFIX_ALWAYS))9.2897 - {9.2898 - if (rex & REX_MODE64)9.2899 - *obufp++ = 'q';9.2900 - else9.2901 - {9.2902 - if (sizeflag & DFLAG)9.2903 - *obufp++ = intel_syntax ? 'd' : 'l';9.2904 - else9.2905 - *obufp++ = 'w';9.2906 - used_prefixes |= (prefixes & PREFIX_DATA);9.2907 - }9.2908 - }9.2909 - break;9.2910 - case 'R':9.2911 - USED_REX (REX_MODE64);9.2912 - if (intel_syntax)9.2913 - {9.2914 - if (rex & REX_MODE64)9.2915 - {9.2916 - *obufp++ = 'q';9.2917 - *obufp++ = 't';9.2918 - }9.2919 - else if (sizeflag & DFLAG)9.2920 - {9.2921 - *obufp++ = 'd';9.2922 - *obufp++ = 'q';9.2923 - }9.2924 - else9.2925 - {9.2926 - *obufp++ = 'w';9.2927 - *obufp++ = 'd';9.2928 - }9.2929 - }9.2930 - else9.2931 - {9.2932 - if (rex & REX_MODE64)9.2933 - *obufp++ = 'q';9.2934 - else if (sizeflag & DFLAG)9.2935 - *obufp++ = 'l';9.2936 - else9.2937 - *obufp++ = 'w';9.2938 - }9.2939 - if (!(rex & REX_MODE64))9.2940 - used_prefixes |= (prefixes & PREFIX_DATA);9.2941 - break;9.2942 - case 'S':9.2943 - if (intel_syntax)9.2944 - break;9.2945 - if (sizeflag & SUFFIX_ALWAYS)9.2946 - {9.2947 - if (rex & REX_MODE64)9.2948 - *obufp++ = 'q';9.2949 - else9.2950 - {9.2951 - if (sizeflag & DFLAG)9.2952 - *obufp++ = 'l';9.2953 - else9.2954 - *obufp++ = 'w';9.2955 - used_prefixes |= (prefixes & PREFIX_DATA);9.2956 - }9.2957 - }9.2958 - break;9.2959 - case 'X':9.2960 - if (prefixes & PREFIX_DATA)9.2961 - *obufp++ = 'd';9.2962 - else9.2963 - *obufp++ = 's';9.2964 - used_prefixes |= (prefixes & PREFIX_DATA);9.2965 - break;9.2966 - case 'Y':9.2967 - if (intel_syntax)9.2968 - break;9.2969 - if (rex & REX_MODE64)9.2970 - {9.2971 - USED_REX (REX_MODE64);9.2972 - *obufp++ = 'q';9.2973 - }9.2974 - break;9.2975 - /* implicit operand size 'l' for i386 or 'q' for x86-64 */9.2976 - case 'W':9.2977 - /* operand size flag for cwtl, cbtw */9.2978 - USED_REX (0);9.2979 - if (rex)9.2980 - *obufp++ = 'l';9.2981 - else if (sizeflag & DFLAG)9.2982 - *obufp++ = 'w';9.2983 - else9.2984 - *obufp++ = 'b';9.2985 - if (intel_syntax)9.2986 - {9.2987 - if (rex)9.2988 - {9.2989 - *obufp++ = 'q';9.2990 - *obufp++ = 'e';9.2991 - }9.2992 - if (sizeflag & DFLAG)9.2993 - {9.2994 - *obufp++ = 'd';9.2995 - *obufp++ = 'e';9.2996 - }9.2997 - else9.2998 - {9.2999 - *obufp++ = 'w';9.3000 - }9.3001 - }9.3002 - if (!rex)9.3003 - used_prefixes |= (prefixes & PREFIX_DATA);9.3004 - break;9.3005 - }9.3006 - alt = 0;9.3007 - }9.3008 - *obufp = 0;9.3009 - return 0;9.3010 -}9.3011 -9.3012 -static void9.3013 -oappend (const char *s)9.3014 -{9.3015 - strcpy (obufp, s);9.3016 - obufp += strlen (s);9.3017 -}9.3018 -9.3019 -static void9.3020 -append_seg (void)9.3021 -{9.3022 - if (prefixes & PREFIX_CS)9.3023 - {9.3024 - used_prefixes |= PREFIX_CS;9.3025 - oappend ("%cs:" + intel_syntax);9.3026 - }9.3027 - if (prefixes & PREFIX_DS)9.3028 - {9.3029 - used_prefixes |= PREFIX_DS;9.3030 - oappend ("%ds:" + intel_syntax);9.3031 - }9.3032 - if (prefixes & PREFIX_SS)9.3033 - {9.3034 - used_prefixes |= PREFIX_SS;9.3035 - oappend ("%ss:" + intel_syntax);9.3036 - }9.3037 - if (prefixes & PREFIX_ES)9.3038 - {9.3039 - used_prefixes |= PREFIX_ES;9.3040 - oappend ("%es:" + intel_syntax);9.3041 - }9.3042 - if (prefixes & PREFIX_FS)9.3043 - {9.3044 - used_prefixes |= PREFIX_FS;9.3045 - oappend ("%fs:" + intel_syntax);9.3046 - }9.3047 - if (prefixes & PREFIX_GS)9.3048 - {9.3049 - used_prefixes |= PREFIX_GS;9.3050 - oappend ("%gs:" + intel_syntax);9.3051 - }9.3052 -}9.3053 -9.3054 -static void9.3055 -OP_indirE (int bytemode, int sizeflag)9.3056 -{9.3057 - if (!intel_syntax)9.3058 - oappend ("*");9.3059 - OP_E (bytemode, sizeflag);9.3060 -}9.3061 -9.3062 -static void9.3063 -OP_E (int bytemode, int sizeflag)9.3064 -{9.3065 - bfd_vma disp;9.3066 - int add = 0;9.3067 - int riprel = 0;9.3068 - USED_REX (REX_EXTZ);9.3069 - if (rex & REX_EXTZ)9.3070 - add += 8;9.3071 -9.3072 - /* Skip mod/rm byte. */9.3073 - MODRM_CHECK;9.3074 - codep++;9.3075 -9.3076 - if (mod == 3)9.3077 - {9.3078 - switch (bytemode)9.3079 - {9.3080 - case b_mode:9.3081 - USED_REX (0);9.3082 - if (rex)9.3083 - oappend (names8rex[rm + add]);9.3084 - else9.3085 - oappend (names8[rm + add]);9.3086 - break;9.3087 - case w_mode:9.3088 - oappend (names16[rm + add]);9.3089 - break;9.3090 - case d_mode:9.3091 - oappend (names32[rm + add]);9.3092 - break;9.3093 - case q_mode:9.3094 - oappend (names64[rm + add]);9.3095 - break;9.3096 - case m_mode:9.3097 - if (mode_64bit)9.3098 - oappend (names64[rm + add]);9.3099 - else9.3100 - oappend (names32[rm + add]);9.3101 - break;9.3102 - case v_mode:9.3103 - case dq_mode:9.3104 - case dqw_mode:9.3105 - USED_REX (REX_MODE64);9.3106 - if (rex & REX_MODE64)9.3107 - oappend (names64[rm + add]);9.3108 - else if ((sizeflag & DFLAG) || bytemode != v_mode)9.3109 - oappend (names32[rm + add]);9.3110 - else9.3111 - oappend (names16[rm + add]);9.3112 - used_prefixes |= (prefixes & PREFIX_DATA);9.3113 - break;9.3114 - case 0:9.3115 - break;9.3116 - default:9.3117 - oappend (INTERNAL_DISASSEMBLER_ERROR);9.3118 - break;9.3119 - }9.3120 - return;9.3121 - }9.3122 -9.3123 - disp = 0;9.3124 - append_seg ();9.3125 -9.3126 - if ((sizeflag & AFLAG) || mode_64bit) /* 32 bit address mode */9.3127 - {9.3128 - int havesib;9.3129 - int havebase;9.3130 - int base;9.3131 - int index = 0;9.3132 - int scale = 0;9.3133 -9.3134 - havesib = 0;9.3135 - havebase = 1;9.3136 - base = rm;9.3137 -9.3138 - if (base == 4)9.3139 - {9.3140 - havesib = 1;9.3141 - FETCH_DATA (the_info, codep + 1);9.3142 - index = (*codep >> 3) & 7;9.3143 - if (mode_64bit || index != 0x4)9.3144 - /* When INDEX == 0x4 in 32 bit mode, SCALE is ignored. */9.3145 - scale = (*codep >> 6) & 3;9.3146 - base = *codep & 7;9.3147 - USED_REX (REX_EXTY);9.3148 - USED_REX (REX_EXTZ);9.3149 - if (rex & REX_EXTY)9.3150 - index += 8;9.3151 - if (rex & REX_EXTZ)9.3152 - base += 8;9.3153 - codep++;9.3154 - }9.3155 -9.3156 - switch (mod)9.3157 - {9.3158 - case 0:9.3159 - if ((base & 7) == 5)9.3160 - {9.3161 - havebase = 0;9.3162 - if (mode_64bit && !havesib)9.3163 - riprel = 1;9.3164 - disp = get32s ();9.3165 - }9.3166 - break;9.3167 - case 1:9.3168 - FETCH_DATA (the_info, codep + 1);9.3169 - disp = *codep++;9.3170 - if ((disp & 0x80) != 0)9.3171 - disp -= 0x100;9.3172 - break;9.3173 - case 2:9.3174 - disp = get32s ();9.3175 - break;9.3176 - }9.3177 -9.3178 - if (!intel_syntax)9.3179 - if (mod != 0 || (base & 7) == 5)9.3180 - {9.3181 - xlat_print_symbolic_operand (scratchbuf, !riprel, disp);9.3182 - oappend (scratchbuf);9.3183 - if (riprel)9.3184 - {9.3185 - set_op (disp, 1);9.3186 - oappend ("(%rip)");9.3187 - }9.3188 - }9.3189 -9.3190 - if (havebase || (havesib && (index != 4 || scale != 0)))9.3191 - {9.3192 - if (intel_syntax)9.3193 - {9.3194 - switch (bytemode)9.3195 - {9.3196 - case b_mode:9.3197 - oappend ("BYTE PTR ");9.3198 - break;9.3199 - case w_mode:9.3200 - case dqw_mode:9.3201 - oappend ("WORD PTR ");9.3202 - break;9.3203 - case v_mode:9.3204 - case dq_mode:9.3205 - USED_REX (REX_MODE64);9.3206 - if (rex & REX_MODE64)9.3207 - oappend ("QWORD PTR ");9.3208 - else if ((sizeflag & DFLAG) || bytemode == dq_mode)9.3209 - oappend ("DWORD PTR ");9.3210 - else9.3211 - oappend ("WORD PTR ");9.3212 - used_prefixes |= (prefixes & PREFIX_DATA);9.3213 - break;9.3214 - case d_mode:9.3215 - oappend ("DWORD PTR ");9.3216 - break;9.3217 - case q_mode:9.3218 - oappend ("QWORD PTR ");9.3219 - break;9.3220 - case m_mode:9.3221 - if (mode_64bit)9.3222 - oappend ("QWORD PTR ");9.3223 - else9.3224 - oappend ("DWORD PTR ");9.3225 - break;9.3226 - case f_mode:9.3227 - if (sizeflag & DFLAG)9.3228 - {9.3229 - used_prefixes |= (prefixes & PREFIX_DATA);9.3230 - oappend ("FWORD PTR ");9.3231 - }9.3232 - else9.3233 - oappend ("DWORD PTR ");9.3234 - break;9.3235 - case t_mode:9.3236 - oappend ("TBYTE PTR ");9.3237 - break;9.3238 - case x_mode:9.3239 - oappend ("XMMWORD PTR ");9.3240 - break;9.3241 - default:9.3242 - break;9.3243 - }9.3244 - }9.3245 - *obufp++ = open_char;9.3246 - if (intel_syntax && riprel)9.3247 - oappend ("rip + ");9.3248 - *obufp = '\0';9.3249 - USED_REX (REX_EXTZ);9.3250 - if (!havesib && (rex & REX_EXTZ))9.3251 - base += 8;9.3252 - if (havebase)9.3253 - oappend (mode_64bit && (sizeflag & AFLAG)9.3254 - ? names64[base] : names32[base]);9.3255 - if (havesib)9.3256 - {9.3257 - if (index != 4)9.3258 - {9.3259 - if (!intel_syntax || havebase)9.3260 - {9.3261 - *obufp++ = separator_char;9.3262 - *obufp = '\0';9.3263 - }9.3264 - oappend (mode_64bit && (sizeflag & AFLAG)9.3265 - ? names64[index] : names32[index]);9.3266 - }9.3267 - if (scale != 0 || (!intel_syntax && index != 4))9.3268 - {9.3269 - *obufp++ = scale_char;9.3270 - *obufp = '\0';9.3271 - sprintf (scratchbuf, "%d", 1 << scale);9.3272 - oappend (scratchbuf);9.3273 - }9.3274 - }9.3275 - if (intel_syntax)9.3276 - if (mod != 0 || (base & 7) == 5)9.3277 - {9.3278 - /* Don't print zero displacements. */9.3279 - if (disp != 0)9.3280 - {9.3281 - if ((bfd_signed_vma) disp > 0)9.3282 - {9.3283 - *obufp++ = '+';9.3284 - *obufp = '\0';9.3285 - }9.3286 -9.3287 - xlat_print_symbolic_operand (scratchbuf, 0, disp);9.3288 - oappend (scratchbuf);9.3289 - }9.3290 - }9.3291 -9.3292 - *obufp++ = close_char;9.3293 - *obufp = '\0';9.3294 - }9.3295 - else if (intel_syntax)9.3296 - {9.3297 - if (mod != 0 || (base & 7) == 5)9.3298 - {9.3299 - if (prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS9.3300 - | PREFIX_ES | PREFIX_FS | PREFIX_GS))9.3301 - ;9.3302 - else9.3303 - {9.3304 - oappend (names_seg[ds_reg - es_reg]);9.3305 - oappend (":");9.3306 - }9.3307 - xlat_print_symbolic_operand (scratchbuf, 1, disp);9.3308 - oappend (scratchbuf);9.3309 - }9.3310 - }9.3311 - }9.3312 - else9.3313 - { /* 16 bit address mode */9.3314 - switch (mod)9.3315 - {9.3316 - case 0:9.3317 - if ((rm & 7) == 6)9.3318 - {9.3319 - disp = get16 ();9.3320 - if ((disp & 0x8000) != 0)9.3321 - disp -= 0x10000;9.3322 - }9.3323 - break;9.3324 - case 1:9.3325 - FETCH_DATA (the_info, codep + 1);9.3326 - disp = *codep++;9.3327 - if ((disp & 0x80) != 0)9.3328 - disp -= 0x100;9.3329 - break;9.3330 - case 2:9.3331 - disp = get16 ();9.3332 - if ((disp & 0x8000) != 0)9.3333 - disp -= 0x10000;9.3334 - break;9.3335 - }9.3336 -9.3337 - if (!intel_syntax)9.3338 - if (mod != 0 || (rm & 7) == 6)9.3339 - {9.3340 - xlat_print_symbolic_operand (scratchbuf, 0, disp);9.3341 - oappend (scratchbuf);9.3342 - }9.3343 -9.3344 - if (mod != 0 || (rm & 7) != 6)9.3345 - {9.3346 - *obufp++ = open_char;9.3347 - *obufp = '\0';9.3348 - oappend (index16[rm + add]);9.3349 - *obufp++ = close_char;9.3350 - *obufp = '\0';9.3351 - }9.3352 - }9.3353 -}9.3354 -9.3355 -static void9.3356 -OP_G (int bytemode, int sizeflag)9.3357 -{9.3358 - int add = 0;9.3359 - USED_REX (REX_EXTX);9.3360 - if (rex & REX_EXTX)9.3361 - add += 8;9.3362 - switch (bytemode)9.3363 - {9.3364 - case b_mode:9.3365 - USED_REX (0);9.3366 - if (rex)9.3367 - oappend (names8rex[reg + add]);9.3368 - else9.3369 - oappend (names8[reg + add]);9.3370 - break;9.3371 - case w_mode:9.3372 - oappend (names16[reg + add]);9.3373 - break;9.3374 - case d_mode:9.3375 - oappend (names32[reg + add]);9.3376 - break;9.3377 - case q_mode:9.3378 - oappend (names64[reg + add]);9.3379 - break;9.3380 - case v_mode:9.3381 - case dq_mode:9.3382 - case dqw_mode:9.3383 - USED_REX (REX_MODE64);9.3384 - if (rex & REX_MODE64)9.3385 - oappend (names64[reg + add]);9.3386 - else if ((sizeflag & DFLAG) || bytemode != v_mode)9.3387 - oappend (names32[reg + add]);9.3388 - else9.3389 - oappend (names16[reg + add]);9.3390 - used_prefixes |= (prefixes & PREFIX_DATA);9.3391 - break;9.3392 - default:9.3393 - oappend (INTERNAL_DISASSEMBLER_ERROR);9.3394 - break;9.3395 - }9.3396 -}9.3397 -9.3398 -static bfd_vma9.3399 -get64 (void)9.3400 -{9.3401 - bfd_vma x;9.3402 -#ifdef BFD649.3403 - unsigned int a;9.3404 - unsigned int b;9.3405 -9.3406 - FETCH_DATA (the_info, codep + 8);9.3407 - a = *codep++ & 0xff;9.3408 - a |= (*codep++ & 0xff) << 8;9.3409 - a |= (*codep++ & 0xff) << 16;9.3410 - a |= (*codep++ & 0xff) << 24;9.3411 - b = *codep++ & 0xff;9.3412 - b |= (*codep++ & 0xff) << 8;9.3413 - b |= (*codep++ & 0xff) << 16;9.3414 - b |= (*codep++ & 0xff) << 24;9.3415 - x = a + ((bfd_vma) b << 32);9.3416 -#else9.3417 - abort ();9.3418 - x = 0;9.3419 -#endif9.3420 - return x;9.3421 -}9.3422 -9.3423 -static bfd_signed_vma9.3424 -get32 (void)9.3425 -{9.3426 - bfd_signed_vma x = 0;9.3427 -9.3428 - FETCH_DATA (the_info, codep + 4);9.3429 - x = *codep++ & (bfd_signed_vma) 0xff;9.3430 - x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;9.3431 - x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;9.3432 - x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;9.3433 - return x;9.3434 -}9.3435 -9.3436 -static bfd_signed_vma9.3437 -get32s (void)9.3438 -{9.3439 - bfd_signed_vma x = 0;9.3440 -9.3441 - FETCH_DATA (the_info, codep + 4);9.3442 - x = *codep++ & (bfd_signed_vma) 0xff;9.3443 - x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;9.3444 - x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;9.3445 - x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;9.3446 -9.3447 - x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);9.3448 -9.3449 - return x;9.3450 -}9.3451 -9.3452 -static int9.3453 -get16 (void)9.3454 -{9.3455 - int x = 0;9.3456 -9.3457 - FETCH_DATA (the_info, codep + 2);9.3458 - x = *codep++ & 0xff;9.3459 - x |= (*codep++ & 0xff) << 8;9.3460 - return x;9.3461 -}9.3462 -9.3463 -static void9.3464 -set_op (bfd_vma op, int riprel)9.3465 -{9.3466 - op_index[op_ad] = op_ad;9.3467 - if (mode_64bit)9.3468 - {9.3469 - op_address[op_ad] = op;9.3470 - op_riprel[op_ad] = riprel;9.3471 - }9.3472 - else9.3473 - {9.3474 - /* Mask to get a 32-bit address. */9.3475 - op_address[op_ad] = op & 0xffffffff;9.3476 - op_riprel[op_ad] = riprel & 0xffffffff;9.3477 - }9.3478 -}9.3479 -9.3480 -static void9.3481 -OP_REG (int code, int sizeflag)9.3482 -{9.3483 - const char *s;9.3484 - int add = 0;9.3485 - USED_REX (REX_EXTZ);9.3486 - if (rex & REX_EXTZ)9.3487 - add = 8;9.3488 -9.3489 - switch (code)9.3490 - {9.3491 - case indir_dx_reg:9.3492 - if (intel_syntax)9.3493 - s = "[dx]";9.3494 - else9.3495 - s = "(%dx)";9.3496 - break;9.3497 - case ax_reg: case cx_reg: case dx_reg: case bx_reg:9.3498 - case sp_reg: case bp_reg: case si_reg: case di_reg:9.3499 - s = names16[code - ax_reg + add];9.3500 - break;9.3501 - case es_reg: case ss_reg: case cs_reg:9.3502 - case ds_reg: case fs_reg: case gs_reg:9.3503 - s = names_seg[code - es_reg + add];9.3504 - break;9.3505 - case al_reg: case ah_reg: case cl_reg: case ch_reg:9.3506 - case dl_reg: case dh_reg: case bl_reg: case bh_reg:9.3507 - USED_REX (0);9.3508 - if (rex)9.3509 - s = names8rex[code - al_reg + add];9.3510 - else9.3511 - s = names8[code - al_reg];9.3512 - break;9.3513 - case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:9.3514 - case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:9.3515 - if (mode_64bit)9.3516 - {9.3517 - s = names64[code - rAX_reg + add];9.3518 - break;9.3519 - }9.3520 - code += eAX_reg - rAX_reg;9.3521 - /* Fall through. */9.3522 - case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:9.3523 - case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:9.3524 - USED_REX (REX_MODE64);9.3525 - if (rex & REX_MODE64)9.3526 - s = names64[code - eAX_reg + add];9.3527 - else if (sizeflag & DFLAG)9.3528 - s = names32[code - eAX_reg + add];9.3529 - else9.3530 - s = names16[code - eAX_reg + add];9.3531 - used_prefixes |= (prefixes & PREFIX_DATA);9.3532 - break;9.3533 - default:9.3534 - s = INTERNAL_DISASSEMBLER_ERROR;9.3535 - break;9.3536 - }9.3537 - oappend (s);9.3538 -}9.3539 -9.3540 -static void9.3541 -OP_IMREG (int code, int sizeflag)9.3542 -{9.3543 - const char *s;9.3544 -9.3545 - switch (code)9.3546 - {9.3547 - case indir_dx_reg:9.3548 - if (intel_syntax)9.3549 - s = "[dx]";9.3550 - else9.3551 - s = "(%dx)";9.3552 - break;9.3553 - case ax_reg: case cx_reg: case dx_reg: case bx_reg:9.3554 - case sp_reg: case bp_reg: case si_reg: case di_reg:9.3555 - s = names16[code - ax_reg];9.3556 - break;9.3557 - case es_reg: case ss_reg: case cs_reg:9.3558 - case ds_reg: case fs_reg: case gs_reg:9.3559 - s = names_seg[code - es_reg];9.3560 - break;9.3561 - case al_reg: case ah_reg: case cl_reg: case ch_reg:9.3562 - case dl_reg: case dh_reg: case bl_reg: case bh_reg:9.3563 - USED_REX (0);9.3564 - if (rex)9.3565 - s = names8rex[code - al_reg];9.3566 - else9.3567 - s = names8[code - al_reg];9.3568 - break;9.3569 - case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:9.3570 - case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:9.3571 - USED_REX (REX_MODE64);9.3572 - if (rex & REX_MODE64)9.3573 - s = names64[code - eAX_reg];9.3574 - else if (sizeflag & DFLAG)9.3575 - s = names32[code - eAX_reg];9.3576 - else9.3577 - s = names16[code - eAX_reg];9.3578 - used_prefixes |= (prefixes & PREFIX_DATA);9.3579 - break;9.3580 - default:9.3581 - s = INTERNAL_DISASSEMBLER_ERROR;9.3582 - break;9.3583 - }9.3584 - oappend (s);9.3585 -}9.3586 -9.3587 -static void9.3588 -OP_I (int bytemode, int sizeflag)9.3589 -{9.3590 - bfd_signed_vma op;9.3591 - bfd_signed_vma mask = -1;9.3592 -9.3593 - switch (bytemode)9.3594 - {9.3595 - case b_mode:9.3596 - FETCH_DATA (the_info, codep + 1);9.3597 - op = *codep++;9.3598 - mask = 0xff;9.3599 - break;9.3600 - case q_mode:9.3601 - if (mode_64bit)9.3602 - {9.3603 - op = get32s ();9.3604 - break;9.3605 - }9.3606 - /* Fall through. */9.3607 - case v_mode:9.3608 - USED_REX (REX_MODE64);9.3609 - if (rex & REX_MODE64)9.3610 - op = get32s ();9.3611 - else if (sizeflag & DFLAG)9.3612 - {9.3613 - op = get32 ();9.3614 - mask = 0xffffffff;9.3615 - }9.3616 - else9.3617 - {9.3618 - op = get16 ();9.3619 - mask = 0xfffff;9.3620 - }9.3621 - used_prefixes |= (prefixes & PREFIX_DATA);9.3622 - break;9.3623 - case w_mode:9.3624 - mask = 0xfffff;9.3625 - op = get16 ();9.3626 - break;9.3627 - case const_1_mode:9.3628 - if (intel_syntax)9.3629 - oappend ("1");9.3630 - return;9.3631 - default:9.3632 - oappend (INTERNAL_DISASSEMBLER_ERROR);9.3633 - return;9.3634 - }9.3635 -9.3636 - op &= mask;9.3637 - scratchbuf[0] = '$';9.3638 - xlat_print_symbolic_operand (scratchbuf + 1, 1, op);9.3639 - oappend (scratchbuf + intel_syntax);9.3640 - scratchbuf[0] = '\0';9.3641 -}9.3642 -9.3643 -static void9.3644 -OP_I64 (int bytemode, int sizeflag)9.3645 -{9.3646 - bfd_signed_vma op;9.3647 - bfd_signed_vma mask = -1;9.3648 -9.3649 - if (!mode_64bit)9.3650 - {9.3651 - OP_I (bytemode, sizeflag);9.3652 - return;9.3653 - }9.3654 -9.3655 - switch (bytemode)9.3656 - {9.3657 - case b_mode:9.3658 - FETCH_DATA (the_info, codep + 1);9.3659 - op = *codep++;9.3660 - mask = 0xff;9.3661 - break;9.3662 - case v_mode:9.3663 - USED_REX (REX_MODE64);9.3664 - if (rex & REX_MODE64)9.3665 - op = get64 ();9.3666 - else if (sizeflag & DFLAG)9.3667 - {9.3668 - op = get32 ();9.3669 - mask = 0xffffffff;9.3670 - }9.3671 - else9.3672 - {9.3673 - op = get16 ();9.3674 - mask = 0xfffff;9.3675 - }9.3676 - used_prefixes |= (prefixes & PREFIX_DATA);9.3677 - break;9.3678 - case w_mode:9.3679 - mask = 0xfffff;9.3680 - op = get16 ();9.3681 - break;9.3682 - default:9.3683 - oappend (INTERNAL_DISASSEMBLER_ERROR);9.3684 - return;9.3685 - }9.3686 -9.3687 - op &= mask;9.3688 - scratchbuf[0] = '$';9.3689 - xlat_print_symbolic_operand (scratchbuf + 1, 1, op);9.3690 - oappend (scratchbuf + intel_syntax);9.3691 - scratchbuf[0] = '\0';9.3692 -}9.3693 -9.3694 -static void9.3695 -OP_sI (int bytemode, int sizeflag)9.3696 -{9.3697 - bfd_signed_vma op;9.3698 - bfd_signed_vma mask = -1;9.3699 -9.3700 - switch (bytemode)9.3701 - {9.3702 - case b_mode:9.3703 - FETCH_DATA (the_info, codep + 1);9.3704 - op = *codep++;9.3705 - if ((op & 0x80) != 0)9.3706 - op -= 0x100;9.3707 - mask = 0xffffffff;9.3708 - break;9.3709 - case v_mode:9.3710 - USED_REX (REX_MODE64);9.3711 - if (rex & REX_MODE64)9.3712 - op = get32s ();9.3713 - else if (sizeflag & DFLAG)9.3714 - {9.3715 - op = get32s ();9.3716 - mask = 0xffffffff;9.3717 - }9.3718 - else9.3719 - {9.3720 - mask = 0xffffffff;9.3721 - op = get16 ();9.3722 - if ((op & 0x8000) != 0)9.3723 - op -= 0x10000;9.3724 - }9.3725 - used_prefixes |= (prefixes & PREFIX_DATA);9.3726 - break;9.3727 - case w_mode:9.3728 - op = get16 ();9.3729 - mask = 0xffffffff;9.3730 - if ((op & 0x8000) != 0)9.3731 - op -= 0x10000;9.3732 - break;9.3733 - default:9.3734 - oappend (INTERNAL_DISASSEMBLER_ERROR);9.3735 - return;9.3736 - }9.3737 -9.3738 - scratchbuf[0] = '$';9.3739 - xlat_print_symbolic_operand (scratchbuf + 1, 1, op);9.3740 - oappend (scratchbuf + intel_syntax);9.3741 -}9.3742 -9.3743 -static void9.3744 -OP_J (int bytemode, int sizeflag)9.3745 -{9.3746 - bfd_vma disp;9.3747 - bfd_vma mask = -1;9.3748 -9.3749 - switch (bytemode)9.3750 - {9.3751 - case b_mode:9.3752 - FETCH_DATA (the_info, codep + 1);9.3753 - disp = *codep++;9.3754 - if ((disp & 0x80) != 0)9.3755 - disp -= 0x100;9.3756 - break;9.3757 - case v_mode:9.3758 - if (sizeflag & DFLAG)9.3759 - disp = get32s ();9.3760 - else9.3761 - {9.3762 - disp = get16 ();9.3763 - /* For some reason, a data16 prefix on a jump instruction9.3764 - means that the pc is masked to 16 bits after the9.3765 - displacement is added! */9.3766 - mask = 0xffff;9.3767 - }9.3768 - break;9.3769 - default:9.3770 - oappend (INTERNAL_DISASSEMBLER_ERROR);9.3771 - return;9.3772 - }9.3773 - disp = (start_pc + codep - start_codep + disp) & mask;9.3774 - set_op (disp, 0);9.3775 - xlat_print_symbolic_operand (scratchbuf, 1, disp);9.3776 - oappend (scratchbuf);9.3777 -}9.3778 -9.3779 -static void9.3780 -OP_SEG (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.3781 -{9.3782 - oappend (names_seg[reg]);9.3783 -}9.3784 -9.3785 -static void9.3786 -OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)9.3787 -{9.3788 - int seg, offset;9.3789 -9.3790 - if (sizeflag & DFLAG)9.3791 - {9.3792 - offset = get32 ();9.3793 - seg = get16 ();9.3794 - }9.3795 - else9.3796 - {9.3797 - offset = get16 ();9.3798 - seg = get16 ();9.3799 - }9.3800 - used_prefixes |= (prefixes & PREFIX_DATA);9.3801 - if (intel_syntax)9.3802 - sprintf (scratchbuf, "0x%x,0x%x", seg, offset);9.3803 - else9.3804 - sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);9.3805 - oappend (scratchbuf);9.3806 -}9.3807 -9.3808 -static void9.3809 -OP_OFF (int bytemode ATTRIBUTE_UNUSED, int sizeflag)9.3810 -{9.3811 - bfd_vma off;9.3812 -9.3813 - append_seg ();9.3814 -9.3815 - if ((sizeflag & AFLAG) || mode_64bit)9.3816 - off = get32 ();9.3817 - else9.3818 - off = get16 ();9.3819 -9.3820 - if (intel_syntax)9.3821 - {9.3822 - if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS9.3823 - | PREFIX_ES | PREFIX_FS | PREFIX_GS)))9.3824 - {9.3825 - oappend (names_seg[ds_reg - es_reg]);9.3826 - oappend (":");9.3827 - }9.3828 - }9.3829 - xlat_print_symbolic_operand (scratchbuf, 1, off);9.3830 - oappend (scratchbuf);9.3831 -}9.3832 -9.3833 -static void9.3834 -OP_OFF64 (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.3835 -{9.3836 - bfd_vma off;9.3837 -9.3838 - if (!mode_64bit)9.3839 - {9.3840 - OP_OFF (bytemode, sizeflag);9.3841 - return;9.3842 - }9.3843 -9.3844 - append_seg ();9.3845 -9.3846 - off = get64 ();9.3847 -9.3848 - if (intel_syntax)9.3849 - {9.3850 - if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS9.3851 - | PREFIX_ES | PREFIX_FS | PREFIX_GS)))9.3852 - {9.3853 - oappend (names_seg[ds_reg - es_reg]);9.3854 - oappend (":");9.3855 - }9.3856 - }9.3857 - xlat_print_symbolic_operand (scratchbuf, 1, off);9.3858 - oappend (scratchbuf);9.3859 -}9.3860 -9.3861 -static void9.3862 -ptr_reg (int code, int sizeflag)9.3863 -{9.3864 - const char *s;9.3865 -9.3866 - *obufp++ = open_char;9.3867 - used_prefixes |= (prefixes & PREFIX_ADDR);9.3868 - if (mode_64bit)9.3869 - {9.3870 - if (!(sizeflag & AFLAG))9.3871 - s = names32[code - eAX_reg];9.3872 - else9.3873 - s = names64[code - eAX_reg];9.3874 - }9.3875 - else if (sizeflag & AFLAG)9.3876 - s = names32[code - eAX_reg];9.3877 - else9.3878 - s = names16[code - eAX_reg];9.3879 - oappend (s);9.3880 - *obufp++ = close_char;9.3881 - *obufp = 0;9.3882 -}9.3883 -9.3884 -static void9.3885 -OP_ESreg (int code, int sizeflag)9.3886 -{9.3887 - if (intel_syntax)9.3888 - {9.3889 - if (codep[-1] & 1)9.3890 - {9.3891 - USED_REX (REX_MODE64);9.3892 - used_prefixes |= (prefixes & PREFIX_DATA);9.3893 - if (rex & REX_MODE64)9.3894 - oappend ("QWORD PTR ");9.3895 - else if ((sizeflag & DFLAG))9.3896 - oappend ("DWORD PTR ");9.3897 - else9.3898 - oappend ("WORD PTR ");9.3899 - }9.3900 - else9.3901 - oappend ("BYTE PTR ");9.3902 - }9.3903 -9.3904 - oappend ("%es:" + intel_syntax);9.3905 - ptr_reg (code, sizeflag);9.3906 -}9.3907 -9.3908 -static void9.3909 -OP_DSreg (int code, int sizeflag)9.3910 -{9.3911 - if (intel_syntax)9.3912 - {9.3913 - if (codep[-1] != 0xd7 && (codep[-1] & 1))9.3914 - {9.3915 - USED_REX (REX_MODE64);9.3916 - used_prefixes |= (prefixes & PREFIX_DATA);9.3917 - if (rex & REX_MODE64)9.3918 - oappend ("QWORD PTR ");9.3919 - else if ((sizeflag & DFLAG))9.3920 - oappend ("DWORD PTR ");9.3921 - else9.3922 - oappend ("WORD PTR ");9.3923 - }9.3924 - else9.3925 - oappend ("BYTE PTR ");9.3926 - }9.3927 -9.3928 - if ((prefixes9.3929 - & (PREFIX_CS9.3930 - | PREFIX_DS9.3931 - | PREFIX_SS9.3932 - | PREFIX_ES9.3933 - | PREFIX_FS9.3934 - | PREFIX_GS)) == 0)9.3935 - prefixes |= PREFIX_DS;9.3936 - append_seg ();9.3937 - ptr_reg (code, sizeflag);9.3938 -}9.3939 -9.3940 -static void9.3941 -OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.3942 -{9.3943 - int add = 0;9.3944 - if (rex & REX_EXTX)9.3945 - {9.3946 - USED_REX (REX_EXTX);9.3947 - add = 8;9.3948 - }9.3949 - else if (!mode_64bit && (prefixes & PREFIX_LOCK))9.3950 - {9.3951 - used_prefixes |= PREFIX_LOCK;9.3952 - add = 8;9.3953 - }9.3954 - sprintf (scratchbuf, "%%cr%d", reg + add);9.3955 - oappend (scratchbuf + intel_syntax);9.3956 -}9.3957 -9.3958 -static void9.3959 -OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.3960 -{9.3961 - int add = 0;9.3962 - USED_REX (REX_EXTX);9.3963 - if (rex & REX_EXTX)9.3964 - add = 8;9.3965 - if (intel_syntax)9.3966 - sprintf (scratchbuf, "db%d", reg + add);9.3967 - else9.3968 - sprintf (scratchbuf, "%%db%d", reg + add);9.3969 - oappend (scratchbuf);9.3970 -}9.3971 -9.3972 -static void9.3973 -OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.3974 -{9.3975 - sprintf (scratchbuf, "%%tr%d", reg);9.3976 - oappend (scratchbuf + intel_syntax);9.3977 -}9.3978 -9.3979 -static void9.3980 -OP_Rd (int bytemode, int sizeflag)9.3981 -{9.3982 - if (mod == 3)9.3983 - OP_E (bytemode, sizeflag);9.3984 - else9.3985 - BadOp ();9.3986 -}9.3987 -9.3988 -static void9.3989 -OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.3990 -{9.3991 - used_prefixes |= (prefixes & PREFIX_DATA);9.3992 - if (prefixes & PREFIX_DATA)9.3993 - {9.3994 - int add = 0;9.3995 - USED_REX (REX_EXTX);9.3996 - if (rex & REX_EXTX)9.3997 - add = 8;9.3998 - sprintf (scratchbuf, "%%xmm%d", reg + add);9.3999 - }9.4000 - else9.4001 - sprintf (scratchbuf, "%%mm%d", reg);9.4002 - oappend (scratchbuf + intel_syntax);9.4003 -}9.4004 -9.4005 -static void9.4006 -OP_XMM (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.4007 -{9.4008 - int add = 0;9.4009 - USED_REX (REX_EXTX);9.4010 - if (rex & REX_EXTX)9.4011 - add = 8;9.4012 - sprintf (scratchbuf, "%%xmm%d", reg + add);9.4013 - oappend (scratchbuf + intel_syntax);9.4014 -}9.4015 -9.4016 -static void9.4017 -OP_EM (int bytemode, int sizeflag)9.4018 -{9.4019 - if (mod != 3)9.4020 - {9.4021 - if (intel_syntax && bytemode == v_mode)9.4022 - {9.4023 - bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;9.4024 - used_prefixes |= (prefixes & PREFIX_DATA);9.4025 - }9.4026 - OP_E (bytemode, sizeflag);9.4027 - return;9.4028 - }9.4029 -9.4030 - /* Skip mod/rm byte. */9.4031 - MODRM_CHECK;9.4032 - codep++;9.4033 - used_prefixes |= (prefixes & PREFIX_DATA);9.4034 - if (prefixes & PREFIX_DATA)9.4035 - {9.4036 - int add = 0;9.4037 -9.4038 - USED_REX (REX_EXTZ);9.4039 - if (rex & REX_EXTZ)9.4040 - add = 8;9.4041 - sprintf (scratchbuf, "%%xmm%d", rm + add);9.4042 - }9.4043 - else9.4044 - sprintf (scratchbuf, "%%mm%d", rm);9.4045 - oappend (scratchbuf + intel_syntax);9.4046 -}9.4047 -9.4048 -static void9.4049 -OP_EX (int bytemode, int sizeflag)9.4050 -{9.4051 - int add = 0;9.4052 - if (mod != 3)9.4053 - {9.4054 - if (intel_syntax && bytemode == v_mode)9.4055 - {9.4056 - switch (prefixes & (PREFIX_DATA|PREFIX_REPZ|PREFIX_REPNZ))9.4057 - {9.4058 - case 0: bytemode = x_mode; break;9.4059 - case PREFIX_REPZ: bytemode = d_mode; used_prefixes |= PREFIX_REPZ; break;9.4060 - case PREFIX_DATA: bytemode = x_mode; used_prefixes |= PREFIX_DATA; break;9.4061 - case PREFIX_REPNZ: bytemode = q_mode; used_prefixes |= PREFIX_REPNZ; break;9.4062 - default: bytemode = 0; break;9.4063 - }9.4064 - }9.4065 - OP_E (bytemode, sizeflag);9.4066 - return;9.4067 - }9.4068 - USED_REX (REX_EXTZ);9.4069 - if (rex & REX_EXTZ)9.4070 - add = 8;9.4071 -9.4072 - /* Skip mod/rm byte. */9.4073 - MODRM_CHECK;9.4074 - codep++;9.4075 - sprintf (scratchbuf, "%%xmm%d", rm + add);9.4076 - oappend (scratchbuf + intel_syntax);9.4077 -}9.4078 -9.4079 -static void9.4080 -OP_MS (int bytemode, int sizeflag)9.4081 -{9.4082 - if (mod == 3)9.4083 - OP_EM (bytemode, sizeflag);9.4084 - else9.4085 - BadOp ();9.4086 -}9.4087 -9.4088 -static void9.4089 -OP_XS (int bytemode, int sizeflag)9.4090 -{9.4091 - if (mod == 3)9.4092 - OP_EX (bytemode, sizeflag);9.4093 - else9.4094 - BadOp ();9.4095 -}9.4096 -9.4097 -static void9.4098 -OP_M (int bytemode, int sizeflag)9.4099 -{9.4100 - if (mod == 3)9.4101 - BadOp (); /* bad lea,lds,les,lfs,lgs,lss modrm */9.4102 - else9.4103 - OP_E (bytemode, sizeflag);9.4104 -}9.4105 -9.4106 -static void9.4107 -OP_0f07 (int bytemode, int sizeflag)9.4108 -{9.4109 - if (mod != 3 || rm != 0)9.4110 - BadOp ();9.4111 - else9.4112 - OP_E (bytemode, sizeflag);9.4113 -}9.4114 -9.4115 -static void9.4116 -OP_0fae (int bytemode, int sizeflag)9.4117 -{9.4118 - if (mod == 3)9.4119 - {9.4120 - if (reg == 7)9.4121 - strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence");9.4122 -9.4123 - if (reg < 5 || rm != 0)9.4124 - {9.4125 - BadOp (); /* bad sfence, mfence, or lfence */9.4126 - return;9.4127 - }9.4128 - }9.4129 - else if (reg != 7)9.4130 - {9.4131 - BadOp (); /* bad clflush */9.4132 - return;9.4133 - }9.4134 -9.4135 - OP_E (bytemode, sizeflag);9.4136 -}9.4137 -9.4138 -static void9.4139 -NOP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.4140 -{9.4141 - /* NOP with REPZ prefix is called PAUSE. */9.4142 - if (prefixes == PREFIX_REPZ)9.4143 - strcpy (obuf, "pause");9.4144 -}9.4145 -9.4146 -static const char *const Suffix3DNow[] = {9.4147 -/* 00 */ NULL, NULL, NULL, NULL,9.4148 -/* 04 */ NULL, NULL, NULL, NULL,9.4149 -/* 08 */ NULL, NULL, NULL, NULL,9.4150 -/* 0C */ "pi2fw", "pi2fd", NULL, NULL,9.4151 -/* 10 */ NULL, NULL, NULL, NULL,9.4152 -/* 14 */ NULL, NULL, NULL, NULL,9.4153 -/* 18 */ NULL, NULL, NULL, NULL,9.4154 -/* 1C */ "pf2iw", "pf2id", NULL, NULL,9.4155 -/* 20 */ NULL, NULL, NULL, NULL,9.4156 -/* 24 */ NULL, NULL, NULL, NULL,9.4157 -/* 28 */ NULL, NULL, NULL, NULL,9.4158 -/* 2C */ NULL, NULL, NULL, NULL,9.4159 -/* 30 */ NULL, NULL, NULL, NULL,9.4160 -/* 34 */ NULL, NULL, NULL, NULL,9.4161 -/* 38 */ NULL, NULL, NULL, NULL,9.4162 -/* 3C */ NULL, NULL, NULL, NULL,9.4163 -/* 40 */ NULL, NULL, NULL, NULL,9.4164 -/* 44 */ NULL, NULL, NULL, NULL,9.4165 -/* 48 */ NULL, NULL, NULL, NULL,9.4166 -/* 4C */ NULL, NULL, NULL, NULL,9.4167 -/* 50 */ NULL, NULL, NULL, NULL,9.4168 -/* 54 */ NULL, NULL, NULL, NULL,9.4169 -/* 58 */ NULL, NULL, NULL, NULL,9.4170 -/* 5C */ NULL, NULL, NULL, NULL,9.4171 -/* 60 */ NULL, NULL, NULL, NULL,9.4172 -/* 64 */ NULL, NULL, NULL, NULL,9.4173 -/* 68 */ NULL, NULL, NULL, NULL,9.4174 -/* 6C */ NULL, NULL, NULL, NULL,9.4175 -/* 70 */ NULL, NULL, NULL, NULL,9.4176 -/* 74 */ NULL, NULL, NULL, NULL,9.4177 -/* 78 */ NULL, NULL, NULL, NULL,9.4178 -/* 7C */ NULL, NULL, NULL, NULL,9.4179 -/* 80 */ NULL, NULL, NULL, NULL,9.4180 -/* 84 */ NULL, NULL, NULL, NULL,9.4181 -/* 88 */ NULL, NULL, "pfnacc", NULL,9.4182 -/* 8C */ NULL, NULL, "pfpnacc", NULL,9.4183 -/* 90 */ "pfcmpge", NULL, NULL, NULL,9.4184 -/* 94 */ "pfmin", NULL, "pfrcp", "pfrsqrt",9.4185 -/* 98 */ NULL, NULL, "pfsub", NULL,9.4186 -/* 9C */ NULL, NULL, "pfadd", NULL,9.4187 -/* A0 */ "pfcmpgt", NULL, NULL, NULL,9.4188 -/* A4 */ "pfmax", NULL, "pfrcpit1", "pfrsqit1",9.4189 -/* A8 */ NULL, NULL, "pfsubr", NULL,9.4190 -/* AC */ NULL, NULL, "pfacc", NULL,9.4191 -/* B0 */ "pfcmpeq", NULL, NULL, NULL,9.4192 -/* B4 */ "pfmul", NULL, "pfrcpit2", "pfmulhrw",9.4193 -/* B8 */ NULL, NULL, NULL, "pswapd",9.4194 -/* BC */ NULL, NULL, NULL, "pavgusb",9.4195 -/* C0 */ NULL, NULL, NULL, NULL,9.4196 -/* C4 */ NULL, NULL, NULL, NULL,9.4197 -/* C8 */ NULL, NULL, NULL, NULL,9.4198 -/* CC */ NULL, NULL, NULL, NULL,9.4199 -/* D0 */ NULL, NULL, NULL, NULL,9.4200 -/* D4 */ NULL, NULL, NULL, NULL,9.4201 -/* D8 */ NULL, NULL, NULL, NULL,9.4202 -/* DC */ NULL, NULL, NULL, NULL,9.4203 -/* E0 */ NULL, NULL, NULL, NULL,9.4204 -/* E4 */ NULL, NULL, NULL, NULL,9.4205 -/* E8 */ NULL, NULL, NULL, NULL,9.4206 -/* EC */ NULL, NULL, NULL, NULL,9.4207 -/* F0 */ NULL, NULL, NULL, NULL,9.4208 -/* F4 */ NULL, NULL, NULL, NULL,9.4209 -/* F8 */ NULL, NULL, NULL, NULL,9.4210 -/* FC */ NULL, NULL, NULL, NULL,9.4211 -};9.4212 -9.4213 -static void9.4214 -OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.4215 -{9.4216 - const char *mnemonic;9.4217 -9.4218 - FETCH_DATA (the_info, codep + 1);9.4219 - /* AMD 3DNow! instructions are specified by an opcode suffix in the9.4220 - place where an 8-bit immediate would normally go. ie. the last9.4221 - byte of the instruction. */9.4222 - obufp = obuf + strlen (obuf);9.4223 - mnemonic = Suffix3DNow[*codep++ & 0xff];9.4224 - if (mnemonic)9.4225 - oappend (mnemonic);9.4226 - else9.4227 - {9.4228 - /* Since a variable sized modrm/sib chunk is between the start9.4229 - of the opcode (0x0f0f) and the opcode suffix, we need to do9.4230 - all the modrm processing first, and don't know until now that9.4231 - we have a bad opcode. This necessitates some cleaning up. */9.4232 - op1out[0] = '\0';9.4233 - op2out[0] = '\0';9.4234 - BadOp ();9.4235 - }9.4236 -}9.4237 -9.4238 -static const char *simd_cmp_op[] = {9.4239 - "eq",9.4240 - "lt",9.4241 - "le",9.4242 - "unord",9.4243 - "neq",9.4244 - "nlt",9.4245 - "nle",9.4246 - "ord"9.4247 -};9.4248 -9.4249 -static void9.4250 -OP_SIMD_Suffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)9.4251 -{9.4252 - unsigned int cmp_type;9.4253 -9.4254 - FETCH_DATA (the_info, codep + 1);9.4255 - obufp = obuf + strlen (obuf);9.4256 - cmp_type = *codep++ & 0xff;9.4257 - if (cmp_type < 8)9.4258 - {9.4259 - char suffix1 = 'p', suffix2 = 's';9.4260 - used_prefixes |= (prefixes & PREFIX_REPZ);9.4261 - if (prefixes & PREFIX_REPZ)9.4262 - suffix1 = 's';9.4263 - else9.4264 - {9.4265 - used_prefixes |= (prefixes & PREFIX_DATA);9.4266 - if (prefixes & PREFIX_DATA)9.4267 - suffix2 = 'd';9.4268 - else9.4269 - {9.4270 - used_prefixes |= (prefixes & PREFIX_REPNZ);9.4271 - if (prefixes & PREFIX_REPNZ)9.4272 - suffix1 = 's', suffix2 = 'd';9.4273 - }9.4274 - }9.4275 - sprintf (scratchbuf, "cmp%s%c%c",9.4276 - simd_cmp_op[cmp_type], suffix1, suffix2);9.4277 - used_prefixes |= (prefixes & PREFIX_REPZ);9.4278 - oappend (scratchbuf);9.4279 - }9.4280 - else9.4281 - {9.4282 - /* We have a bad extension byte. Clean up. */9.4283 - op1out[0] = '\0';9.4284 - op2out[0] = '\0';9.4285 - BadOp ();9.4286 - }9.4287 -}9.4288 -9.4289 -static void9.4290 -SIMD_Fixup (int extrachar, int sizeflag ATTRIBUTE_UNUSED)9.4291 -{9.4292 - /* Change movlps/movhps to movhlps/movlhps for 2 register operand9.4293 - forms of these instructions. */9.4294 - if (mod == 3)9.4295 - {9.4296 - char *p = obuf + strlen (obuf);9.4297 - *(p + 1) = '\0';9.4298 - *p = *(p - 1);9.4299 - *(p - 1) = *(p - 2);9.4300 - *(p - 2) = *(p - 3);9.4301 - *(p - 3) = extrachar;9.4302 - }9.4303 -}9.4304 -9.4305 -static void9.4306 -PNI_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag)9.4307 -{9.4308 - if (mod == 3 && reg == 1 && rm <= 1)9.4309 - {9.4310 - /* Override "sidt". */9.4311 - char *p = obuf + strlen (obuf) - 4;9.4312 -9.4313 - /* We might have a suffix. */9.4314 - if (*p == 'i')9.4315 - --p;9.4316 -9.4317 - if (rm)9.4318 - {9.4319 - /* mwait %eax,%ecx */9.4320 - strcpy (p, "mwait");9.4321 - if (!intel_syntax)9.4322 - strcpy (op1out, names32[0]);9.4323 - }9.4324 - else9.4325 - {9.4326 - /* monitor %eax,%ecx,%edx" */9.4327 - strcpy (p, "monitor");9.4328 - if (!intel_syntax)9.4329 - {9.4330 - if (!mode_64bit)9.4331 - strcpy (op1out, names32[0]);9.4332 - else if (!(prefixes & PREFIX_ADDR))9.4333 - strcpy (op1out, names64[0]);9.4334 - else9.4335 - {9.4336 - strcpy (op1out, names32[0]);9.4337 - used_prefixes |= PREFIX_ADDR;9.4338 - }9.4339 - strcpy (op3out, names32[2]);9.4340 - }9.4341 - }9.4342 - if (!intel_syntax)9.4343 - {9.4344 - strcpy (op2out, names32[1]);9.4345 - two_source_ops = 1;9.4346 - }9.4347 -9.4348 - codep++;9.4349 - }9.4350 - else9.4351 - OP_E (0, sizeflag);9.4352 -}9.4353 -9.4354 -static void9.4355 -INVLPG_Fixup (int bytemode, int sizeflag)9.4356 -{9.4357 - const char *alt;9.4358 -9.4359 - switch (*codep)9.4360 - {9.4361 - case 0xf8:9.4362 - alt = "swapgs";9.4363 - break;9.4364 - case 0xf9:9.4365 - alt = "rdtscp";9.4366 - break;9.4367 - default:9.4368 - OP_E (bytemode, sizeflag);9.4369 - return;9.4370 - }9.4371 - /* Override "invlpg". */9.4372 - strcpy (obuf + strlen (obuf) - 6, alt);9.4373 - codep++;9.4374 -}9.4375 -9.4376 -static void9.4377 -BadOp (void)9.4378 -{9.4379 - /* Throw away prefixes and 1st. opcode byte. */9.4380 - codep = insn_codep + 1;9.4381 - oappend ("(bad)");9.4382 -}
10.1 --- a/src/x86dasm/symcat.h Tue Mar 06 09:04:34 2012 +100010.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +000010.3 @@ -1,49 +0,0 @@10.4 -/* Symbol concatenation utilities.10.5 -10.6 - Copyright (C) 1998, 2000 Free Software Foundation, Inc.10.7 -10.8 - This program is free software; you can redistribute it and/or modify10.9 - it under the terms of the GNU General Public License as published by10.10 - the Free Software Foundation; either version 2 of the License, or10.11 - (at your option) any later version.10.12 -10.13 - This program is distributed in the hope that it will be useful,10.14 - but WITHOUT ANY WARRANTY; without even the implied warranty of10.15 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the10.16 - GNU General Public License for more details.10.17 -10.18 - You should have received a copy of the GNU General Public License along10.19 - with this program; if not, write to the Free Software Foundation, Inc.,10.20 - 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */10.21 -10.22 -#ifndef SYM_CAT_H10.23 -#define SYM_CAT_H10.24 -10.25 -#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)10.26 -#define CONCAT2(a,b) a##b10.27 -#define CONCAT3(a,b,c) a##b##c10.28 -#define CONCAT4(a,b,c,d) a##b##c##d10.29 -#define STRINGX(s) #s10.30 -#else10.31 -/* Note one should never pass extra whitespace to the CONCATn macros,10.32 - e.g. CONCAT2(foo, bar) because traditonal C will keep the space between10.33 - the two labels instead of concatenating them. Instead, make sure to10.34 - write CONCAT2(foo,bar). */10.35 -#define CONCAT2(a,b) a/**/b10.36 -#define CONCAT3(a,b,c) a/**/b/**/c10.37 -#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d10.38 -#define STRINGX(s) "s"10.39 -#endif10.40 -10.41 -#define XCONCAT2(a,b) CONCAT2(a,b)10.42 -#define XCONCAT3(a,b,c) CONCAT3(a,b,c)10.43 -#define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d)10.44 -10.45 -/* Note the layer of indirection here is typically used to allow10.46 - stringification of the expansion of macros. I.e. "#define foo10.47 - bar", "XSTRING(foo)", to yield "bar". Be aware that this only10.48 - works for __STDC__, not for traditional C which will still resolve10.49 - to "foo". */10.50 -#define XSTRING(s) STRINGX(s)10.51 -10.52 -#endif /* SYM_CAT_H */
11.1 --- a/src/x86dasm/sysdep.h Tue Mar 06 09:04:34 2012 +100011.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +000011.3 @@ -1,42 +0,0 @@11.4 -/* Random host-dependent support code.11.5 - Copyright 1995, 1997, 2000 Free Software Foundation, Inc.11.6 - Written by Ken Raeburn.11.7 -11.8 -This file is part of libopcodes, the opcodes library.11.9 -11.10 -This program is free software; you can redistribute it and/or modify11.11 -it under the terms of the GNU General Public License as published by11.12 -the Free Software Foundation; either version 2 of the License, or11.13 -(at your option) any later version.11.14 -11.15 -This program is distributed in the hope that it will be useful,11.16 -but WITHOUT ANY WARRANTY; without even the implied warranty of11.17 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11.18 -GNU General Public License for more details.11.19 -11.20 -You should have received a copy of the GNU General Public License11.21 -along with this program; if not, write to the Free Software11.22 -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */11.23 -11.24 -/* Do system-dependent stuff, mainly driven by autoconf-detected info.11.25 -11.26 - Well, some generic common stuff is done here too, like including11.27 - ansidecl.h. That's because the .h files in bfd/hosts files I'm11.28 - trying to replace often did that. If it can be dropped from this11.29 - file (check in a non-ANSI environment!), it should be. */11.30 -11.31 -#include "lxdream.h"11.32 -11.33 -#include "x86dasm/ansidecl.h"11.34 -11.35 -#ifdef HAVE_STDLIB_H11.36 -#include <stdlib.h>11.37 -#endif11.38 -11.39 -#ifdef HAVE_STRING_H11.40 -#include <string.h>11.41 -#else11.42 -#ifdef HAVE_STRINGS_H11.43 -#include <strings.h>11.44 -#endif11.45 -#endif
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +000012.2 +++ b/src/xlat/disasm/README Tue Mar 06 12:19:08 2012 +100012.3 @@ -0,0 +1,1 @@12.4 +i386-dis extracted from binutils 2.16.1 and modified to play with lxdream.
13.1 --- /dev/null Thu Jan 01 00:00:00 1970 +000013.2 +++ b/src/xlat/disasm/ansidecl.h Tue Mar 06 12:19:08 2012 +100013.3 @@ -0,0 +1,346 @@13.4 +/* ANSI and traditional C compatability macros13.5 + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 200113.6 + Free Software Foundation, Inc.13.7 + This file is part of the GNU C Library.13.8 +13.9 +This program is free software; you can redistribute it and/or modify13.10 +it under the terms of the GNU General Public License as published by13.11 +the Free Software Foundation; either version 2 of the License, or13.12 +(at your option) any later version.13.13 +13.14 +This program is distributed in the hope that it will be useful,13.15 +but WITHOUT ANY WARRANTY; without even the implied warranty of13.16 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13.17 +GNU General Public License for more details.13.18 +13.19 +You should have received a copy of the GNU General Public License13.20 +along with this program; if not, write to the Free Software13.21 +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */13.22 +13.23 +/* ANSI and traditional C compatibility macros13.24 +13.25 + ANSI C is assumed if __STDC__ is #defined.13.26 +13.27 + Macro ANSI C definition Traditional C definition13.28 + ----- ---- - ---------- ----------- - ----------13.29 + ANSI_PROTOTYPES 1 not defined13.30 + PTR `void *' `char *'13.31 + PTRCONST `void *const' `char *'13.32 + LONG_DOUBLE `long double' `double'13.33 + const not defined `'13.34 + volatile not defined `'13.35 + signed not defined `'13.36 + VA_START(ap, var) va_start(ap, var) va_start(ap)13.37 +13.38 + Note that it is safe to write "void foo();" indicating a function13.39 + with no return value, in all K+R compilers we have been able to test.13.40 +13.41 + For declaring functions with prototypes, we also provide these:13.42 +13.43 + PARAMS ((prototype))13.44 + -- for functions which take a fixed number of arguments. Use this13.45 + when declaring the function. When defining the function, write a13.46 + K+R style argument list. For example:13.47 +13.48 + char *strcpy PARAMS ((char *dest, char *source));13.49 + ...13.50 + char *13.51 + strcpy (dest, source)13.52 + char *dest;13.53 + char *source;13.54 + { ... }13.55 +13.56 +13.57 + VPARAMS ((prototype, ...))13.58 + -- for functions which take a variable number of arguments. Use13.59 + PARAMS to declare the function, VPARAMS to define it. For example:13.60 +13.61 + int printf PARAMS ((const char *format, ...));13.62 + ...13.63 + int13.64 + printf VPARAMS ((const char *format, ...))13.65 + {13.66 + ...13.67 + }13.68 +13.69 + For writing functions which take variable numbers of arguments, we13.70 + also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These13.71 + hide the differences between K+R <varargs.h> and C89 <stdarg.h> more13.72 + thoroughly than the simple VA_START() macro mentioned above.13.73 +13.74 + VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end.13.75 + Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls13.76 + corresponding to the list of fixed arguments. Then use va_arg13.77 + normally to get the variable arguments, or pass your va_list object13.78 + around. You do not declare the va_list yourself; VA_OPEN does it13.79 + for you.13.80 +13.81 + Here is a complete example:13.82 +13.83 + int13.84 + printf VPARAMS ((const char *format, ...))13.85 + {13.86 + int result;13.87 +13.88 + VA_OPEN (ap, format);13.89 + VA_FIXEDARG (ap, const char *, format);13.90 +13.91 + result = vfprintf (stdout, format, ap);13.92 + VA_CLOSE (ap);13.93 +13.94 + return result;13.95 + }13.96 +13.97 +13.98 + You can declare variables either before or after the VA_OPEN,13.99 + VA_FIXEDARG sequence. Also, VA_OPEN and VA_CLOSE are the beginning13.100 + and end of a block. They must appear at the same nesting level,13.101 + and any variables declared after VA_OPEN go out of scope at13.102 + VA_CLOSE. Unfortunately, with a K+R compiler, that includes the13.103 + argument list. You can have multiple instances of VA_OPEN/VA_CLOSE13.104 + pairs in a single function in case you need to traverse the13.105 + argument list more than once.13.106 +13.107 + For ease of writing code which uses GCC extensions but needs to be13.108 + portable to other compilers, we provide the GCC_VERSION macro that13.109 + simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various13.110 + wrappers around __attribute__. Also, __extension__ will be #defined13.111 + to nothing if it doesn't work. See below.13.112 +13.113 + This header also defines a lot of obsolete macros:13.114 + CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,13.115 + AND, DOTS, NOARGS. Don't use them. */13.116 +13.117 +#ifndef _ANSIDECL_H13.118 +#define _ANSIDECL_H 113.119 +13.120 +/* Every source file includes this file,13.121 + so they will all get the switch for lint. */13.122 +/* LINTLIBRARY */13.123 +13.124 +/* Using MACRO(x,y) in cpp #if conditionals does not work with some13.125 + older preprocessors. Thus we can't define something like this:13.126 +13.127 +#define HAVE_GCC_VERSION(MAJOR, MINOR) \13.128 + (__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))13.129 +13.130 +and then test "#if HAVE_GCC_VERSION(2,7)".13.131 +13.132 +So instead we use the macro below and test it against specific values. */13.133 +13.134 +/* This macro simplifies testing whether we are using gcc, and if it13.135 + is of a particular minimum version. (Both major & minor numbers are13.136 + significant.) This macro will evaluate to 0 if we are not using13.137 + gcc at all. */13.138 +#ifndef GCC_VERSION13.139 +#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)13.140 +#endif /* GCC_VERSION */13.141 +13.142 +#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32) || (defined(__alpha) && defined(__cplusplus))13.143 +/* All known AIX compilers implement these things (but don't always13.144 + define __STDC__). The RISC/OS MIPS compiler defines these things13.145 + in SVR4 mode, but does not define __STDC__. */13.146 +/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other13.147 + C++ compilers, does not define __STDC__, though it acts as if this13.148 + was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */13.149 +13.150 +#define ANSI_PROTOTYPES 113.151 +#define PTR void *13.152 +#define PTRCONST void *const13.153 +#define LONG_DOUBLE long double13.154 +13.155 +/* PARAMS is often defined elsewhere (e.g. by libintl.h), so wrap it in13.156 + a #ifndef. */13.157 +#ifndef PARAMS13.158 +#define PARAMS(ARGS) ARGS13.159 +#endif13.160 +13.161 +#define VPARAMS(ARGS) ARGS13.162 +#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR)13.163 +13.164 +/* variadic function helper macros */13.165 +/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's13.166 + use without inhibiting further decls and without declaring an13.167 + actual variable. */13.168 +#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy13.169 +#define VA_CLOSE(AP) } va_end(AP); }13.170 +#define VA_FIXEDARG(AP, T, N) struct Qdmy13.171 +13.172 +#undef const13.173 +#undef volatile13.174 +#undef signed13.175 +13.176 +/* inline requires special treatment; it's in C99, and GCC >=2.7 supports13.177 + it too, but it's not in C89. */13.178 +#undef inline13.179 +#if __STDC_VERSION__ > 199901L13.180 +/* it's a keyword */13.181 +#else13.182 +# if GCC_VERSION >= 200713.183 +# define inline __inline__ /* __inline__ prevents -pedantic warnings */13.184 +# else13.185 +# define inline /* nothing */13.186 +# endif13.187 +#endif13.188 +13.189 +/* These are obsolete. Do not use. */13.190 +#ifndef IN_GCC13.191 +#define CONST const13.192 +#define VOLATILE volatile13.193 +#define SIGNED signed13.194 +13.195 +#define PROTO(type, name, arglist) type name arglist13.196 +#define EXFUN(name, proto) name proto13.197 +#define DEFUN(name, arglist, args) name(args)13.198 +#define DEFUN_VOID(name) name(void)13.199 +#define AND ,13.200 +#define DOTS , ...13.201 +#define NOARGS void13.202 +#endif /* ! IN_GCC */13.203 +13.204 +#else /* Not ANSI C. */13.205 +13.206 +#undef ANSI_PROTOTYPES13.207 +#define PTR char *13.208 +#define PTRCONST PTR13.209 +#define LONG_DOUBLE double13.210 +13.211 +#define PARAMS(args) ()13.212 +#define VPARAMS(args) (va_alist) va_dcl13.213 +#define VA_START(va_list, var) va_start(va_list)13.214 +13.215 +#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy13.216 +#define VA_CLOSE(AP) } va_end(AP); }13.217 +#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)13.218 +13.219 +/* some systems define these in header files for non-ansi mode */13.220 +#undef const13.221 +#undef volatile13.222 +#undef signed13.223 +#undef inline13.224 +#define const13.225 +#define volatile13.226 +#define signed13.227 +#define inline13.228 +13.229 +#ifndef IN_GCC13.230 +#define CONST13.231 +#define VOLATILE13.232 +#define SIGNED13.233 +13.234 +#define PROTO(type, name, arglist) type name ()13.235 +#define EXFUN(name, proto) name()13.236 +#define DEFUN(name, arglist, args) name arglist args;13.237 +#define DEFUN_VOID(name) name()13.238 +#define AND ;13.239 +#define DOTS13.240 +#define NOARGS13.241 +#endif /* ! IN_GCC */13.242 +13.243 +#endif /* ANSI C. */13.244 +13.245 +/* Define macros for some gcc attributes. This permits us to use the13.246 + macros freely, and know that they will come into play for the13.247 + version of gcc in which they are supported. */13.248 +13.249 +#if (GCC_VERSION < 2007)13.250 +# define __attribute__(x)13.251 +#endif13.252 +13.253 +/* Attribute __malloc__ on functions was valid as of gcc 2.96. */13.254 +#ifndef ATTRIBUTE_MALLOC13.255 +# if (GCC_VERSION >= 2096)13.256 +# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))13.257 +# else13.258 +# define ATTRIBUTE_MALLOC13.259 +# endif /* GNUC >= 2.96 */13.260 +#endif /* ATTRIBUTE_MALLOC */13.261 +13.262 +/* Attributes on labels were valid as of gcc 2.93. */13.263 +#ifndef ATTRIBUTE_UNUSED_LABEL13.264 +# if (GCC_VERSION >= 2093)13.265 +# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED13.266 +# else13.267 +# define ATTRIBUTE_UNUSED_LABEL13.268 +# endif /* GNUC >= 2.93 */13.269 +#endif /* ATTRIBUTE_UNUSED_LABEL */13.270 +13.271 +#ifndef ATTRIBUTE_UNUSED13.272 +#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))13.273 +#endif /* ATTRIBUTE_UNUSED */13.274 +13.275 +/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the13.276 + identifier name. */13.277 +#if ! defined(__cplusplus) || (GCC_VERSION >= 3004)13.278 +# define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED13.279 +#else /* !__cplusplus || GNUC >= 3.4 */13.280 +# define ARG_UNUSED(NAME) NAME13.281 +#endif /* !__cplusplus || GNUC >= 3.4 */13.282 +13.283 +#ifndef ATTRIBUTE_NORETURN13.284 +#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))13.285 +#endif /* ATTRIBUTE_NORETURN */13.286 +13.287 +/* Attribute `nonnull' was valid as of gcc 3.3. */13.288 +#ifndef ATTRIBUTE_NONNULL13.289 +# if (GCC_VERSION >= 3003)13.290 +# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))13.291 +# else13.292 +# define ATTRIBUTE_NONNULL(m)13.293 +# endif /* GNUC >= 3.3 */13.294 +#endif /* ATTRIBUTE_NONNULL */13.295 +13.296 +/* Attribute `pure' was valid as of gcc 3.0. */13.297 +#ifndef ATTRIBUTE_PURE13.298 +# if (GCC_VERSION >= 3000)13.299 +# define ATTRIBUTE_PURE __attribute__ ((__pure__))13.300 +# else13.301 +# define ATTRIBUTE_PURE13.302 +# endif /* GNUC >= 3.0 */13.303 +#endif /* ATTRIBUTE_PURE */13.304 +13.305 +/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL.13.306 + This was the case for the `printf' format attribute by itself13.307 + before GCC 3.3, but as of 3.3 we need to add the `nonnull'13.308 + attribute to retain this behavior. */13.309 +#ifndef ATTRIBUTE_PRINTF13.310 +#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)13.311 +#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)13.312 +#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)13.313 +#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)13.314 +#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)13.315 +#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)13.316 +#endif /* ATTRIBUTE_PRINTF */13.317 +13.318 +/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A13.319 + NULL format specifier was allowed as of gcc 3.3. */13.320 +#ifndef ATTRIBUTE_NULL_PRINTF13.321 +# if (GCC_VERSION >= 3003)13.322 +# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))13.323 +# else13.324 +# define ATTRIBUTE_NULL_PRINTF(m, n)13.325 +# endif /* GNUC >= 3.3 */13.326 +# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2)13.327 +# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3)13.328 +# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4)13.329 +# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5)13.330 +# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)13.331 +#endif /* ATTRIBUTE_NULL_PRINTF */13.332 +13.333 +/* Attribute `sentinel' was valid as of gcc 3.5. */13.334 +#ifndef ATTRIBUTE_SENTINEL13.335 +# if (GCC_VERSION >= 3005)13.336 +# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))13.337 +# else13.338 +# define ATTRIBUTE_SENTINEL13.339 +# endif /* GNUC >= 3.5 */13.340 +#endif /* ATTRIBUTE_SENTINEL */13.341 +13.342 +/* We use __extension__ in some places to suppress -pedantic warnings13.343 + about GCC extensions. This feature didn't work properly before13.344 + gcc 2.8. */13.345 +#if GCC_VERSION < 200813.346 +#define __extension__13.347 +#endif13.348 +13.349 +#endif /* ansidecl.h */
14.1 --- /dev/null Thu Jan 01 00:00:00 1970 +000014.2 +++ b/src/xlat/disasm/bfd.h Tue Mar 06 12:19:08 2012 +100014.3 @@ -0,0 +1,4714 @@14.4 +/* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically14.5 + generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c",14.6 + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c",14.7 + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c",14.8 + "linker.c" and "simple.c".14.9 + Run "make headers" in your build bfd/ to regenerate. */14.10 +14.11 +/* Main header file for the bfd library -- portable access to object files.14.12 +14.13 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,14.14 + 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.14.15 +14.16 + Contributed by Cygnus Support.14.17 +14.18 + This file is part of BFD, the Binary File Descriptor library.14.19 +14.20 + This program is free software; you can redistribute it and/or modify14.21 + it under the terms of the GNU General Public License as published by14.22 + the Free Software Foundation; either version 2 of the License, or14.23 + (at your option) any later version.14.24 +14.25 + This program is distributed in the hope that it will be useful,14.26 + but WITHOUT ANY WARRANTY; without even the implied warranty of14.27 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the14.28 + GNU General Public License for more details.14.29 +14.30 + You should have received a copy of the GNU General Public License14.31 + along with this program; if not, write to the Free Software14.32 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */14.33 +14.34 +#ifndef __BFD_H_SEEN__14.35 +#define __BFD_H_SEEN__14.36 +14.37 +#ifdef __cplusplus14.38 +extern "C" {14.39 +#endif14.40 +14.41 +#include "xlat/disasm/ansidecl.h"14.42 +#include "xlat/disasm/symcat.h"14.43 +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)14.44 +#ifndef SABER14.45 +/* This hack is to avoid a problem with some strict ANSI C preprocessors.14.46 + The problem is, "32_" is not a valid preprocessing token, and we don't14.47 + want extra underscores (e.g., "nlm_32_"). The XCONCAT2 macro will14.48 + cause the inner CONCAT2 macros to be evaluated first, producing14.49 + still-valid pp-tokens. Then the final concatenation can be done. */14.50 +#undef CONCAT414.51 +#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))14.52 +#endif14.53 +#endif14.54 +14.55 +/* The word size used by BFD on the host. This may be 64 with a 3214.56 + bit target if the host is 64 bit, or if other 64 bit targets have14.57 + been selected with --enable-targets, or if --enable-64-bit-bfd. */14.58 +#define BFD_ARCH_SIZE 6414.59 +14.60 +/* The word size of the default bfd target. */14.61 +#define BFD_DEFAULT_TARGET_SIZE 3214.62 +14.63 +#define BFD_HOST_64BIT_LONG 014.64 +#define BFD_HOST_LONG_LONG 114.65 +#if 114.66 +#define BFD_HOST_64_BIT long long14.67 +#define BFD_HOST_U_64_BIT unsigned long long14.68 +typedef BFD_HOST_64_BIT bfd_int64_t;14.69 +typedef BFD_HOST_U_64_BIT bfd_uint64_t;14.70 +#endif14.71 +14.72 +#if BFD_ARCH_SIZE >= 6414.73 +#define BFD6414.74 +#endif14.75 +14.76 +#ifndef INLINE14.77 +#if __GNUC__ >= 214.78 +#define INLINE __inline__14.79 +#else14.80 +#define INLINE14.81 +#endif14.82 +#endif14.83 +14.84 +/* Forward declaration. */14.85 +typedef struct bfd bfd;14.86 +14.87 +/* Boolean type used in bfd. Too many systems define their own14.88 + versions of "boolean" for us to safely typedef a "boolean" of14.89 + our own. Using an enum for "bfd_boolean" has its own set of14.90 + problems, with strange looking casts required to avoid warnings14.91 + on some older compilers. Thus we just use an int.14.92 +14.93 + General rule: Functions which are bfd_boolean return TRUE on14.94 + success and FALSE on failure (unless they're a predicate). */14.95 +14.96 +typedef int bfd_boolean;14.97 +#undef FALSE14.98 +#undef TRUE14.99 +#define FALSE 014.100 +#define TRUE 114.101 +14.102 +#ifdef BFD6414.103 +14.104 +#ifndef BFD_HOST_64_BIT14.105 + #error No 64 bit integer type available14.106 +#endif /* ! defined (BFD_HOST_64_BIT) */14.107 +14.108 +typedef BFD_HOST_U_64_BIT bfd_vma;14.109 +typedef BFD_HOST_64_BIT bfd_signed_vma;14.110 +typedef BFD_HOST_U_64_BIT bfd_size_type;14.111 +typedef BFD_HOST_U_64_BIT symvalue;14.112 +14.113 +#ifndef fprintf_vma14.114 +#if BFD_HOST_64BIT_LONG14.115 +#define sprintf_vma(s,x) sprintf (s, "%016lx", x)14.116 +#define fprintf_vma(f,x) fprintf (f, "%016lx", x)14.117 +#else14.118 +#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))14.119 +#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))14.120 +#define fprintf_vma(s,x) \14.121 + fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))14.122 +#define sprintf_vma(s,x) \14.123 + sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))14.124 +#endif14.125 +#endif14.126 +14.127 +#else /* not BFD64 */14.128 +14.129 +/* Represent a target address. Also used as a generic unsigned type14.130 + which is guaranteed to be big enough to hold any arithmetic types14.131 + we need to deal with. */14.132 +typedef unsigned long bfd_vma;14.133 +14.134 +/* A generic signed type which is guaranteed to be big enough to hold any14.135 + arithmetic types we need to deal with. Can be assumed to be compatible14.136 + with bfd_vma in the same way that signed and unsigned ints are compatible14.137 + (as parameters, in assignment, etc). */14.138 +typedef long bfd_signed_vma;14.139 +14.140 +typedef unsigned long symvalue;14.141 +typedef unsigned long bfd_size_type;14.142 +14.143 +/* Print a bfd_vma x on stream s. */14.144 +#define fprintf_vma(s,x) fprintf (s, "%08lx", x)14.145 +#define sprintf_vma(s,x) sprintf (s, "%08lx", x)14.146 +14.147 +#endif /* not BFD64 */14.148 +14.149 +#ifndef BFD_HOST_64_BIT14.150 +/* Fall back on a 32 bit type. The idea is to make these types always14.151 + available for function return types, but in the case that14.152 + BFD_HOST_64_BIT is undefined such a function should abort or14.153 + otherwise signal an error. */14.154 +typedef bfd_signed_vma bfd_int64_t;14.155 +typedef bfd_vma bfd_uint64_t;14.156 +#endif14.157 +14.158 +/* An offset into a file. BFD always uses the largest possible offset14.159 + based on the build time availability of fseek, fseeko, or fseeko64. */14.160 +typedef BFD_HOST_64_BIT file_ptr;14.161 +typedef unsigned BFD_HOST_64_BIT ufile_ptr;14.162 +14.163 +extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);14.164 +extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);14.165 +14.166 +#define printf_vma(x) fprintf_vma(stdout,x)14.167 +#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)14.168 +14.169 +typedef unsigned int flagword; /* 32 bits of flags */14.170 +typedef unsigned char bfd_byte;14.171 +14.172 +/* File formats. */14.173 +14.174 +typedef enum bfd_format14.175 +{14.176 + bfd_unknown = 0, /* File format is unknown. */14.177 + bfd_object, /* Linker/assembler/compiler output. */14.178 + bfd_archive, /* Object archive file. */14.179 + bfd_core, /* Core dump. */14.180 + bfd_type_end /* Marks the end; don't use it! */14.181 +}14.182 +bfd_format;14.183 +14.184 +/* Values that may appear in the flags field of a BFD. These also14.185 + appear in the object_flags field of the bfd_target structure, where14.186 + they indicate the set of flags used by that backend (not all flags14.187 + are meaningful for all object file formats) (FIXME: at the moment,14.188 + the object_flags values have mostly just been copied from backend14.189 + to another, and are not necessarily correct). */14.190 +14.191 +/* No flags. */14.192 +#define BFD_NO_FLAGS 0x0014.193 +14.194 +/* BFD contains relocation entries. */14.195 +#define HAS_RELOC 0x0114.196 +14.197 +/* BFD is directly executable. */14.198 +#define EXEC_P 0x0214.199 +14.200 +/* BFD has line number information (basically used for F_LNNO in a14.201 + COFF header). */14.202 +#define HAS_LINENO 0x0414.203 +14.204 +/* BFD has debugging information. */14.205 +#define HAS_DEBUG 0x0814.206 +14.207 +/* BFD has symbols. */14.208 +#define HAS_SYMS 0x1014.209 +14.210 +/* BFD has local symbols (basically used for F_LSYMS in a COFF14.211 + header). */14.212 +#define HAS_LOCALS 0x2014.213 +14.214 +/* BFD is a dynamic object. */14.215 +#define DYNAMIC 0x4014.216 +14.217 +/* Text section is write protected (if D_PAGED is not set, this is14.218 + like an a.out NMAGIC file) (the linker sets this by default, but14.219 + clears it for -r or -N). */14.220 +#define WP_TEXT 0x8014.221 +14.222 +/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the14.223 + linker sets this by default, but clears it for -r or -n or -N). */14.224 +#define D_PAGED 0x10014.225 +14.226 +/* BFD is relaxable (this means that bfd_relax_section may be able to14.227 + do something) (sometimes bfd_relax_section can do something even if14.228 + this is not set). */14.229 +#define BFD_IS_RELAXABLE 0x20014.230 +14.231 +/* This may be set before writing out a BFD to request using a14.232 + traditional format. For example, this is used to request that when14.233 + writing out an a.out object the symbols not be hashed to eliminate14.234 + duplicates. */14.235 +#define BFD_TRADITIONAL_FORMAT 0x40014.236 +14.237 +/* This flag indicates that the BFD contents are actually cached in14.238 + memory. If this is set, iostream points to a bfd_in_memory struct. */14.239 +#define BFD_IN_MEMORY 0x80014.240 +14.241 +/* The sections in this BFD specify a memory page. */14.242 +#define HAS_LOAD_PAGE 0x100014.243 +14.244 +/* This BFD has been created by the linker and doesn't correspond14.245 + to any input file. */14.246 +#define BFD_LINKER_CREATED 0x200014.247 +14.248 +/* Symbols and relocation. */14.249 +14.250 +/* A count of carsyms (canonical archive symbols). */14.251 +typedef unsigned long symindex;14.252 +14.253 +/* How to perform a relocation. */14.254 +typedef const struct reloc_howto_struct reloc_howto_type;14.255 +14.256 +#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)14.257 +14.258 +/* General purpose part of a symbol X;14.259 + target specific parts are in libcoff.h, libaout.h, etc. */14.260 +14.261 +#define bfd_get_section(x) ((x)->section)14.262 +#define bfd_get_output_section(x) ((x)->section->output_section)14.263 +#define bfd_set_section(x,y) ((x)->section) = (y)14.264 +#define bfd_asymbol_base(x) ((x)->section->vma)14.265 +#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)14.266 +#define bfd_asymbol_name(x) ((x)->name)14.267 +/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/14.268 +#define bfd_asymbol_bfd(x) ((x)->the_bfd)14.269 +#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)14.270 +14.271 +/* A canonical archive symbol. */14.272 +/* This is a type pun with struct ranlib on purpose! */14.273 +typedef struct carsym14.274 +{14.275 + char *name;14.276 + file_ptr file_offset; /* Look here to find the file. */14.277 +}14.278 +carsym; /* To make these you call a carsymogen. */14.279 +14.280 +/* Used in generating armaps (archive tables of contents).14.281 + Perhaps just a forward definition would do? */14.282 +struct orl /* Output ranlib. */14.283 +{14.284 + char **name; /* Symbol name. */14.285 + union14.286 + {14.287 + file_ptr pos;14.288 + bfd *abfd;14.289 + } u; /* bfd* or file position. */14.290 + int namidx; /* Index into string table. */14.291 +};14.292 +14.293 +/* Linenumber stuff. */14.294 +typedef struct lineno_cache_entry14.295 +{14.296 + unsigned int line_number; /* Linenumber from start of function. */14.297 + union14.298 + {14.299 + struct bfd_symbol *sym; /* Function name. */14.300 + bfd_vma offset; /* Offset into section. */14.301 + } u;14.302 +}14.303 +alent;14.304 +14.305 +/* Object and core file sections. */14.306 +14.307 +#define align_power(addr, align) \14.308 + (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))14.309 +14.310 +typedef struct bfd_section *sec_ptr;14.311 +14.312 +#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)14.313 +#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)14.314 +#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)14.315 +#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)14.316 +#define bfd_section_name(bfd, ptr) ((ptr)->name)14.317 +#define bfd_section_size(bfd, ptr) ((ptr)->size)14.318 +#define bfd_get_section_size(ptr) ((ptr)->size)14.319 +#define bfd_section_vma(bfd, ptr) ((ptr)->vma)14.320 +#define bfd_section_lma(bfd, ptr) ((ptr)->lma)14.321 +#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)14.322 +#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)14.323 +#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)14.324 +14.325 +#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)14.326 +14.327 +#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)14.328 +#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)14.329 +#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)14.330 +/* Find the address one past the end of SEC. */14.331 +#define bfd_get_section_limit(bfd, sec) \14.332 + (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \14.333 + / bfd_octets_per_byte (bfd))14.334 +14.335 +typedef struct stat stat_type;14.336 +14.337 +typedef enum bfd_print_symbol14.338 +{14.339 + bfd_print_symbol_name,14.340 + bfd_print_symbol_more,14.341 + bfd_print_symbol_all14.342 +} bfd_print_symbol_type;14.343 +14.344 +/* Information about a symbol that nm needs. */14.345 +14.346 +typedef struct _symbol_info14.347 +{14.348 + symvalue value;14.349 + char type;14.350 + const char *name; /* Symbol name. */14.351 + unsigned char stab_type; /* Stab type. */14.352 + char stab_other; /* Stab other. */14.353 + short stab_desc; /* Stab desc. */14.354 + const char *stab_name; /* String for stab type. */14.355 +} symbol_info;14.356 +14.357 +/* Get the name of a stabs type code. */14.358 +14.359 +extern const char *bfd_get_stab_name (int);14.360 +14.361 +/* Hash table routines. There is no way to free up a hash table. */14.362 +14.363 +/* An element in the hash table. Most uses will actually use a larger14.364 + structure, and an instance of this will be the first field. */14.365 +14.366 +struct bfd_hash_entry14.367 +{14.368 + /* Next entry for this hash code. */14.369 + struct bfd_hash_entry *next;14.370 + /* String being hashed. */14.371 + const char *string;14.372 + /* Hash code. This is the full hash code, not the index into the14.373 + table. */14.374 + unsigned long hash;14.375 +};14.376 +14.377 +/* A hash table. */14.378 +14.379 +struct bfd_hash_table14.380 +{14.381 + /* The hash array. */14.382 + struct bfd_hash_entry **table;14.383 + /* The number of slots in the hash table. */14.384 + unsigned int size;14.385 + /* A function used to create new elements in the hash table. The14.386 + first entry is itself a pointer to an element. When this14.387 + function is first invoked, this pointer will be NULL. However,14.388 + having the pointer permits a hierarchy of method functions to be14.389 + built each of which calls the function in the superclass. Thus14.390 + each function should be written to allocate a new block of memory14.391 + only if the argument is NULL. */14.392 + struct bfd_hash_entry *(*newfunc)14.393 + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);14.394 + /* An objalloc for this hash table. This is a struct objalloc *,14.395 + but we use void * to avoid requiring the inclusion of objalloc.h. */14.396 + void *memory;14.397 +};14.398 +14.399 +/* Initialize a hash table. */14.400 +extern bfd_boolean bfd_hash_table_init14.401 + (struct bfd_hash_table *,14.402 + struct bfd_hash_entry *(*) (struct bfd_hash_entry *,14.403 + struct bfd_hash_table *,14.404 + const char *));14.405 +14.406 +/* Initialize a hash table specifying a size. */14.407 +extern bfd_boolean bfd_hash_table_init_n14.408 + (struct bfd_hash_table *,14.409 + struct bfd_hash_entry *(*) (struct bfd_hash_entry *,14.410 + struct bfd_hash_table *,14.411 + const char *),14.412 + unsigned int size);14.413 +14.414 +/* Free up a hash table. */14.415 +extern void bfd_hash_table_free14.416 + (struct bfd_hash_table *);14.417 +14.418 +/* Look up a string in a hash table. If CREATE is TRUE, a new entry14.419 + will be created for this string if one does not already exist. The14.420 + COPY argument must be TRUE if this routine should copy the string14.421 + into newly allocated memory when adding an entry. */14.422 +extern struct bfd_hash_entry *bfd_hash_lookup14.423 + (struct bfd_hash_table *, const char *, bfd_boolean create,14.424 + bfd_boolean copy);14.425 +14.426 +/* Replace an entry in a hash table. */14.427 +extern void bfd_hash_replace14.428 + (struct bfd_hash_table *, struct bfd_hash_entry *old,14.429 + struct bfd_hash_entry *nw);14.430 +14.431 +/* Base method for creating a hash table entry. */14.432 +extern struct bfd_hash_entry *bfd_hash_newfunc14.433 + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);14.434 +14.435 +/* Grab some space for a hash table entry. */14.436 +extern void *bfd_hash_allocate14.437 + (struct bfd_hash_table *, unsigned int);14.438 +14.439 +/* Traverse a hash table in a random order, calling a function on each14.440 + element. If the function returns FALSE, the traversal stops. The14.441 + INFO argument is passed to the function. */14.442 +extern void bfd_hash_traverse14.443 + (struct bfd_hash_table *,14.444 + bfd_boolean (*) (struct bfd_hash_entry *, void *),14.445 + void *info);14.446 +14.447 +/* Allows the default size of a hash table to be configured. New hash14.448 + tables allocated using bfd_hash_table_init will be created with14.449 + this size. */14.450 +extern void bfd_hash_set_default_size (bfd_size_type);14.451 +14.452 +/* This structure is used to keep track of stabs in sections14.453 + information while linking. */14.454 +14.455 +struct stab_info14.456 +{14.457 + /* A hash table used to hold stabs strings. */14.458 + struct bfd_strtab_hash *strings;14.459 + /* The header file hash table. */14.460 + struct bfd_hash_table includes;14.461 + /* The first .stabstr section. */14.462 + struct bfd_section *stabstr;14.463 +};14.464 +14.465 +#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table14.466 +14.467 +/* User program access to BFD facilities. */14.468 +14.469 +/* Direct I/O routines, for programs which know more about the object14.470 + file than BFD does. Use higher level routines if possible. */14.471 +14.472 +extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);14.473 +extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);14.474 +extern int bfd_seek (bfd *, file_ptr, int);14.475 +extern file_ptr bfd_tell (bfd *);14.476 +extern int bfd_flush (bfd *);14.477 +extern int bfd_stat (bfd *, struct stat *);14.478 +14.479 +/* Deprecated old routines. */14.480 +#if __GNUC__14.481 +#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \14.482 + (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), \14.483 + bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))14.484 +#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \14.485 + (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), \14.486 + bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))14.487 +#else14.488 +#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \14.489 + (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \14.490 + bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))14.491 +#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \14.492 + (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\14.493 + bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))14.494 +#endif14.495 +extern void warn_deprecated (const char *, const char *, int, const char *);14.496 +14.497 +/* Cast from const char * to char * so that caller can assign to14.498 + a char * without a warning. */14.499 +#define bfd_get_filename(abfd) ((char *) (abfd)->filename)14.500 +#define bfd_get_cacheable(abfd) ((abfd)->cacheable)14.501 +#define bfd_get_format(abfd) ((abfd)->format)14.502 +#define bfd_get_target(abfd) ((abfd)->xvec->name)14.503 +#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)14.504 +#define bfd_family_coff(abfd) \14.505 + (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \14.506 + bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)14.507 +#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)14.508 +#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)14.509 +#define bfd_header_big_endian(abfd) \14.510 + ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)14.511 +#define bfd_header_little_endian(abfd) \14.512 + ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)14.513 +#define bfd_get_file_flags(abfd) ((abfd)->flags)14.514 +#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)14.515 +#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)14.516 +#define bfd_my_archive(abfd) ((abfd)->my_archive)14.517 +#define bfd_has_map(abfd) ((abfd)->has_armap)14.518 +14.519 +#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)14.520 +#define bfd_usrdata(abfd) ((abfd)->usrdata)14.521 +14.522 +#define bfd_get_start_address(abfd) ((abfd)->start_address)14.523 +#define bfd_get_symcount(abfd) ((abfd)->symcount)14.524 +#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)14.525 +#define bfd_count_sections(abfd) ((abfd)->section_count)14.526 +14.527 +#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)14.528 +14.529 +#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)14.530 +14.531 +#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)14.532 +14.533 +extern bfd_boolean bfd_cache_close14.534 + (bfd *abfd);14.535 +/* NB: This declaration should match the autogenerated one in libbfd.h. */14.536 +14.537 +extern bfd_boolean bfd_cache_close_all (void);14.538 +14.539 +extern bfd_boolean bfd_record_phdr14.540 + (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,14.541 + bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);14.542 +14.543 +/* Byte swapping routines. */14.544 +14.545 +bfd_uint64_t bfd_getb64 (const void *);14.546 +bfd_uint64_t bfd_getl64 (const void *);14.547 +bfd_int64_t bfd_getb_signed_64 (const void *);14.548 +bfd_int64_t bfd_getl_signed_64 (const void *);14.549 +bfd_vma bfd_getb32 (const void *);14.550 +bfd_vma bfd_getl32 (const void *);14.551 +bfd_signed_vma bfd_getb_signed_32 (const void *);14.552 +bfd_signed_vma bfd_getl_signed_32 (const void *);14.553 +bfd_vma bfd_getb16 (const void *);14.554 +bfd_vma bfd_getl16 (const void *);14.555 +bfd_signed_vma bfd_getb_signed_16 (const void *);14.556 +bfd_signed_vma bfd_getl_signed_16 (const void *);14.557 +void bfd_putb64 (bfd_uint64_t, void *);14.558 +void bfd_putl64 (bfd_uint64_t, void *);14.559 +void bfd_putb32 (bfd_vma, void *);14.560 +void bfd_putl32 (bfd_vma, void *);14.561 +void bfd_putb16 (bfd_vma, void *);14.562 +void bfd_putl16 (bfd_vma, void *);14.563 +14.564 +/* Byte swapping routines which take size and endiannes as arguments. */14.565 +14.566 +bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);14.567 +void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);14.568 +14.569 +extern bfd_boolean bfd_section_already_linked_table_init (void);14.570 +extern void bfd_section_already_linked_table_free (void);14.571 +14.572 +/* Externally visible ECOFF routines. */14.573 +14.574 +#if defined(__STDC__) || defined(ALMOST_STDC)14.575 +struct ecoff_debug_info;14.576 +struct ecoff_debug_swap;14.577 +struct ecoff_extr;14.578 +struct bfd_symbol;14.579 +struct bfd_link_info;14.580 +struct bfd_link_hash_entry;14.581 +struct bfd_elf_version_tree;14.582 +#endif14.583 +extern bfd_vma bfd_ecoff_get_gp_value14.584 + (bfd * abfd);14.585 +extern bfd_boolean bfd_ecoff_set_gp_value14.586 + (bfd *abfd, bfd_vma gp_value);14.587 +extern bfd_boolean bfd_ecoff_set_regmasks14.588 + (bfd *abfd, unsigned long gprmask, unsigned long fprmask,14.589 + unsigned long *cprmask);14.590 +extern void *bfd_ecoff_debug_init14.591 + (bfd *output_bfd, struct ecoff_debug_info *output_debug,14.592 + const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);14.593 +extern void bfd_ecoff_debug_free14.594 + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,14.595 + const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);14.596 +extern bfd_boolean bfd_ecoff_debug_accumulate14.597 + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,14.598 + const struct ecoff_debug_swap *output_swap, bfd *input_bfd,14.599 + struct ecoff_debug_info *input_debug,14.600 + const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);14.601 +extern bfd_boolean bfd_ecoff_debug_accumulate_other14.602 + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,14.603 + const struct ecoff_debug_swap *output_swap, bfd *input_bfd,14.604 + struct bfd_link_info *);14.605 +extern bfd_boolean bfd_ecoff_debug_externals14.606 + (bfd *abfd, struct ecoff_debug_info *debug,14.607 + const struct ecoff_debug_swap *swap, bfd_boolean relocatable,14.608 + bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),14.609 + void (*set_index) (struct bfd_symbol *, bfd_size_type));14.610 +extern bfd_boolean bfd_ecoff_debug_one_external14.611 + (bfd *abfd, struct ecoff_debug_info *debug,14.612 + const struct ecoff_debug_swap *swap, const char *name,14.613 + struct ecoff_extr *esym);14.614 +extern bfd_size_type bfd_ecoff_debug_size14.615 + (bfd *abfd, struct ecoff_debug_info *debug,14.616 + const struct ecoff_debug_swap *swap);14.617 +extern bfd_boolean bfd_ecoff_write_debug14.618 + (bfd *abfd, struct ecoff_debug_info *debug,14.619 + const struct ecoff_debug_swap *swap, file_ptr where);14.620 +extern bfd_boolean bfd_ecoff_write_accumulated_debug14.621 + (void *handle, bfd *abfd, struct ecoff_debug_info *debug,14.622 + const struct ecoff_debug_swap *swap,14.623 + struct bfd_link_info *info, file_ptr where);14.624 +14.625 +/* Externally visible ELF routines. */14.626 +14.627 +struct bfd_link_needed_list14.628 +{14.629 + struct bfd_link_needed_list *next;14.630 + bfd *by;14.631 + const char *name;14.632 +};14.633 +14.634 +enum dynamic_lib_link_class {14.635 + DYN_NORMAL = 0,14.636 + DYN_AS_NEEDED = 1,14.637 + DYN_DT_NEEDED = 2,14.638 + DYN_NO_ADD_NEEDED = 4,14.639 + DYN_NO_NEEDED = 814.640 +};14.641 +14.642 +extern bfd_boolean bfd_elf_record_link_assignment14.643 + (bfd *, struct bfd_link_info *, const char *, bfd_boolean);14.644 +extern struct bfd_link_needed_list *bfd_elf_get_needed_list14.645 + (bfd *, struct bfd_link_info *);14.646 +extern bfd_boolean bfd_elf_get_bfd_needed_list14.647 + (bfd *, struct bfd_link_needed_list **);14.648 +extern bfd_boolean bfd_elf_size_dynamic_sections14.649 + (bfd *, const char *, const char *, const char *, const char * const *,14.650 + struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *);14.651 +extern void bfd_elf_set_dt_needed_name14.652 + (bfd *, const char *);14.653 +extern const char *bfd_elf_get_dt_soname14.654 + (bfd *);14.655 +extern void bfd_elf_set_dyn_lib_class14.656 + (bfd *, int);14.657 +extern int bfd_elf_get_dyn_lib_class14.658 + (bfd *);14.659 +extern struct bfd_link_needed_list *bfd_elf_get_runpath_list14.660 + (bfd *, struct bfd_link_info *);14.661 +extern bfd_boolean bfd_elf_discard_info14.662 + (bfd *, struct bfd_link_info *);14.663 +14.664 +/* Return an upper bound on the number of bytes required to store a14.665 + copy of ABFD's program header table entries. Return -1 if an error14.666 + occurs; bfd_get_error will return an appropriate code. */14.667 +extern long bfd_get_elf_phdr_upper_bound14.668 + (bfd *abfd);14.669 +14.670 +/* Copy ABFD's program header table entries to *PHDRS. The entries14.671 + will be stored as an array of Elf_Internal_Phdr structures, as14.672 + defined in include/elf/internal.h. To find out how large the14.673 + buffer needs to be, call bfd_get_elf_phdr_upper_bound.14.674 +14.675 + Return the number of program header table entries read, or -1 if an14.676 + error occurs; bfd_get_error will return an appropriate code. */14.677 +extern int bfd_get_elf_phdrs14.678 + (bfd *abfd, void *phdrs);14.679 +14.680 +/* Create a new BFD as if by bfd_openr. Rather than opening a file,14.681 + reconstruct an ELF file by reading the segments out of remote memory14.682 + based on the ELF file header at EHDR_VMA and the ELF program headers it14.683 + points to. If not null, *LOADBASEP is filled in with the difference14.684 + between the VMAs from which the segments were read, and the VMAs the14.685 + file headers (and hence BFD's idea of each section's VMA) put them at.14.686 +14.687 + The function TARGET_READ_MEMORY is called to copy LEN bytes from the14.688 + remote memory at target address VMA into the local buffer at MYADDR; it14.689 + should return zero on success or an `errno' code on failure. TEMPL must14.690 + be a BFD for an ELF target with the word size and byte order found in14.691 + the remote memory. */14.692 +extern bfd *bfd_elf_bfd_from_remote_memory14.693 + (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,14.694 + int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));14.695 +14.696 +/* Return the arch_size field of an elf bfd, or -1 if not elf. */14.697 +extern int bfd_get_arch_size14.698 + (bfd *);14.699 +14.700 +/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */14.701 +extern int bfd_get_sign_extend_vma14.702 + (bfd *);14.703 +14.704 +extern struct bfd_section *_bfd_elf_tls_setup14.705 + (bfd *, struct bfd_link_info *);14.706 +14.707 +extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs14.708 + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);14.709 +14.710 +/* SunOS shared library support routines for the linker. */14.711 +14.712 +extern struct bfd_link_needed_list *bfd_sunos_get_needed_list14.713 + (bfd *, struct bfd_link_info *);14.714 +extern bfd_boolean bfd_sunos_record_link_assignment14.715 + (bfd *, struct bfd_link_info *, const char *);14.716 +extern bfd_boolean bfd_sunos_size_dynamic_sections14.717 + (bfd *, struct bfd_link_info *, struct bfd_section **, struct bfd_section **, struct bfd_section **);14.718 +14.719 +/* Linux shared library support routines for the linker. */14.720 +14.721 +extern bfd_boolean bfd_i386linux_size_dynamic_sections14.722 + (bfd *, struct bfd_link_info *);14.723 +extern bfd_boolean bfd_m68klinux_size_dynamic_sections14.724 + (bfd *, struct bfd_link_info *);14.725 +extern bfd_boolean bfd_sparclinux_size_dynamic_sections14.726 + (bfd *, struct bfd_link_info *);14.727 +14.728 +/* mmap hacks */14.729 +14.730 +struct _bfd_window_internal;14.731 +typedef struct _bfd_window_internal bfd_window_internal;14.732 +14.733 +typedef struct _bfd_window14.734 +{14.735 + /* What the user asked for. */14.736 + void *data;14.737 + bfd_size_type size;14.738 + /* The actual window used by BFD. Small user-requested read-only14.739 + regions sharing a page may share a single window into the object14.740 + file. Read-write versions shouldn't until I've fixed things to14.741 + keep track of which portions have been claimed by the14.742 + application; don't want to give the same region back when the14.743 + application wants two writable copies! */14.744 + struct _bfd_window_internal *i;14.745 +}14.746 +bfd_window;14.747 +14.748 +extern void bfd_init_window14.749 + (bfd_window *);14.750 +extern void bfd_free_window14.751 + (bfd_window *);14.752 +extern bfd_boolean bfd_get_file_window14.753 + (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);14.754 +14.755 +/* XCOFF support routines for the linker. */14.756 +14.757 +extern bfd_boolean bfd_xcoff_link_record_set14.758 + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);14.759 +extern bfd_boolean bfd_xcoff_import_symbol14.760 + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,14.761 + const char *, const char *, const char *, unsigned int);14.762 +extern bfd_boolean bfd_xcoff_export_symbol14.763 + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);14.764 +extern bfd_boolean bfd_xcoff_link_count_reloc14.765 + (bfd *, struct bfd_link_info *, const char *);14.766 +extern bfd_boolean bfd_xcoff_record_link_assignment14.767 + (bfd *, struct bfd_link_info *, const char *);14.768 +extern bfd_boolean bfd_xcoff_size_dynamic_sections14.769 + (bfd *, struct bfd_link_info *, const char *, const char *,14.770 + unsigned long, unsigned long, unsigned long, bfd_boolean,14.771 + int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean);14.772 +extern bfd_boolean bfd_xcoff_link_generate_rtinit14.773 + (bfd *, const char *, const char *, bfd_boolean);14.774 +14.775 +/* XCOFF support routines for ar. */14.776 +extern bfd_boolean bfd_xcoff_ar_archive_set_magic14.777 + (bfd *, char *);14.778 +14.779 +/* Externally visible COFF routines. */14.780 +14.781 +#if defined(__STDC__) || defined(ALMOST_STDC)14.782 +struct internal_syment;14.783 +union internal_auxent;14.784 +#endif14.785 +14.786 +extern bfd_boolean bfd_coff_get_syment14.787 + (bfd *, struct bfd_symbol *, struct internal_syment *);14.788 +14.789 +extern bfd_boolean bfd_coff_get_auxent14.790 + (bfd *, struct bfd_symbol *, int, union internal_auxent *);14.791 +14.792 +extern bfd_boolean bfd_coff_set_symbol_class14.793 + (bfd *, struct bfd_symbol *, unsigned int);14.794 +14.795 +extern bfd_boolean bfd_m68k_coff_create_embedded_relocs14.796 + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);14.797 +14.798 +/* ARM Interworking support. Called from linker. */14.799 +extern bfd_boolean bfd_arm_allocate_interworking_sections14.800 + (struct bfd_link_info *);14.801 +14.802 +extern bfd_boolean bfd_arm_process_before_allocation14.803 + (bfd *, struct bfd_link_info *, int);14.804 +14.805 +extern bfd_boolean bfd_arm_get_bfd_for_interworking14.806 + (bfd *, struct bfd_link_info *);14.807 +14.808 +/* PE ARM Interworking support. Called from linker. */14.809 +extern bfd_boolean bfd_arm_pe_allocate_interworking_sections14.810 + (struct bfd_link_info *);14.811 +14.812 +extern bfd_boolean bfd_arm_pe_process_before_allocation14.813 + (bfd *, struct bfd_link_info *, int);14.814 +14.815 +extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking14.816 + (bfd *, struct bfd_link_info *);14.817 +14.818 +/* ELF ARM Interworking support. Called from linker. */14.819 +extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections14.820 + (struct bfd_link_info *);14.821 +14.822 +extern bfd_boolean bfd_elf32_arm_process_before_allocation14.823 + (bfd *, struct bfd_link_info *, int);14.824 +14.825 +void bfd_elf32_arm_set_target_relocs14.826 + (struct bfd_link_info *, int, char *, int);14.827 +14.828 +extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking14.829 + (bfd *, struct bfd_link_info *);14.830 +14.831 +extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd14.832 + (bfd *, struct bfd_link_info *);14.833 +14.834 +/* ARM Note section processing. */14.835 +extern bfd_boolean bfd_arm_merge_machines14.836 + (bfd *, bfd *);14.837 +14.838 +extern bfd_boolean bfd_arm_update_notes14.839 + (bfd *, const char *);14.840 +14.841 +extern unsigned int bfd_arm_get_mach_from_notes14.842 + (bfd *, const char *);14.843 +14.844 +/* TI COFF load page support. */14.845 +extern void bfd_ticoff_set_section_load_page14.846 + (struct bfd_section *, int);14.847 +14.848 +extern int bfd_ticoff_get_section_load_page14.849 + (struct bfd_section *);14.850 +14.851 +/* H8/300 functions. */14.852 +extern bfd_vma bfd_h8300_pad_address14.853 + (bfd *, bfd_vma);14.854 +14.855 +/* IA64 Itanium code generation. Called from linker. */14.856 +extern void bfd_elf32_ia64_after_parse14.857 + (int);14.858 +14.859 +extern void bfd_elf64_ia64_after_parse14.860 + (int);14.861 +14.862 +/* This structure is used for a comdat section, as in PE. A comdat14.863 + section is associated with a particular symbol. When the linker14.864 + sees a comdat section, it keeps only one of the sections with a14.865 + given name and associated with a given symbol. */14.866 +14.867 +struct coff_comdat_info14.868 +{14.869 + /* The name of the symbol associated with a comdat section. */14.870 + const char *name;14.871 +14.872 + /* The local symbol table index of the symbol associated with a14.873 + comdat section. This is only meaningful to the object file format14.874 + specific code; it is not an index into the list returned by14.875 + bfd_canonicalize_symtab. */14.876 + long symbol;14.877 +};14.878 +14.879 +extern struct coff_comdat_info *bfd_coff_get_comdat_section14.880 + (bfd *, struct bfd_section *);14.881 +14.882 +/* Extracted from init.c. */14.883 +void bfd_init (void);14.884 +14.885 +/* Extracted from opncls.c. */14.886 +bfd *bfd_openr (const char *filename, const char *target);14.887 +14.888 +bfd *bfd_fdopenr (const char *filename, const char *target, int fd);14.889 +14.890 +bfd *bfd_openstreamr (const char *, const char *, void *);14.891 +14.892 +bfd *bfd_openr_iovec (const char *filename, const char *target,14.893 + void *(*open) (struct bfd *nbfd,14.894 + void *open_closure),14.895 + void *open_closure,14.896 + file_ptr (*pread) (struct bfd *nbfd,14.897 + void *stream,14.898 + void *buf,14.899 + file_ptr nbytes,14.900 + file_ptr offset),14.901 + int (*close) (struct bfd *nbfd,14.902 + void *stream));14.903 +14.904 +bfd *bfd_openw (const char *filename, const char *target);14.905 +14.906 +bfd_boolean bfd_close (bfd *abfd);14.907 +14.908 +bfd_boolean bfd_close_all_done (bfd *);14.909 +14.910 +bfd *bfd_create (const char *filename, bfd *templ);14.911 +14.912 +bfd_boolean bfd_make_writable (bfd *abfd);14.913 +14.914 +bfd_boolean bfd_make_readable (bfd *abfd);14.915 +14.916 +unsigned long bfd_calc_gnu_debuglink_crc3214.917 + (unsigned long crc, const unsigned char *buf, bfd_size_type len);14.918 +14.919 +char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);14.920 +14.921 +struct bfd_section *bfd_create_gnu_debuglink_section14.922 + (bfd *abfd, const char *filename);14.923 +14.924 +bfd_boolean bfd_fill_in_gnu_debuglink_section14.925 + (bfd *abfd, struct bfd_section *sect, const char *filename);14.926 +14.927 +/* Extracted from libbfd.c. */14.928 +14.929 +/* Byte swapping macros for user section data. */14.930 +14.931 +#define bfd_put_8(abfd, val, ptr) \14.932 + ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))14.933 +#define bfd_put_signed_8 \14.934 + bfd_put_814.935 +#define bfd_get_8(abfd, ptr) \14.936 + (*(unsigned char *) (ptr) & 0xff)14.937 +#define bfd_get_signed_8(abfd, ptr) \14.938 + (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)14.939 +14.940 +#define bfd_put_16(abfd, val, ptr) \14.941 + BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))14.942 +#define bfd_put_signed_16 \14.943 + bfd_put_1614.944 +#define bfd_get_16(abfd, ptr) \14.945 + BFD_SEND (abfd, bfd_getx16, (ptr))14.946 +#define bfd_get_signed_16(abfd, ptr) \14.947 + BFD_SEND (abfd, bfd_getx_signed_16, (ptr))14.948 +14.949 +#define bfd_put_32(abfd, val, ptr) \14.950 + BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))14.951 +#define bfd_put_signed_32 \14.952 + bfd_put_3214.953 +#define bfd_get_32(abfd, ptr) \14.954 + BFD_SEND (abfd, bfd_getx32, (ptr))14.955 +#define bfd_get_signed_32(abfd, ptr) \14.956 + BFD_SEND (abfd, bfd_getx_signed_32, (ptr))14.957 +14.958 +#define bfd_put_64(abfd, val, ptr) \14.959 + BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))14.960 +#define bfd_put_signed_64 \14.961 + bfd_put_6414.962 +#define bfd_get_64(abfd, ptr) \14.963 + BFD_SEND (abfd, bfd_getx64, (ptr))14.964 +#define bfd_get_signed_64(abfd, ptr) \14.965 + BFD_SEND (abfd, bfd_getx_signed_64, (ptr))14.966 +14.967 +#define bfd_get(bits, abfd, ptr) \14.968 + ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \14.969 + : (bits) == 16 ? bfd_get_16 (abfd, ptr) \14.970 + : (bits) == 32 ? bfd_get_32 (abfd, ptr) \14.971 + : (bits) == 64 ? bfd_get_64 (abfd, ptr) \14.972 + : (abort (), (bfd_vma) - 1))14.973 +14.974 +#define bfd_put(bits, abfd, val, ptr) \14.975 + ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \14.976 + : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \14.977 + : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \14.978 + : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \14.979 + : (abort (), (void) 0))14.980 +14.981 +14.982 +/* Byte swapping macros for file header data. */14.983 +14.984 +#define bfd_h_put_8(abfd, val, ptr) \14.985 + bfd_put_8 (abfd, val, ptr)14.986 +#define bfd_h_put_signed_8(abfd, val, ptr) \14.987 + bfd_put_8 (abfd, val, ptr)14.988 +#define bfd_h_get_8(abfd, ptr) \14.989 + bfd_get_8 (abfd, ptr)14.990 +#define bfd_h_get_signed_8(abfd, ptr) \14.991 + bfd_get_signed_8 (abfd, ptr)14.992 +14.993 +#define bfd_h_put_16(abfd, val, ptr) \14.994 + BFD_SEND (abfd, bfd_h_putx16, (val, ptr))14.995 +#define bfd_h_put_signed_16 \14.996 + bfd_h_put_1614.997 +#define bfd_h_get_16(abfd, ptr) \14.998 + BFD_SEND (abfd, bfd_h_getx16, (ptr))14.999 +#define bfd_h_get_signed_16(abfd, ptr) \14.1000 + BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))14.1001 +14.1002 +#define bfd_h_put_32(abfd, val, ptr) \14.1003 + BFD_SEND (abfd, bfd_h_putx32, (val, ptr))14.1004 +#define bfd_h_put_signed_32 \14.1005 + bfd_h_put_3214.1006 +#define bfd_h_get_32(abfd, ptr) \14.1007 + BFD_SEND (abfd, bfd_h_getx32, (ptr))14.1008 +#define bfd_h_get_signed_32(abfd, ptr) \14.1009 + BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))14.1010 +14.1011 +#define bfd_h_put_64(abfd, val, ptr) \14.1012 + BFD_SEND (abfd, bfd_h_putx64, (val, ptr))14.1013 +#define bfd_h_put_signed_64 \14.1014 + bfd_h_put_6414.1015 +#define bfd_h_get_64(abfd, ptr) \14.1016 + BFD_SEND (abfd, bfd_h_getx64, (ptr))14.1017 +#define bfd_h_get_signed_64(abfd, ptr) \14.1018 + BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))14.1019 +14.1020 +/* Aliases for the above, which should eventually go away. */14.1021 +14.1022 +#define H_PUT_64 bfd_h_put_6414.1023 +#define H_PUT_32 bfd_h_put_3214.1024 +#define H_PUT_16 bfd_h_put_1614.1025 +#define H_PUT_8 bfd_h_put_814.1026 +#define H_PUT_S64 bfd_h_put_signed_6414.1027 +#define H_PUT_S32 bfd_h_put_signed_3214.1028 +#define H_PUT_S16 bfd_h_put_signed_1614.1029 +#define H_PUT_S8 bfd_h_put_signed_814.1030 +#define H_GET_64 bfd_h_get_6414.1031 +#define H_GET_32 bfd_h_get_3214.1032 +#define H_GET_16 bfd_h_get_1614.1033 +#define H_GET_8 bfd_h_get_814.1034 +#define H_GET_S64 bfd_h_get_signed_6414.1035 +#define H_GET_S32 bfd_h_get_signed_3214.1036 +#define H_GET_S16 bfd_h_get_signed_1614.1037 +#define H_GET_S8 bfd_h_get_signed_814.1038 +14.1039 +14.1040 +/* Extracted from bfdio.c. */14.1041 +long bfd_get_mtime (bfd *abfd);14.1042 +14.1043 +long bfd_get_size (bfd *abfd);14.1044 +14.1045 +/* Extracted from bfdwin.c. */14.1046 +/* Extracted from section.c. */14.1047 +typedef struct bfd_section14.1048 +{14.1049 + /* The name of the section; the name isn't a copy, the pointer is14.1050 + the same as that passed to bfd_make_section. */14.1051 + const char *name;14.1052 +14.1053 + /* A unique sequence number. */14.1054 + int id;14.1055 +14.1056 + /* Which section in the bfd; 0..n-1 as sections are created in a bfd. */14.1057 + int index;14.1058 +14.1059 + /* The next section in the list belonging to the BFD, or NULL. */14.1060 + struct bfd_section *next;14.1061 +14.1062 + /* The field flags contains attributes of the section. Some14.1063 + flags are read in from the object file, and some are14.1064 + synthesized from other information. */14.1065 + flagword flags;14.1066 +14.1067 +#define SEC_NO_FLAGS 0x00014.1068 +14.1069 + /* Tells the OS to allocate space for this section when loading.14.1070 + This is clear for a section containing debug information only. */14.1071 +#define SEC_ALLOC 0x00114.1072 +14.1073 + /* Tells the OS to load the section from the file when loading.14.1074 + This is clear for a .bss section. */14.1075 +#define SEC_LOAD 0x00214.1076 +14.1077 + /* The section contains data still to be relocated, so there is14.1078 + some relocation information too. */14.1079 +#define SEC_RELOC 0x00414.1080 +14.1081 + /* A signal to the OS that the section contains read only data. */14.1082 +#define SEC_READONLY 0x00814.1083 +14.1084 + /* The section contains code only. */14.1085 +#define SEC_CODE 0x01014.1086 +14.1087 + /* The section contains data only. */14.1088 +#define SEC_DATA 0x02014.1089 +14.1090 + /* The section will reside in ROM. */14.1091 +#define SEC_ROM 0x04014.1092 +14.1093 + /* The section contains constructor information. This section14.1094 + type is used by the linker to create lists of constructors and14.1095 + destructors used by <<g++>>. When a back end sees a symbol14.1096 + which should be used in a constructor list, it creates a new14.1097 + section for the type of name (e.g., <<__CTOR_LIST__>>), attaches14.1098 + the symbol to it, and builds a relocation. To build the lists14.1099 + of constructors, all the linker has to do is catenate all the14.1100 + sections called <<__CTOR_LIST__>> and relocate the data14.1101 + contained within - exactly the operations it would peform on14.1102 + standard data. */14.1103 +#define SEC_CONSTRUCTOR 0x08014.1104 +14.1105 + /* The section has contents - a data section could be14.1106 + <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be14.1107 + <<SEC_HAS_CONTENTS>> */14.1108 +#define SEC_HAS_CONTENTS 0x10014.1109 +14.1110 + /* An instruction to the linker to not output the section14.1111 + even if it has information which would normally be written. */14.1112 +#define SEC_NEVER_LOAD 0x20014.1113 +14.1114 + /* The section contains thread local data. */14.1115 +#define SEC_THREAD_LOCAL 0x40014.1116 +14.1117 + /* The section has GOT references. This flag is only for the14.1118 + linker, and is currently only used by the elf32-hppa back end.14.1119 + It will be set if global offset table references were detected14.1120 + in this section, which indicate to the linker that the section14.1121 + contains PIC code, and must be handled specially when doing a14.1122 + static link. */14.1123 +#define SEC_HAS_GOT_REF 0x80014.1124 +14.1125 + /* The section contains common symbols (symbols may be defined14.1126 + multiple times, the value of a symbol is the amount of14.1127 + space it requires, and the largest symbol value is the one14.1128 + used). Most targets have exactly one of these (which we14.1129 + translate to bfd_com_section_ptr), but ECOFF has two. */14.1130 +#define SEC_IS_COMMON 0x100014.1131 +14.1132 + /* The section contains only debugging information. For14.1133 + example, this is set for ELF .debug and .stab sections.14.1134 + strip tests this flag to see if a section can be14.1135 + discarded. */14.1136 +#define SEC_DEBUGGING 0x200014.1137 +14.1138 + /* The contents of this section are held in memory pointed to14.1139 + by the contents field. This is checked by bfd_get_section_contents,14.1140 + and the data is retrieved from memory if appropriate. */14.1141 +#define SEC_IN_MEMORY 0x400014.1142 +14.1143 + /* The contents of this section are to be excluded by the14.1144 + linker for executable and shared objects unless those14.1145 + objects are to be further relocated. */14.1146 +#define SEC_EXCLUDE 0x800014.1147 +14.1148 + /* The contents of this section are to be sorted based on the sum of14.1149 + the symbol and addend values specified by the associated relocation14.1150 + entries. Entries without associated relocation entries will be14.1151 + appended to the end of the section in an unspecified order. */14.1152 +#define SEC_SORT_ENTRIES 0x1000014.1153 +14.1154 + /* When linking, duplicate sections of the same name should be14.1155 + discarded, rather than being combined into a single section as14.1156 + is usually done. This is similar to how common symbols are14.1157 + handled. See SEC_LINK_DUPLICATES below. */14.1158 +#define SEC_LINK_ONCE 0x2000014.1159 +14.1160 + /* If SEC_LINK_ONCE is set, this bitfield describes how the linker14.1161 + should handle duplicate sections. */14.1162 +#define SEC_LINK_DUPLICATES 0x4000014.1163 +14.1164 + /* This value for SEC_LINK_DUPLICATES means that duplicate14.1165 + sections with the same name should simply be discarded. */14.1166 +#define SEC_LINK_DUPLICATES_DISCARD 0x014.1167 +14.1168 + /* This value for SEC_LINK_DUPLICATES means that the linker14.1169 + should warn if there are any duplicate sections, although14.1170 + it should still only link one copy. */14.1171 +#define SEC_LINK_DUPLICATES_ONE_ONLY 0x8000014.1172 +14.1173 + /* This value for SEC_LINK_DUPLICATES means that the linker14.1174 + should warn if any duplicate sections are a different size. */14.1175 +#define SEC_LINK_DUPLICATES_SAME_SIZE 0x10000014.1176 +14.1177 + /* This value for SEC_LINK_DUPLICATES means that the linker14.1178 + should warn if any duplicate sections contain different14.1179 + contents. */14.1180 +#define SEC_LINK_DUPLICATES_SAME_CONTENTS \14.1181 + (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)14.1182 +14.1183 + /* This section was created by the linker as part of dynamic14.1184 + relocation or other arcane processing. It is skipped when14.1185 + going through the first-pass output, trusting that someone14.1186 + else up the line will take care of it later. */14.1187 +#define SEC_LINKER_CREATED 0x20000014.1188 +14.1189 + /* This section should not be subject to garbage collection. */14.1190 +#define SEC_KEEP 0x40000014.1191 +14.1192 + /* This section contains "short" data, and should be placed14.1193 + "near" the GP. */14.1194 +#define SEC_SMALL_DATA 0x80000014.1195 +14.1196 + /* Attempt to merge identical entities in the section.14.1197 + Entity size is given in the entsize field. */14.1198 +#define SEC_MERGE 0x100000014.1199 +14.1200 + /* If given with SEC_MERGE, entities to merge are zero terminated14.1201 + strings where entsize specifies character size instead of fixed14.1202 + size entries. */14.1203 +#define SEC_STRINGS 0x200000014.1204 +14.1205 + /* This section contains data about section groups. */14.1206 +#define SEC_GROUP 0x400000014.1207 +14.1208 + /* The section is a COFF shared library section. This flag is14.1209 + only for the linker. If this type of section appears in14.1210 + the input file, the linker must copy it to the output file14.1211 + without changing the vma or size. FIXME: Although this14.1212 + was originally intended to be general, it really is COFF14.1213 + specific (and the flag was renamed to indicate this). It14.1214 + might be cleaner to have some more general mechanism to14.1215 + allow the back end to control what the linker does with14.1216 + sections. */14.1217 +#define SEC_COFF_SHARED_LIBRARY 0x1000000014.1218 +14.1219 + /* This section contains data which may be shared with other14.1220 + executables or shared objects. This is for COFF only. */14.1221 +#define SEC_COFF_SHARED 0x2000000014.1222 +14.1223 + /* When a section with this flag is being linked, then if the size of14.1224 + the input section is less than a page, it should not cross a page14.1225 + boundary. If the size of the input section is one page or more,14.1226 + it should be aligned on a page boundary. This is for TI14.1227 + TMS320C54X only. */14.1228 +#define SEC_TIC54X_BLOCK 0x4000000014.1229 +14.1230 + /* Conditionally link this section; do not link if there are no14.1231 + references found to any symbol in the section. This is for TI14.1232 + TMS320C54X only. */14.1233 +#define SEC_TIC54X_CLINK 0x8000000014.1234 +14.1235 + /* End of section flags. */14.1236 +14.1237 + /* Some internal packed boolean fields. */14.1238 +14.1239 + /* See the vma field. */14.1240 + unsigned int user_set_vma : 1;14.1241 +14.1242 + /* A mark flag used by some of the linker backends. */14.1243 + unsigned int linker_mark : 1;14.1244 +14.1245 + /* Another mark flag used by some of the linker backends. Set for14.1246 + output sections that have an input section. */14.1247 + unsigned int linker_has_input : 1;14.1248 +14.1249 + /* A mark flag used by some linker backends for garbage collection. */14.1250 + unsigned int gc_mark : 1;14.1251 +14.1252 + /* The following flags are used by the ELF linker. */14.1253 +14.1254 + /* Mark sections which have been allocated to segments. */14.1255 + unsigned int segment_mark : 1;14.1256 +14.1257 + /* Type of sec_info information. */14.1258 + unsigned int sec_info_type:3;14.1259 +#define ELF_INFO_TYPE_NONE 014.1260 +#define ELF_INFO_TYPE_STABS 114.1261 +#define ELF_INFO_TYPE_MERGE 214.1262 +#define ELF_INFO_TYPE_EH_FRAME 314.1263 +#define ELF_INFO_TYPE_JUST_SYMS 414.1264 +14.1265 + /* Nonzero if this section uses RELA relocations, rather than REL. */14.1266 + unsigned int use_rela_p:1;14.1267 +14.1268 + /* Bits used by various backends. The generic code doesn't touch14.1269 + these fields. */14.1270 +14.1271 + /* Nonzero if this section has TLS related relocations. */14.1272 + unsigned int has_tls_reloc:1;14.1273 +14.1274 + /* Nonzero if this section has a gp reloc. */14.1275 + unsigned int has_gp_reloc:1;14.1276 +14.1277 + /* Nonzero if this section needs the relax finalize pass. */14.1278 + unsigned int need_finalize_relax:1;14.1279 +14.1280 + /* Whether relocations have been processed. */14.1281 + unsigned int reloc_done : 1;14.1282 +14.1283 + /* End of internal packed boolean fields. */14.1284 +14.1285 + /* The virtual memory address of the section - where it will be14.1286 + at run time. The symbols are relocated against this. The14.1287 + user_set_vma flag is maintained by bfd; if it's not set, the14.1288 + backend can assign addresses (for example, in <<a.out>>, where14.1289 + the default address for <<.data>> is dependent on the specific14.1290 + target and various flags). */14.1291 + bfd_vma vma;14.1292 +14.1293 + /* The load address of the section - where it would be in a14.1294 + rom image; really only used for writing section header14.1295 + information. */14.1296 + bfd_vma lma;14.1297 +14.1298 + /* The size of the section in octets, as it will be output.14.1299 + Contains a value even if the section has no contents (e.g., the14.1300 + size of <<.bss>>). */14.1301 + bfd_size_type size;14.1302 +14.1303 + /* For input sections, the original size on disk of the section, in14.1304 + octets. This field is used by the linker relaxation code. It is14.1305 + currently only set for sections where the linker relaxation scheme14.1306 + doesn't cache altered section and reloc contents (stabs, eh_frame,14.1307 + SEC_MERGE, some coff relaxing targets), and thus the original size14.1308 + needs to be kept to read the section multiple times.14.1309 + For output sections, rawsize holds the section size calculated on14.1310 + a previous linker relaxation pass. */14.1311 + bfd_size_type rawsize;14.1312 +14.1313 + /* If this section is going to be output, then this value is the14.1314 + offset in *bytes* into the output section of the first byte in the14.1315 + input section (byte ==> smallest addressable unit on the14.1316 + target). In most cases, if this was going to start at the14.1317 + 100th octet (8-bit quantity) in the output section, this value14.1318 + would be 100. However, if the target byte size is 16 bits14.1319 + (bfd_octets_per_byte is "2"), this value would be 50. */14.1320 + bfd_vma output_offset;14.1321 +14.1322 + /* The output section through which to map on output. */14.1323 + struct bfd_section *output_section;14.1324 +14.1325 + /* The alignment requirement of the section, as an exponent of 2 -14.1326 + e.g., 3 aligns to 2^3 (or 8). */14.1327 + unsigned int alignment_power;14.1328 +14.1329 + /* If an input section, a pointer to a vector of relocation14.1330 + records for the data in this section. */14.1331 + struct reloc_cache_entry *relocation;14.1332 +14.1333 + /* If an output section, a pointer to a vector of pointers to14.1334 + relocation records for the data in this section. */14.1335 + struct reloc_cache_entry **orelocation;14.1336 +14.1337 + /* The number of relocation records in one of the above. */14.1338 + unsigned reloc_count;14.1339 +14.1340 + /* Information below is back end specific - and not always used14.1341 + or updated. */14.1342 +14.1343 + /* File position of section data. */14.1344 + file_ptr filepos;14.1345 +14.1346 + /* File position of relocation info. */14.1347 + file_ptr rel_filepos;14.1348 +14.1349 + /* File position of line data. */14.1350 + file_ptr line_filepos;14.1351 +14.1352 + /* Pointer to data for applications. */14.1353 + void *userdata;14.1354 +14.1355 + /* If the SEC_IN_MEMORY flag is set, this points to the actual14.1356 + contents. */14.1357 + unsigned char *contents;14.1358 +14.1359 + /* Attached line number information. */14.1360 + alent *lineno;14.1361 +14.1362 + /* Number of line number records. */14.1363 + unsigned int lineno_count;14.1364 +14.1365 + /* Entity size for merging purposes. */14.1366 + unsigned int entsize;14.1367 +14.1368 + /* Points to the kept section if this section is a link-once section,14.1369 + and is discarded. */14.1370 + struct bfd_section *kept_section;14.1371 +14.1372 + /* When a section is being output, this value changes as more14.1373 + linenumbers are written out. */14.1374 + file_ptr moving_line_filepos;14.1375 +14.1376 + /* What the section number is in the target world. */14.1377 + int target_index;14.1378 +14.1379 + void *used_by_bfd;14.1380 +14.1381 + /* If this is a constructor section then here is a list of the14.1382 + relocations created to relocate items within it. */14.1383 + struct relent_chain *constructor_chain;14.1384 +14.1385 + /* The BFD which owns the section. */14.1386 + bfd *owner;14.1387 +14.1388 + /* A symbol which points at this section only. */14.1389 + struct bfd_symbol *symbol;14.1390 + struct bfd_symbol **symbol_ptr_ptr;14.1391 +14.1392 + struct bfd_link_order *link_order_head;14.1393 + struct bfd_link_order *link_order_tail;14.1394 +} asection;14.1395 +14.1396 +/* These sections are global, and are managed by BFD. The application14.1397 + and target back end are not permitted to change the values in14.1398 + these sections. New code should use the section_ptr macros rather14.1399 + than referring directly to the const sections. The const sections14.1400 + may eventually vanish. */14.1401 +#define BFD_ABS_SECTION_NAME "*ABS*"14.1402 +#define BFD_UND_SECTION_NAME "*UND*"14.1403 +#define BFD_COM_SECTION_NAME "*COM*"14.1404 +#define BFD_IND_SECTION_NAME "*IND*"14.1405 +14.1406 +/* The absolute section. */14.1407 +extern asection bfd_abs_section;14.1408 +#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)14.1409 +#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)14.1410 +/* Pointer to the undefined section. */14.1411 +extern asection bfd_und_section;14.1412 +#define bfd_und_section_ptr ((asection *) &bfd_und_section)14.1413 +#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)14.1414 +/* Pointer to the common section. */14.1415 +extern asection bfd_com_section;14.1416 +#define bfd_com_section_ptr ((asection *) &bfd_com_section)14.1417 +/* Pointer to the indirect section. */14.1418 +extern asection bfd_ind_section;14.1419 +#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)14.1420 +#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)14.1421 +14.1422 +#define bfd_is_const_section(SEC) \14.1423 + ( ((SEC) == bfd_abs_section_ptr) \14.1424 + || ((SEC) == bfd_und_section_ptr) \14.1425 + || ((SEC) == bfd_com_section_ptr) \14.1426 + || ((SEC) == bfd_ind_section_ptr))14.1427 +14.1428 +extern const struct bfd_symbol * const bfd_abs_symbol;14.1429 +extern const struct bfd_symbol * const bfd_com_symbol;14.1430 +extern const struct bfd_symbol * const bfd_und_symbol;14.1431 +extern const struct bfd_symbol * const bfd_ind_symbol;14.1432 +14.1433 +/* Macros to handle insertion and deletion of a bfd's sections. These14.1434 + only handle the list pointers, ie. do not adjust section_count,14.1435 + target_index etc. */14.1436 +#define bfd_section_list_remove(ABFD, PS) \14.1437 + do \14.1438 + { \14.1439 + asection **_ps = PS; \14.1440 + asection *_s = *_ps; \14.1441 + *_ps = _s->next; \14.1442 + if (_s->next == NULL) \14.1443 + (ABFD)->section_tail = _ps; \14.1444 + } \14.1445 + while (0)14.1446 +#define bfd_section_list_insert(ABFD, PS, S) \14.1447 + do \14.1448 + { \14.1449 + asection **_ps = PS; \14.1450 + asection *_s = S; \14.1451 + _s->next = *_ps; \14.1452 + *_ps = _s; \14.1453 + if (_s->next == NULL) \14.1454 + (ABFD)->section_tail = &_s->next; \14.1455 + } \14.1456 + while (0)14.1457 +14.1458 +void bfd_section_list_clear (bfd *);14.1459 +14.1460 +asection *bfd_get_section_by_name (bfd *abfd, const char *name);14.1461 +14.1462 +asection *bfd_get_section_by_name_if14.1463 + (bfd *abfd,14.1464 + const char *name,14.1465 + bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),14.1466 + void *obj);14.1467 +14.1468 +char *bfd_get_unique_section_name14.1469 + (bfd *abfd, const char *templat, int *count);14.1470 +14.1471 +asection *bfd_make_section_old_way (bfd *abfd, const char *name);14.1472 +14.1473 +asection *bfd_make_section_anyway (bfd *abfd, const char *name);14.1474 +14.1475 +asection *bfd_make_section (bfd *, const char *name);14.1476 +14.1477 +bfd_boolean bfd_set_section_flags14.1478 + (bfd *abfd, asection *sec, flagword flags);14.1479 +14.1480 +void bfd_map_over_sections14.1481 + (bfd *abfd,14.1482 + void (*func) (bfd *abfd, asection *sect, void *obj),14.1483 + void *obj);14.1484 +14.1485 +asection *bfd_sections_find_if14.1486 + (bfd *abfd,14.1487 + bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),14.1488 + void *obj);14.1489 +14.1490 +bfd_boolean bfd_set_section_size14.1491 + (bfd *abfd, asection *sec, bfd_size_type val);14.1492 +14.1493 +bfd_boolean bfd_set_section_contents14.1494 + (bfd *abfd, asection *section, const void *data,14.1495 + file_ptr offset, bfd_size_type count);14.1496 +14.1497 +bfd_boolean bfd_get_section_contents14.1498 + (bfd *abfd, asection *section, void *location, file_ptr offset,14.1499 + bfd_size_type count);14.1500 +14.1501 +bfd_boolean bfd_malloc_and_get_section14.1502 + (bfd *abfd, asection *section, bfd_byte **buf);14.1503 +14.1504 +bfd_boolean bfd_copy_private_section_data14.1505 + (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);14.1506 +14.1507 +#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \14.1508 + BFD_SEND (obfd, _bfd_copy_private_section_data, \14.1509 + (ibfd, isection, obfd, osection))14.1510 +void _bfd_strip_section_from_output14.1511 + (struct bfd_link_info *info, asection *section);14.1512 +14.1513 +bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);14.1514 +14.1515 +bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);14.1516 +14.1517 +/* Extracted from archures.c. */14.1518 +enum bfd_architecture14.1519 +{14.1520 + bfd_arch_unknown, /* File arch not known. */14.1521 + bfd_arch_obscure, /* Arch known, not one of these. */14.1522 + bfd_arch_m68k, /* Motorola 68xxx */14.1523 +#define bfd_mach_m68000 114.1524 +#define bfd_mach_m68008 214.1525 +#define bfd_mach_m68010 314.1526 +#define bfd_mach_m68020 414.1527 +#define bfd_mach_m68030 514.1528 +#define bfd_mach_m68040 614.1529 +#define bfd_mach_m68060 714.1530 +#define bfd_mach_cpu32 814.1531 +#define bfd_mach_mcf5200 914.1532 +#define bfd_mach_mcf5206e 1014.1533 +#define bfd_mach_mcf5307 1114.1534 +#define bfd_mach_mcf5407 1214.1535 +#define bfd_mach_mcf528x 1314.1536 +#define bfd_mach_mcfv4e 1414.1537 +#define bfd_mach_mcf521x 1514.1538 +#define bfd_mach_mcf5249 1614.1539 +#define bfd_mach_mcf547x 1714.1540 +#define bfd_mach_mcf548x 1814.1541 + bfd_arch_vax, /* DEC Vax */14.1542 + bfd_arch_i960, /* Intel 960 */14.1543 + /* The order of the following is important.14.1544 + lower number indicates a machine type that14.1545 + only accepts a subset of the instructions14.1546 + available to machines with higher numbers.14.1547 + The exception is the "ca", which is14.1548 + incompatible with all other machines except14.1549 + "core". */14.1550 +14.1551 +#define bfd_mach_i960_core 114.1552 +#define bfd_mach_i960_ka_sa 214.1553 +#define bfd_mach_i960_kb_sb 314.1554 +#define bfd_mach_i960_mc 414.1555 +#define bfd_mach_i960_xa 514.1556 +#define bfd_mach_i960_ca 614.1557 +#define bfd_mach_i960_jx 714.1558 +#define bfd_mach_i960_hx 814.1559 +14.1560 + bfd_arch_or32, /* OpenRISC 32 */14.1561 +14.1562 + bfd_arch_a29k, /* AMD 29000 */14.1563 + bfd_arch_sparc, /* SPARC */14.1564 +#define bfd_mach_sparc 114.1565 +/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */14.1566 +#define bfd_mach_sparc_sparclet 214.1567 +#define bfd_mach_sparc_sparclite 314.1568 +#define bfd_mach_sparc_v8plus 414.1569 +#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */14.1570 +#define bfd_mach_sparc_sparclite_le 614.1571 +#define bfd_mach_sparc_v9 714.1572 +#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */14.1573 +#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */14.1574 +#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */14.1575 +/* Nonzero if MACH has the v9 instruction set. */14.1576 +#define bfd_mach_sparc_v9_p(mach) \14.1577 + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \14.1578 + && (mach) != bfd_mach_sparc_sparclite_le)14.1579 +/* Nonzero if MACH is a 64 bit sparc architecture. */14.1580 +#define bfd_mach_sparc_64bit_p(mach) \14.1581 + ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)14.1582 + bfd_arch_mips, /* MIPS Rxxxx */14.1583 +#define bfd_mach_mips3000 300014.1584 +#define bfd_mach_mips3900 390014.1585 +#define bfd_mach_mips4000 400014.1586 +#define bfd_mach_mips4010 401014.1587 +#define bfd_mach_mips4100 410014.1588 +#define bfd_mach_mips4111 411114.1589 +#define bfd_mach_mips4120 412014.1590 +#define bfd_mach_mips4300 430014.1591 +#define bfd_mach_mips4400 440014.1592 +#define bfd_mach_mips4600 460014.1593 +#define bfd_mach_mips4650 465014.1594 +#define bfd_mach_mips5000 500014.1595 +#define bfd_mach_mips5400 540014.1596 +#define bfd_mach_mips5500 550014.1597 +#define bfd_mach_mips6000 600014.1598 +#define bfd_mach_mips7000 700014.1599 +#define bfd_mach_mips8000 800014.1600 +#define bfd_mach_mips9000 900014.1601 +#define bfd_mach_mips10000 1000014.1602 +#define bfd_mach_mips12000 1200014.1603 +#define bfd_mach_mips16 1614.1604 +#define bfd_mach_mips5 514.1605 +#define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */14.1606 +#define bfd_mach_mipsisa32 3214.1607 +#define bfd_mach_mipsisa32r2 3314.1608 +#define bfd_mach_mipsisa64 6414.1609 +#define bfd_mach_mipsisa64r2 6514.1610 + bfd_arch_i386, /* Intel 386 */14.1611 +#define bfd_mach_i386_i386 114.1612 +#define bfd_mach_i386_i8086 214.1613 +#define bfd_mach_i386_i386_intel_syntax 314.1614 +#define bfd_mach_x86_64 6414.1615 +#define bfd_mach_x86_64_intel_syntax 6514.1616 + bfd_arch_we32k, /* AT&T WE32xxx */14.1617 + bfd_arch_tahoe, /* CCI/Harris Tahoe */14.1618 + bfd_arch_i860, /* Intel 860 */14.1619 + bfd_arch_i370, /* IBM 360/370 Mainframes */14.1620 + bfd_arch_romp, /* IBM ROMP PC/RT */14.1621 + bfd_arch_alliant, /* Alliant */14.1622 + bfd_arch_convex, /* Convex */14.1623 + bfd_arch_m88k, /* Motorola 88xxx */14.1624 + bfd_arch_m98k, /* Motorola 98xxx */14.1625 + bfd_arch_pyramid, /* Pyramid Technology */14.1626 + bfd_arch_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */14.1627 +#define bfd_mach_h8300 114.1628 +#define bfd_mach_h8300h 214.1629 +#define bfd_mach_h8300s 314.1630 +#define bfd_mach_h8300hn 414.1631 +#define bfd_mach_h8300sn 514.1632 +#define bfd_mach_h8300sx 614.1633 +#define bfd_mach_h8300sxn 714.1634 + bfd_arch_pdp11, /* DEC PDP-11 */14.1635 + bfd_arch_powerpc, /* PowerPC */14.1636 +#define bfd_mach_ppc 3214.1637 +#define bfd_mach_ppc64 6414.1638 +#define bfd_mach_ppc_403 40314.1639 +#define bfd_mach_ppc_403gc 403014.1640 +#define bfd_mach_ppc_505 50514.1641 +#define bfd_mach_ppc_601 60114.1642 +#define bfd_mach_ppc_602 60214.1643 +#define bfd_mach_ppc_603 60314.1644 +#define bfd_mach_ppc_ec603e 603114.1645 +#define bfd_mach_ppc_604 60414.1646 +#define bfd_mach_ppc_620 62014.1647 +#define bfd_mach_ppc_630 63014.1648 +#define bfd_mach_ppc_750 75014.1649 +#define bfd_mach_ppc_860 86014.1650 +#define bfd_mach_ppc_a35 3514.1651 +#define bfd_mach_ppc_rs64ii 64214.1652 +#define bfd_mach_ppc_rs64iii 64314.1653 +#define bfd_mach_ppc_7400 740014.1654 +#define bfd_mach_ppc_e500 50014.1655 + bfd_arch_rs6000, /* IBM RS/6000 */14.1656 +#define bfd_mach_rs6k 600014.1657 +#define bfd_mach_rs6k_rs1 600114.1658 +#define bfd_mach_rs6k_rsc 600314.1659 +#define bfd_mach_rs6k_rs2 600214.1660 + bfd_arch_hppa, /* HP PA RISC */14.1661 +#define bfd_mach_hppa10 1014.1662 +#define bfd_mach_hppa11 1114.1663 +#define bfd_mach_hppa20 2014.1664 +#define bfd_mach_hppa20w 2514.1665 + bfd_arch_d10v, /* Mitsubishi D10V */14.1666 +#define bfd_mach_d10v 114.1667 +#define bfd_mach_d10v_ts2 214.1668 +#define bfd_mach_d10v_ts3 314.1669 + bfd_arch_d30v, /* Mitsubishi D30V */14.1670 + bfd_arch_dlx, /* DLX */14.1671 + bfd_arch_m68hc11, /* Motorola 68HC11 */14.1672 + bfd_arch_m68hc12, /* Motorola 68HC12 */14.1673 +#define bfd_mach_m6812_default 014.1674 +#define bfd_mach_m6812 114.1675 +#define bfd_mach_m6812s 214.1676 + bfd_arch_z8k, /* Zilog Z8000 */14.1677 +#define bfd_mach_z8001 114.1678 +#define bfd_mach_z8002 214.1679 + bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */14.1680 + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */14.1681 +#define bfd_mach_sh 114.1682 +#define bfd_mach_sh2 0x2014.1683 +#define bfd_mach_sh_dsp 0x2d14.1684 +#define bfd_mach_sh2a 0x2a14.1685 +#define bfd_mach_sh2a_nofpu 0x2b14.1686 +#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a114.1687 +#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a214.1688 +#define bfd_mach_sh2a_or_sh4 0x2a314.1689 +#define bfd_mach_sh2a_or_sh3e 0x2a414.1690 +#define bfd_mach_sh2e 0x2e14.1691 +#define bfd_mach_sh3 0x3014.1692 +#define bfd_mach_sh3_nommu 0x3114.1693 +#define bfd_mach_sh3_dsp 0x3d14.1694 +#define bfd_mach_sh3e 0x3e14.1695 +#define bfd_mach_sh4 0x4014.1696 +#define bfd_mach_sh4_nofpu 0x4114.1697 +#define bfd_mach_sh4_nommu_nofpu 0x4214.1698 +#define bfd_mach_sh4a 0x4a14.1699 +#define bfd_mach_sh4a_nofpu 0x4b14.1700 +#define bfd_mach_sh4al_dsp 0x4d14.1701 +#define bfd_mach_sh5 0x5014.1702 + bfd_arch_alpha, /* Dec Alpha */14.1703 +#define bfd_mach_alpha_ev4 0x1014.1704 +#define bfd_mach_alpha_ev5 0x2014.1705 +#define bfd_mach_alpha_ev6 0x3014.1706 + bfd_arch_arm, /* Advanced Risc Machines ARM. */14.1707 +#define bfd_mach_arm_unknown 014.1708 +#define bfd_mach_arm_2 114.1709 +#define bfd_mach_arm_2a 214.1710 +#define bfd_mach_arm_3 314.1711 +#define bfd_mach_arm_3M 414.1712 +#define bfd_mach_arm_4 514.1713 +#define bfd_mach_arm_4T 614.1714 +#define bfd_mach_arm_5 714.1715 +#define bfd_mach_arm_5T 814.1716 +#define bfd_mach_arm_5TE 914.1717 +#define bfd_mach_arm_XScale 1014.1718 +#define bfd_mach_arm_ep9312 1114.1719 +#define bfd_mach_arm_iWMMXt 1214.1720 + bfd_arch_ns32k, /* National Semiconductors ns32000 */14.1721 + bfd_arch_w65, /* WDC 65816 */14.1722 + bfd_arch_tic30, /* Texas Instruments TMS320C30 */14.1723 + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */14.1724 +#define bfd_mach_tic3x 3014.1725 +#define bfd_mach_tic4x 4014.1726 + bfd_arch_tic54x, /* Texas Instruments TMS320C54X */14.1727 + bfd_arch_tic80, /* TI TMS320c80 (MVP) */14.1728 + bfd_arch_v850, /* NEC V850 */14.1729 +#define bfd_mach_v850 114.1730 +#define bfd_mach_v850e 'E'14.1731 +#define bfd_mach_v850e1 '1'14.1732 + bfd_arch_arc, /* ARC Cores */14.1733 +#define bfd_mach_arc_5 514.1734 +#define bfd_mach_arc_6 614.1735 +#define bfd_mach_arc_7 714.1736 +#define bfd_mach_arc_8 814.1737 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */14.1738 +#define bfd_mach_m32r 1 /* For backwards compatibility. */14.1739 +#define bfd_mach_m32rx 'x'14.1740 +#define bfd_mach_m32r2 '2'14.1741 + bfd_arch_mn10200, /* Matsushita MN10200 */14.1742 + bfd_arch_mn10300, /* Matsushita MN10300 */14.1743 +#define bfd_mach_mn10300 30014.1744 +#define bfd_mach_am33 33014.1745 +#define bfd_mach_am33_2 33214.1746 + bfd_arch_fr30,14.1747 +#define bfd_mach_fr30 0x4652333014.1748 + bfd_arch_frv,14.1749 +#define bfd_mach_frv 114.1750 +#define bfd_mach_frvsimple 214.1751 +#define bfd_mach_fr300 30014.1752 +#define bfd_mach_fr400 40014.1753 +#define bfd_mach_fr450 45014.1754 +#define bfd_mach_frvtomcat 499 /* fr500 prototype */14.1755 +#define bfd_mach_fr500 50014.1756 +#define bfd_mach_fr550 55014.1757 + bfd_arch_mcore,14.1758 + bfd_arch_ia64, /* HP/Intel ia64 */14.1759 +#define bfd_mach_ia64_elf64 6414.1760 +#define bfd_mach_ia64_elf32 3214.1761 + bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */14.1762 +#define bfd_mach_ip2022 114.1763 +#define bfd_mach_ip2022ext 214.1764 + bfd_arch_iq2000, /* Vitesse IQ2000. */14.1765 +#define bfd_mach_iq2000 114.1766 +#define bfd_mach_iq10 214.1767 + bfd_arch_pj,14.1768 + bfd_arch_avr, /* Atmel AVR microcontrollers. */14.1769 +#define bfd_mach_avr1 114.1770 +#define bfd_mach_avr2 214.1771 +#define bfd_mach_avr3 314.1772 +#define bfd_mach_avr4 414.1773 +#define bfd_mach_avr5 514.1774 + bfd_arch_cr16c, /* National Semiconductor CompactRISC. */14.1775 +#define bfd_mach_cr16c 114.1776 + bfd_arch_crx, /* National Semiconductor CRX. */14.1777 +#define bfd_mach_crx 114.1778 + bfd_arch_cris, /* Axis CRIS */14.1779 +#define bfd_mach_cris_v0_v10 25514.1780 +#define bfd_mach_cris_v32 3214.1781 +#define bfd_mach_cris_v10_v32 103214.1782 + bfd_arch_s390, /* IBM s390 */14.1783 +#define bfd_mach_s390_31 3114.1784 +#define bfd_mach_s390_64 6414.1785 + bfd_arch_openrisc, /* OpenRISC */14.1786 + bfd_arch_mmix, /* Donald Knuth's educational processor. */14.1787 + bfd_arch_xstormy16,14.1788 +#define bfd_mach_xstormy16 114.1789 + bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */14.1790 +#define bfd_mach_msp11 1114.1791 +#define bfd_mach_msp110 11014.1792 +#define bfd_mach_msp12 1214.1793 +#define bfd_mach_msp13 1314.1794 +#define bfd_mach_msp14 1414.1795 +#define bfd_mach_msp15 1514.1796 +#define bfd_mach_msp16 1614.1797 +#define bfd_mach_msp31 3114.1798 +#define bfd_mach_msp32 3214.1799 +#define bfd_mach_msp33 3314.1800 +#define bfd_mach_msp41 4114.1801 +#define bfd_mach_msp42 4214.1802 +#define bfd_mach_msp43 4314.1803 +#define bfd_mach_msp44 4414.1804 + bfd_arch_xtensa, /* Tensilica's Xtensa cores. */14.1805 +#define bfd_mach_xtensa 114.1806 + bfd_arch_maxq, /* Dallas MAXQ 10/20 */14.1807 +#define bfd_mach_maxq10 1014.1808 +#define bfd_mach_maxq20 2014.1809 + bfd_arch_last14.1810 + };14.1811 +14.1812 +typedef struct bfd_arch_info14.1813 +{14.1814 + int bits_per_word;14.1815 + int bits_per_address;14.1816 + int bits_per_byte;14.1817 + enum bfd_architecture arch;14.1818 + unsigned long mach;14.1819 + const char *arch_name;14.1820 + const char *printable_name;14.1821 + unsigned int section_align_power;14.1822 + /* TRUE if this is the default machine for the architecture.14.1823 + The default arch should be the first entry for an arch so that14.1824 + all the entries for that arch can be accessed via <<next>>. */14.1825 + bfd_boolean the_default;14.1826 + const struct bfd_arch_info * (*compatible)14.1827 + (const struct bfd_arch_info *a, const struct bfd_arch_info *b);14.1828 +14.1829 + bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);14.1830 +14.1831 + const struct bfd_arch_info *next;14.1832 +}14.1833 +bfd_arch_info_type;14.1834 +14.1835 +const char *bfd_printable_name (bfd *abfd);14.1836 +14.1837 +const bfd_arch_info_type *bfd_scan_arch (const char *string);14.1838 +14.1839 +const char **bfd_arch_list (void);14.1840 +14.1841 +const bfd_arch_info_type *bfd_arch_get_compatible14.1842 + (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);14.1843 +14.1844 +void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);14.1845 +14.1846 +enum bfd_architecture bfd_get_arch (bfd *abfd);14.1847 +14.1848 +unsigned long bfd_get_mach (bfd *abfd);14.1849 +14.1850 +unsigned int bfd_arch_bits_per_byte (bfd *abfd);14.1851 +14.1852 +unsigned int bfd_arch_bits_per_address (bfd *abfd);14.1853 +14.1854 +const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);14.1855 +14.1856 +const bfd_arch_info_type *bfd_lookup_arch14.1857 + (enum bfd_architecture arch, unsigned long machine);14.1858 +14.1859 +const char *bfd_printable_arch_mach14.1860 + (enum bfd_architecture arch, unsigned long machine);14.1861 +14.1862 +unsigned int bfd_octets_per_byte (bfd *abfd);14.1863 +14.1864 +unsigned int bfd_arch_mach_octets_per_byte14.1865 + (enum bfd_architecture arch, unsigned long machine);14.1866 +14.1867 +/* Extracted from reloc.c. */14.1868 +typedef enum bfd_reloc_status14.1869 +{14.1870 + /* No errors detected. */14.1871 + bfd_reloc_ok,14.1872 +14.1873 + /* The relocation was performed, but there was an overflow. */14.1874 + bfd_reloc_overflow,14.1875 +14.1876 + /* The address to relocate was not within the section supplied. */14.1877 + bfd_reloc_outofrange,14.1878 +14.1879 + /* Used by special functions. */14.1880 + bfd_reloc_continue,14.1881 +14.1882 + /* Unsupported relocation size requested. */14.1883 + bfd_reloc_notsupported,14.1884 +14.1885 + /* Unused. */14.1886 + bfd_reloc_other,14.1887 +14.1888 + /* The symbol to relocate against was undefined. */14.1889 + bfd_reloc_undefined,14.1890 +14.1891 + /* The relocation was performed, but may not be ok - presently14.1892 + generated only when linking i960 coff files with i960 b.out14.1893 + symbols. If this type is returned, the error_message argument14.1894 + to bfd_perform_relocation will be set. */14.1895 + bfd_reloc_dangerous14.1896 + }14.1897 + bfd_reloc_status_type;14.1898 +14.1899 +14.1900 +typedef struct reloc_cache_entry14.1901 +{14.1902 + /* A pointer into the canonical table of pointers. */14.1903 + struct bfd_symbol **sym_ptr_ptr;14.1904 +14.1905 + /* offset in section. */14.1906 + bfd_size_type address;14.1907 +14.1908 + /* addend for relocation value. */14.1909 + bfd_vma addend;14.1910 +14.1911 + /* Pointer to how to perform the required relocation. */14.1912 + reloc_howto_type *howto;14.1913 +14.1914 +}14.1915 +arelent;14.1916 +14.1917 +enum complain_overflow14.1918 +{14.1919 + /* Do not complain on overflow. */14.1920 + complain_overflow_dont,14.1921 +14.1922 + /* Complain if the bitfield overflows, whether it is considered14.1923 + as signed or unsigned. */14.1924 + complain_overflow_bitfield,14.1925 +14.1926 + /* Complain if the value overflows when considered as signed14.1927 + number. */14.1928 + complain_overflow_signed,14.1929 +14.1930 + /* Complain if the value overflows when considered as an14.1931 + unsigned number. */14.1932 + complain_overflow_unsigned14.1933 +};14.1934 +14.1935 +struct reloc_howto_struct14.1936 +{14.1937 + /* The type field has mainly a documentary use - the back end can14.1938 + do what it wants with it, though normally the back end's14.1939 + external idea of what a reloc number is stored14.1940 + in this field. For example, a PC relative word relocation14.1941 + in a coff environment has the type 023 - because that's14.1942 + what the outside world calls a R_PCRWORD reloc. */14.1943 + unsigned int type;14.1944 +14.1945 + /* The value the final relocation is shifted right by. This drops14.1946 + unwanted data from the relocation. */14.1947 + unsigned int rightshift;14.1948 +14.1949 + /* The size of the item to be relocated. This is *not* a14.1950 + power-of-two measure. To get the number of bytes operated14.1951 + on by a type of relocation, use bfd_get_reloc_size. */14.1952 + int size;14.1953 +14.1954 + /* The number of bits in the item to be relocated. This is used14.1955 + when doing overflow checking. */14.1956 + unsigned int bitsize;14.1957 +14.1958 + /* Notes that the relocation is relative to the location in the14.1959 + data section of the addend. The relocation function will14.1960 + subtract from the relocation value the address of the location14.1961 + being relocated. */14.1962 + bfd_boolean pc_relative;14.1963 +14.1964 + /* The bit position of the reloc value in the destination.14.1965 + The relocated value is left shifted by this amount. */14.1966 + unsigned int bitpos;14.1967 +14.1968 + /* What type of overflow error should be checked for when14.1969 + relocating. */14.1970 + enum complain_overflow complain_on_overflow;14.1971 +14.1972 + /* If this field is non null, then the supplied function is14.1973 + called rather than the normal function. This allows really14.1974 + strange relocation methods to be accommodated (e.g., i960 callj14.1975 + instructions). */14.1976 + bfd_reloc_status_type (*special_function)14.1977 + (bfd *, arelent *, struct bfd_symbol *, void *, asection *,14.1978 + bfd *, char **);14.1979 +14.1980 + /* The textual name of the relocation type. */14.1981 + char *name;14.1982 +14.1983 + /* Some formats record a relocation addend in the section contents14.1984 + rather than with the relocation. For ELF formats this is the14.1985 + distinction between USE_REL and USE_RELA (though the code checks14.1986 + for USE_REL == 1/0). The value of this field is TRUE if the14.1987 + addend is recorded with the section contents; when performing a14.1988 + partial link (ld -r) the section contents (the data) will be14.1989 + modified. The value of this field is FALSE if addends are14.1990 + recorded with the relocation (in arelent.addend); when performing14.1991 + a partial link the relocation will be modified.14.1992 + All relocations for all ELF USE_RELA targets should set this field14.1993 + to FALSE (values of TRUE should be looked on with suspicion).14.1994 + However, the converse is not true: not all relocations of all ELF14.1995 + USE_REL targets set this field to TRUE. Why this is so is peculiar14.1996 + to each particular target. For relocs that aren't used in partial14.1997 + links (e.g. GOT stuff) it doesn't matter what this is set to. */14.1998 + bfd_boolean partial_inplace;14.1999 +14.2000 + /* src_mask selects the part of the instruction (or data) to be used14.2001 + in the relocation sum. If the target relocations don't have an14.2002 + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal14.2003 + dst_mask to extract the addend from the section contents. If14.2004 + relocations do have an addend in the reloc, eg. ELF USE_RELA, this14.2005 + field should be zero. Non-zero values for ELF USE_RELA targets are14.2006 + bogus as in those cases the value in the dst_mask part of the14.2007 + section contents should be treated as garbage. */14.2008 + bfd_vma src_mask;14.2009 +14.2010 + /* dst_mask selects which parts of the instruction (or data) are14.2011 + replaced with a relocated value. */14.2012 + bfd_vma dst_mask;14.2013 +14.2014 + /* When some formats create PC relative instructions, they leave14.2015 + the value of the pc of the place being relocated in the offset14.2016 + slot of the instruction, so that a PC relative relocation can14.2017 + be made just by adding in an ordinary offset (e.g., sun3 a.out).14.2018 + Some formats leave the displacement part of an instruction14.2019 + empty (e.g., m88k bcs); this flag signals the fact. */14.2020 + bfd_boolean pcrel_offset;14.2021 +};14.2022 +14.2023 +#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \14.2024 + { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }14.2025 +#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \14.2026 + HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \14.2027 + NAME, FALSE, 0, 0, IN)14.2028 +14.2029 +#define EMPTY_HOWTO(C) \14.2030 + HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \14.2031 + NULL, FALSE, 0, 0, FALSE)14.2032 +14.2033 +#define HOWTO_PREPARE(relocation, symbol) \14.2034 + { \14.2035 + if (symbol != NULL) \14.2036 + { \14.2037 + if (bfd_is_com_section (symbol->section)) \14.2038 + { \14.2039 + relocation = 0; \14.2040 + } \14.2041 + else \14.2042 + { \14.2043 + relocation = symbol->value; \14.2044 + } \14.2045 + } \14.2046 + }14.2047 +14.2048 +unsigned int bfd_get_reloc_size (reloc_howto_type *);14.2049 +14.2050 +typedef struct relent_chain14.2051 +{14.2052 + arelent relent;14.2053 + struct relent_chain *next;14.2054 +}14.2055 +arelent_chain;14.2056 +14.2057 +bfd_reloc_status_type bfd_check_overflow14.2058 + (enum complain_overflow how,14.2059 + unsigned int bitsize,14.2060 + unsigned int rightshift,14.2061 + unsigned int addrsize,14.2062 + bfd_vma relocation);14.2063 +14.2064 +bfd_reloc_status_type bfd_perform_relocation14.2065 + (bfd *abfd,14.2066 + arelent *reloc_entry,14.2067 + void *data,14.2068 + asection *input_section,14.2069 + bfd *output_bfd,14.2070 + char **error_message);14.2071 +14.2072 +bfd_reloc_status_type bfd_install_relocation14.2073 + (bfd *abfd,14.2074 + arelent *reloc_entry,14.2075 + void *data, bfd_vma data_start,14.2076 + asection *input_section,14.2077 + char **error_message);14.2078 +14.2079 +enum bfd_reloc_code_real {14.2080 + _dummy_first_bfd_reloc_code_real,14.2081 +14.2082 +14.2083 +/* Basic absolute relocations of N bits. */14.2084 + BFD_RELOC_64,14.2085 + BFD_RELOC_32,14.2086 + BFD_RELOC_26,14.2087 + BFD_RELOC_24,14.2088 + BFD_RELOC_16,14.2089 + BFD_RELOC_14,14.2090 + BFD_RELOC_8,14.2091 +14.2092 +/* PC-relative relocations. Sometimes these are relative to the address14.2093 +of the relocation itself; sometimes they are relative to the start of14.2094 +the section containing the relocation. It depends on the specific target.14.2095 +14.2096 +The 24-bit relocation is used in some Intel 960 configurations. */14.2097 + BFD_RELOC_64_PCREL,14.2098 + BFD_RELOC_32_PCREL,14.2099 + BFD_RELOC_24_PCREL,14.2100 + BFD_RELOC_16_PCREL,14.2101 + BFD_RELOC_12_PCREL,14.2102 + BFD_RELOC_8_PCREL,14.2103 +14.2104 +/* Section relative relocations. Some targets need this for DWARF2. */14.2105 + BFD_RELOC_32_SECREL,14.2106 +14.2107 +/* For ELF. */14.2108 + BFD_RELOC_32_GOT_PCREL,14.2109 + BFD_RELOC_16_GOT_PCREL,14.2110 + BFD_RELOC_8_GOT_PCREL,14.2111 + BFD_RELOC_32_GOTOFF,14.2112 + BFD_RELOC_16_GOTOFF,14.2113 + BFD_RELOC_LO16_GOTOFF,14.2114 + BFD_RELOC_HI16_GOTOFF,14.2115 + BFD_RELOC_HI16_S_GOTOFF,14.2116 + BFD_RELOC_8_GOTOFF,14.2117 + BFD_RELOC_64_PLT_PCREL,14.2118 + BFD_RELOC_32_PLT_PCREL,14.2119 + BFD_RELOC_24_PLT_PCREL,14.2120 + BFD_RELOC_16_PLT_PCREL,14.2121 + BFD_RELOC_8_PLT_PCREL,14.2122 + BFD_RELOC_64_PLTOFF,14.2123 + BFD_RELOC_32_PLTOFF,14.2124 + BFD_RELOC_16_PLTOFF,14.2125 + BFD_RELOC_LO16_PLTOFF,14.2126 + BFD_RELOC_HI16_PLTOFF,14.2127 + BFD_RELOC_HI16_S_PLTOFF,14.2128 + BFD_RELOC_8_PLTOFF,14.2129 +14.2130 +/* Relocations used by 68K ELF. */14.2131 + BFD_RELOC_68K_GLOB_DAT,14.2132 + BFD_RELOC_68K_JMP_SLOT,14.2133 + BFD_RELOC_68K_RELATIVE,14.2134 +14.2135 +/* Linkage-table relative. */14.2136 + BFD_RELOC_32_BASEREL,14.2137 + BFD_RELOC_16_BASEREL,14.2138 + BFD_RELOC_LO16_BASEREL,14.2139 + BFD_RELOC_HI16_BASEREL,14.2140 + BFD_RELOC_HI16_S_BASEREL,14.2141 + BFD_RELOC_8_BASEREL,14.2142 + BFD_RELOC_RVA,14.2143 +14.2144 +/* Absolute 8-bit relocation, but used to form an address like 0xFFnn. */14.2145 + BFD_RELOC_8_FFnn,14.2146 +14.2147 +/* These PC-relative relocations are stored as word displacements --14.2148 +i.e., byte displacements shifted right two bits. The 30-bit word14.2149 +displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the14.2150 +SPARC. (SPARC tools generally refer to this as <<WDISP30>>.) The14.2151 +signed 16-bit displacement is used on the MIPS, and the 23-bit14.2152 +displacement is used on the Alpha. */14.2153 + BFD_RELOC_32_PCREL_S2,14.2154 + BFD_RELOC_16_PCREL_S2,14.2155 + BFD_RELOC_23_PCREL_S2,14.2156 +14.2157 +/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of14.2158 +the target word. These are used on the SPARC. */14.2159 + BFD_RELOC_HI22,14.2160 + BFD_RELOC_LO10,14.2161 +14.2162 +/* For systems that allocate a Global Pointer register, these are14.2163 +displacements off that register. These relocation types are14.2164 +handled specially, because the value the register will have is14.2165 +decided relatively late. */14.2166 + BFD_RELOC_GPREL16,14.2167 + BFD_RELOC_GPREL32,14.2168 +14.2169 +/* Reloc types used for i960/b.out. */14.2170 + BFD_RELOC_I960_CALLJ,14.2171 +14.2172 +/* SPARC ELF relocations. There is probably some overlap with other14.2173 +relocation types already defined. */14.2174 + BFD_RELOC_NONE,14.2175 + BFD_RELOC_SPARC_WDISP22,14.2176 + BFD_RELOC_SPARC22,14.2177 + BFD_RELOC_SPARC13,14.2178 + BFD_RELOC_SPARC_GOT10,14.2179 + BFD_RELOC_SPARC_GOT13,14.2180 + BFD_RELOC_SPARC_GOT22,14.2181 + BFD_RELOC_SPARC_PC10,14.2182 + BFD_RELOC_SPARC_PC22,14.2183 + BFD_RELOC_SPARC_WPLT30,14.2184 + BFD_RELOC_SPARC_COPY,14.2185 + BFD_RELOC_SPARC_GLOB_DAT,14.2186 + BFD_RELOC_SPARC_JMP_SLOT,14.2187 + BFD_RELOC_SPARC_RELATIVE,14.2188 + BFD_RELOC_SPARC_UA16,14.2189 + BFD_RELOC_SPARC_UA32,14.2190 + BFD_RELOC_SPARC_UA64,14.2191 +14.2192 +/* I think these are specific to SPARC a.out (e.g., Sun 4). */14.2193 + BFD_RELOC_SPARC_BASE13,14.2194 + BFD_RELOC_SPARC_BASE22,14.2195 +14.2196 +/* SPARC64 relocations */14.2197 +#define BFD_RELOC_SPARC_64 BFD_RELOC_6414.2198 + BFD_RELOC_SPARC_10,14.2199 + BFD_RELOC_SPARC_11,14.2200 + BFD_RELOC_SPARC_OLO10,14.2201 + BFD_RELOC_SPARC_HH22,14.2202 + BFD_RELOC_SPARC_HM10,14.2203 + BFD_RELOC_SPARC_LM22,14.2204 + BFD_RELOC_SPARC_PC_HH22,14.2205 + BFD_RELOC_SPARC_PC_HM10,14.2206 + BFD_RELOC_SPARC_PC_LM22,14.2207 + BFD_RELOC_SPARC_WDISP16,14.2208 + BFD_RELOC_SPARC_WDISP19,14.2209 + BFD_RELOC_SPARC_7,14.2210 + BFD_RELOC_SPARC_6,14.2211 + BFD_RELOC_SPARC_5,14.2212 +#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL14.2213 + BFD_RELOC_SPARC_PLT32,14.2214 + BFD_RELOC_SPARC_PLT64,14.2215 + BFD_RELOC_SPARC_HIX22,14.2216 + BFD_RELOC_SPARC_LOX10,14.2217 + BFD_RELOC_SPARC_H44,14.2218 + BFD_RELOC_SPARC_M44,14.2219 + BFD_RELOC_SPARC_L44,14.2220 + BFD_RELOC_SPARC_REGISTER,14.2221 +14.2222 +/* SPARC little endian relocation */14.2223 + BFD_RELOC_SPARC_REV32,14.2224 +14.2225 +/* SPARC TLS relocations */14.2226 + BFD_RELOC_SPARC_TLS_GD_HI22,14.2227 + BFD_RELOC_SPARC_TLS_GD_LO10,14.2228 + BFD_RELOC_SPARC_TLS_GD_ADD,14.2229 + BFD_RELOC_SPARC_TLS_GD_CALL,14.2230 + BFD_RELOC_SPARC_TLS_LDM_HI22,14.2231 + BFD_RELOC_SPARC_TLS_LDM_LO10,14.2232 + BFD_RELOC_SPARC_TLS_LDM_ADD,14.2233 + BFD_RELOC_SPARC_TLS_LDM_CALL,14.2234 + BFD_RELOC_SPARC_TLS_LDO_HIX22,14.2235 + BFD_RELOC_SPARC_TLS_LDO_LOX10,14.2236 + BFD_RELOC_SPARC_TLS_LDO_ADD,14.2237 + BFD_RELOC_SPARC_TLS_IE_HI22,14.2238 + BFD_RELOC_SPARC_TLS_IE_LO10,14.2239 + BFD_RELOC_SPARC_TLS_IE_LD,14.2240 + BFD_RELOC_SPARC_TLS_IE_LDX,14.2241 + BFD_RELOC_SPARC_TLS_IE_ADD,14.2242 + BFD_RELOC_SPARC_TLS_LE_HIX22,14.2243 + BFD_RELOC_SPARC_TLS_LE_LOX10,14.2244 + BFD_RELOC_SPARC_TLS_DTPMOD32,14.2245 + BFD_RELOC_SPARC_TLS_DTPMOD64,14.2246 + BFD_RELOC_SPARC_TLS_DTPOFF32,14.2247 + BFD_RELOC_SPARC_TLS_DTPOFF64,14.2248 + BFD_RELOC_SPARC_TLS_TPOFF32,14.2249 + BFD_RELOC_SPARC_TLS_TPOFF64,14.2250 +14.2251 +/* Alpha ECOFF and ELF relocations. Some of these treat the symbol or14.2252 +"addend" in some special way.14.2253 +For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when14.2254 +writing; when reading, it will be the absolute section symbol. The14.2255 +addend is the displacement in bytes of the "lda" instruction from14.2256 +the "ldah" instruction (which is at the address of this reloc). */14.2257 + BFD_RELOC_ALPHA_GPDISP_HI16,14.2258 +14.2259 +/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as14.2260 +with GPDISP_HI16 relocs. The addend is ignored when writing the14.2261 +relocations out, and is filled in with the file's GP value on14.2262 +reading, for convenience. */14.2263 + BFD_RELOC_ALPHA_GPDISP_LO16,14.2264 +14.2265 +/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI1614.2266 +relocation except that there is no accompanying GPDISP_LO1614.2267 +relocation. */14.2268 + BFD_RELOC_ALPHA_GPDISP,14.2269 +14.2270 +/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;14.2271 +the assembler turns it into a LDQ instruction to load the address of14.2272 +the symbol, and then fills in a register in the real instruction.14.2273 +14.2274 +The LITERAL reloc, at the LDQ instruction, refers to the .lita14.2275 +section symbol. The addend is ignored when writing, but is filled14.2276 +in with the file's GP value on reading, for convenience, as with the14.2277 +GPDISP_LO16 reloc.14.2278 +14.2279 +The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.14.2280 +It should refer to the symbol to be referenced, as with 16_GOTOFF,14.2281 +but it generates output not based on the position within the .got14.2282 +section, but relative to the GP value chosen for the file during the14.2283 +final link stage.14.2284 +14.2285 +The LITUSE reloc, on the instruction using the loaded address, gives14.2286 +information to the linker that it might be able to use to optimize14.2287 +away some literal section references. The symbol is ignored (read14.2288 +as the absolute section symbol), and the "addend" indicates the type14.2289 +of instruction using the register:14.2290 +1 - "memory" fmt insn14.2291 +2 - byte-manipulation (byte offset reg)14.2292 +3 - jsr (target of branch) */14.2293 + BFD_RELOC_ALPHA_LITERAL,14.2294 + BFD_RELOC_ALPHA_ELF_LITERAL,14.2295 + BFD_RELOC_ALPHA_LITUSE,14.2296 +14.2297 +/* The HINT relocation indicates a value that should be filled into the14.2298 +"hint" field of a jmp/jsr/ret instruction, for possible branch-14.2299 +prediction logic which may be provided on some processors. */14.2300 + BFD_RELOC_ALPHA_HINT,14.2301 +14.2302 +/* The LINKAGE relocation outputs a linkage pair in the object file,14.2303 +which is filled by the linker. */14.2304 + BFD_RELOC_ALPHA_LINKAGE,14.2305 +14.2306 +/* The CODEADDR relocation outputs a STO_CA in the object file,14.2307 +which is filled by the linker. */14.2308 + BFD_RELOC_ALPHA_CODEADDR,14.2309 +14.2310 +/* The GPREL_HI/LO relocations together form a 32-bit offset from the14.2311 +GP register. */14.2312 + BFD_RELOC_ALPHA_GPREL_HI16,14.2313 + BFD_RELOC_ALPHA_GPREL_LO16,14.2314 +14.2315 +/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must14.2316 +share a common GP, and the target address is adjusted for14.2317 +STO_ALPHA_STD_GPLOAD. */14.2318 + BFD_RELOC_ALPHA_BRSGP,14.2319 +14.2320 +/* Alpha thread-local storage relocations. */14.2321 + BFD_RELOC_ALPHA_TLSGD,14.2322 + BFD_RELOC_ALPHA_TLSLDM,14.2323 + BFD_RELOC_ALPHA_DTPMOD64,14.2324 + BFD_RELOC_ALPHA_GOTDTPREL16,14.2325 + BFD_RELOC_ALPHA_DTPREL64,14.2326 + BFD_RELOC_ALPHA_DTPREL_HI16,14.2327 + BFD_RELOC_ALPHA_DTPREL_LO16,14.2328 + BFD_RELOC_ALPHA_DTPREL16,14.2329 + BFD_RELOC_ALPHA_GOTTPREL16,14.2330 + BFD_RELOC_ALPHA_TPREL64,14.2331 + BFD_RELOC_ALPHA_TPREL_HI16,14.2332 + BFD_RELOC_ALPHA_TPREL_LO16,14.2333 + BFD_RELOC_ALPHA_TPREL16,14.2334 +14.2335 +/* Bits 27..2 of the relocation address shifted right 2 bits;14.2336 +simple reloc otherwise. */14.2337 + BFD_RELOC_MIPS_JMP,14.2338 +14.2339 +/* The MIPS16 jump instruction. */14.2340 + BFD_RELOC_MIPS16_JMP,14.2341 +14.2342 +/* MIPS16 GP relative reloc. */14.2343 + BFD_RELOC_MIPS16_GPREL,14.2344 +14.2345 +/* High 16 bits of 32-bit value; simple reloc. */14.2346 + BFD_RELOC_HI16,14.2347 +14.2348 +/* High 16 bits of 32-bit value but the low 16 bits will be sign14.2349 +extended and added to form the final result. If the low 1614.2350 +bits form a negative number, we need to add one to the high value14.2351 +to compensate for the borrow when the low bits are added. */14.2352 + BFD_RELOC_HI16_S,14.2353 +14.2354 +/* Low 16 bits. */14.2355 + BFD_RELOC_LO16,14.2356 +14.2357 +/* MIPS16 high 16 bits of 32-bit value. */14.2358 + BFD_RELOC_MIPS16_HI16,14.2359 +14.2360 +/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign14.2361 +extended and added to form the final result. If the low 1614.2362 +bits form a negative number, we need to add one to the high value14.2363 +to compensate for the borrow when the low bits are added. */14.2364 + BFD_RELOC_MIPS16_HI16_S,14.2365 +14.2366 +/* MIPS16 low 16 bits. */14.2367 + BFD_RELOC_MIPS16_LO16,14.2368 +14.2369 +/* Relocation against a MIPS literal section. */14.2370 + BFD_RELOC_MIPS_LITERAL,14.2371 +14.2372 +/* MIPS ELF relocations. */14.2373 + BFD_RELOC_MIPS_GOT16,14.2374 + BFD_RELOC_MIPS_CALL16,14.2375 + BFD_RELOC_MIPS_GOT_HI16,14.2376 + BFD_RELOC_MIPS_GOT_LO16,14.2377 + BFD_RELOC_MIPS_CALL_HI16,14.2378 + BFD_RELOC_MIPS_CALL_LO16,14.2379 + BFD_RELOC_MIPS_SUB,14.2380 + BFD_RELOC_MIPS_GOT_PAGE,14.2381 + BFD_RELOC_MIPS_GOT_OFST,14.2382 + BFD_RELOC_MIPS_GOT_DISP,14.2383 + BFD_RELOC_MIPS_SHIFT5,14.2384 + BFD_RELOC_MIPS_SHIFT6,14.2385 + BFD_RELOC_MIPS_INSERT_A,14.2386 + BFD_RELOC_MIPS_INSERT_B,14.2387 + BFD_RELOC_MIPS_DELETE,14.2388 + BFD_RELOC_MIPS_HIGHEST,14.2389 + BFD_RELOC_MIPS_HIGHER,14.2390 + BFD_RELOC_MIPS_SCN_DISP,14.2391 + BFD_RELOC_MIPS_REL16,14.2392 + BFD_RELOC_MIPS_RELGOT,14.2393 + BFD_RELOC_MIPS_JALR,14.2394 + BFD_RELOC_MIPS_TLS_DTPMOD32,14.2395 + BFD_RELOC_MIPS_TLS_DTPREL32,14.2396 + BFD_RELOC_MIPS_TLS_DTPMOD64,14.2397 + BFD_RELOC_MIPS_TLS_DTPREL64,14.2398 + BFD_RELOC_MIPS_TLS_GD,14.2399 + BFD_RELOC_MIPS_TLS_LDM,14.2400 + BFD_RELOC_MIPS_TLS_DTPREL_HI16,14.2401 + BFD_RELOC_MIPS_TLS_DTPREL_LO16,14.2402 + BFD_RELOC_MIPS_TLS_GOTTPREL,14.2403 + BFD_RELOC_MIPS_TLS_TPREL32,14.2404 + BFD_RELOC_MIPS_TLS_TPREL64,14.2405 + BFD_RELOC_MIPS_TLS_TPREL_HI16,14.2406 + BFD_RELOC_MIPS_TLS_TPREL_LO16,14.2407 +14.2408 +14.2409 +/* Fujitsu Frv Relocations. */14.2410 + BFD_RELOC_FRV_LABEL16,14.2411 + BFD_RELOC_FRV_LABEL24,14.2412 + BFD_RELOC_FRV_LO16,14.2413 + BFD_RELOC_FRV_HI16,14.2414 + BFD_RELOC_FRV_GPREL12,14.2415 + BFD_RELOC_FRV_GPRELU12,14.2416 + BFD_RELOC_FRV_GPREL32,14.2417 + BFD_RELOC_FRV_GPRELHI,14.2418 + BFD_RELOC_FRV_GPRELLO,14.2419 + BFD_RELOC_FRV_GOT12,14.2420 + BFD_RELOC_FRV_GOTHI,14.2421 + BFD_RELOC_FRV_GOTLO,14.2422 + BFD_RELOC_FRV_FUNCDESC,14.2423 + BFD_RELOC_FRV_FUNCDESC_GOT12,14.2424 + BFD_RELOC_FRV_FUNCDESC_GOTHI,14.2425 + BFD_RELOC_FRV_FUNCDESC_GOTLO,14.2426 + BFD_RELOC_FRV_FUNCDESC_VALUE,14.2427 + BFD_RELOC_FRV_FUNCDESC_GOTOFF12,14.2428 + BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,14.2429 + BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,14.2430 + BFD_RELOC_FRV_GOTOFF12,14.2431 + BFD_RELOC_FRV_GOTOFFHI,14.2432 + BFD_RELOC_FRV_GOTOFFLO,14.2433 + BFD_RELOC_FRV_GETTLSOFF,14.2434 + BFD_RELOC_FRV_TLSDESC_VALUE,14.2435 + BFD_RELOC_FRV_GOTTLSDESC12,14.2436 + BFD_RELOC_FRV_GOTTLSDESCHI,14.2437 + BFD_RELOC_FRV_GOTTLSDESCLO,14.2438 + BFD_RELOC_FRV_TLSMOFF12,14.2439 + BFD_RELOC_FRV_TLSMOFFHI,14.2440 + BFD_RELOC_FRV_TLSMOFFLO,14.2441 + BFD_RELOC_FRV_GOTTLSOFF12,14.2442 + BFD_RELOC_FRV_GOTTLSOFFHI,14.2443 + BFD_RELOC_FRV_GOTTLSOFFLO,14.2444 + BFD_RELOC_FRV_TLSOFF,14.2445 + BFD_RELOC_FRV_TLSDESC_RELAX,14.2446 + BFD_RELOC_FRV_GETTLSOFF_RELAX,14.2447 + BFD_RELOC_FRV_TLSOFF_RELAX,14.2448 + BFD_RELOC_FRV_TLSMOFF,14.2449 +14.2450 +14.2451 +/* This is a 24bit GOT-relative reloc for the mn10300. */14.2452 + BFD_RELOC_MN10300_GOTOFF24,14.2453 +14.2454 +/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes14.2455 +in the instruction. */14.2456 + BFD_RELOC_MN10300_GOT32,14.2457 +14.2458 +/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes14.2459 +in the instruction. */14.2460 + BFD_RELOC_MN10300_GOT24,14.2461 +14.2462 +/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes14.2463 +in the instruction. */14.2464 + BFD_RELOC_MN10300_GOT16,14.2465 +14.2466 +/* Copy symbol at runtime. */14.2467 + BFD_RELOC_MN10300_COPY,14.2468 +14.2469 +/* Create GOT entry. */14.2470 + BFD_RELOC_MN10300_GLOB_DAT,14.2471 +14.2472 +/* Create PLT entry. */14.2473 + BFD_RELOC_MN10300_JMP_SLOT,14.2474 +14.2475 +/* Adjust by program base. */14.2476 + BFD_RELOC_MN10300_RELATIVE,14.2477 +14.2478 +14.2479 +/* i386/elf relocations */14.2480 + BFD_RELOC_386_GOT32,14.2481 + BFD_RELOC_386_PLT32,14.2482 + BFD_RELOC_386_COPY,14.2483 + BFD_RELOC_386_GLOB_DAT,14.2484 + BFD_RELOC_386_JUMP_SLOT,14.2485 + BFD_RELOC_386_RELATIVE,14.2486 + BFD_RELOC_386_GOTOFF,14.2487 + BFD_RELOC_386_GOTPC,14.2488 + BFD_RELOC_386_TLS_TPOFF,14.2489 + BFD_RELOC_386_TLS_IE,14.2490 + BFD_RELOC_386_TLS_GOTIE,14.2491 + BFD_RELOC_386_TLS_LE,14.2492 + BFD_RELOC_386_TLS_GD,14.2493 + BFD_RELOC_386_TLS_LDM,14.2494 + BFD_RELOC_386_TLS_LDO_32,14.2495 + BFD_RELOC_386_TLS_IE_32,14.2496 + BFD_RELOC_386_TLS_LE_32,14.2497 + BFD_RELOC_386_TLS_DTPMOD32,14.2498 + BFD_RELOC_386_TLS_DTPOFF32,14.2499 + BFD_RELOC_386_TLS_TPOFF32,14.2500 +14.2501 +/* x86-64/elf relocations */14.2502 + BFD_RELOC_X86_64_GOT32,14.2503 + BFD_RELOC_X86_64_PLT32,14.2504 + BFD_RELOC_X86_64_COPY,14.2505 + BFD_RELOC_X86_64_GLOB_DAT,14.2506 + BFD_RELOC_X86_64_JUMP_SLOT,14.2507 + BFD_RELOC_X86_64_RELATIVE,14.2508 + BFD_RELOC_X86_64_GOTPCREL,14.2509 + BFD_RELOC_X86_64_32S,14.2510 + BFD_RELOC_X86_64_DTPMOD64,14.2511 + BFD_RELOC_X86_64_DTPOFF64,14.2512 + BFD_RELOC_X86_64_TPOFF64,14.2513 + BFD_RELOC_X86_64_TLSGD,14.2514 + BFD_RELOC_X86_64_TLSLD,14.2515 + BFD_RELOC_X86_64_DTPOFF32,14.2516 + BFD_RELOC_X86_64_GOTTPOFF,14.2517 + BFD_RELOC_X86_64_TPOFF32,14.2518 +14.2519 +/* ns32k relocations */14.2520 + BFD_RELOC_NS32K_IMM_8,14.2521 + BFD_RELOC_NS32K_IMM_16,14.2522 + BFD_RELOC_NS32K_IMM_32,14.2523 + BFD_RELOC_NS32K_IMM_8_PCREL,14.2524 + BFD_RELOC_NS32K_IMM_16_PCREL,14.2525 + BFD_RELOC_NS32K_IMM_32_PCREL,14.2526 + BFD_RELOC_NS32K_DISP_8,14.2527 + BFD_RELOC_NS32K_DISP_16,14.2528 + BFD_RELOC_NS32K_DISP_32,14.2529 + BFD_RELOC_NS32K_DISP_8_PCREL,14.2530 + BFD_RELOC_NS32K_DISP_16_PCREL,14.2531 + BFD_RELOC_NS32K_DISP_32_PCREL,14.2532 +14.2533 +/* PDP11 relocations */14.2534 + BFD_RELOC_PDP11_DISP_8_PCREL,14.2535 + BFD_RELOC_PDP11_DISP_6_PCREL,14.2536 +14.2537 +/* Picojava relocs. Not all of these appear in object files. */14.2538 + BFD_RELOC_PJ_CODE_HI16,14.2539 + BFD_RELOC_PJ_CODE_LO16,14.2540 + BFD_RELOC_PJ_CODE_DIR16,14.2541 + BFD_RELOC_PJ_CODE_DIR32,14.2542 + BFD_RELOC_PJ_CODE_REL16,14.2543 + BFD_RELOC_PJ_CODE_REL32,14.2544 +14.2545 +/* Power(rs6000) and PowerPC relocations. */14.2546 + BFD_RELOC_PPC_B26,14.2547 + BFD_RELOC_PPC_BA26,14.2548 + BFD_RELOC_PPC_TOC16,14.2549 + BFD_RELOC_PPC_B16,14.2550 + BFD_RELOC_PPC_B16_BRTAKEN,14.2551 + BFD_RELOC_PPC_B16_BRNTAKEN,14.2552 + BFD_RELOC_PPC_BA16,14.2553 + BFD_RELOC_PPC_BA16_BRTAKEN,14.2554 + BFD_RELOC_PPC_BA16_BRNTAKEN,14.2555 + BFD_RELOC_PPC_COPY,14.2556 + BFD_RELOC_PPC_GLOB_DAT,14.2557 + BFD_RELOC_PPC_JMP_SLOT,14.2558 + BFD_RELOC_PPC_RELATIVE,14.2559 + BFD_RELOC_PPC_LOCAL24PC,14.2560 + BFD_RELOC_PPC_EMB_NADDR32,14.2561 + BFD_RELOC_PPC_EMB_NADDR16,14.2562 + BFD_RELOC_PPC_EMB_NADDR16_LO,14.2563 + BFD_RELOC_PPC_EMB_NADDR16_HI,14.2564 + BFD_RELOC_PPC_EMB_NADDR16_HA,14.2565 + BFD_RELOC_PPC_EMB_SDAI16,14.2566 + BFD_RELOC_PPC_EMB_SDA2I16,14.2567 + BFD_RELOC_PPC_EMB_SDA2REL,14.2568 + BFD_RELOC_PPC_EMB_SDA21,14.2569 + BFD_RELOC_PPC_EMB_MRKREF,14.2570 + BFD_RELOC_PPC_EMB_RELSEC16,14.2571 + BFD_RELOC_PPC_EMB_RELST_LO,14.2572 + BFD_RELOC_PPC_EMB_RELST_HI,14.2573 + BFD_RELOC_PPC_EMB_RELST_HA,14.2574 + BFD_RELOC_PPC_EMB_BIT_FLD,14.2575 + BFD_RELOC_PPC_EMB_RELSDA,14.2576 + BFD_RELOC_PPC64_HIGHER,14.2577 + BFD_RELOC_PPC64_HIGHER_S,14.2578 + BFD_RELOC_PPC64_HIGHEST,14.2579 + BFD_RELOC_PPC64_HIGHEST_S,14.2580 + BFD_RELOC_PPC64_TOC16_LO,14.2581 + BFD_RELOC_PPC64_TOC16_HI,14.2582 + BFD_RELOC_PPC64_TOC16_HA,14.2583 + BFD_RELOC_PPC64_TOC,14.2584 + BFD_RELOC_PPC64_PLTGOT16,14.2585 + BFD_RELOC_PPC64_PLTGOT16_LO,14.2586 + BFD_RELOC_PPC64_PLTGOT16_HI,14.2587 + BFD_RELOC_PPC64_PLTGOT16_HA,14.2588 + BFD_RELOC_PPC64_ADDR16_DS,14.2589 + BFD_RELOC_PPC64_ADDR16_LO_DS,14.2590 + BFD_RELOC_PPC64_GOT16_DS,14.2591 + BFD_RELOC_PPC64_GOT16_LO_DS,14.2592 + BFD_RELOC_PPC64_PLT16_LO_DS,14.2593 + BFD_RELOC_PPC64_SECTOFF_DS,14.2594 + BFD_RELOC_PPC64_SECTOFF_LO_DS,14.2595 + BFD_RELOC_PPC64_TOC16_DS,14.2596 + BFD_RELOC_PPC64_TOC16_LO_DS,14.2597 + BFD_RELOC_PPC64_PLTGOT16_DS,14.2598 + BFD_RELOC_PPC64_PLTGOT16_LO_DS,14.2599 +14.2600 +/* PowerPC and PowerPC64 thread-local storage relocations. */14.2601 + BFD_RELOC_PPC_TLS,14.2602 + BFD_RELOC_PPC_DTPMOD,14.2603 + BFD_RELOC_PPC_TPREL16,14.2604 + BFD_RELOC_PPC_TPREL16_LO,14.2605 + BFD_RELOC_PPC_TPREL16_HI,14.2606 + BFD_RELOC_PPC_TPREL16_HA,14.2607 + BFD_RELOC_PPC_TPREL,14.2608 + BFD_RELOC_PPC_DTPREL16,14.2609 + BFD_RELOC_PPC_DTPREL16_LO,14.2610 + BFD_RELOC_PPC_DTPREL16_HI,14.2611 + BFD_RELOC_PPC_DTPREL16_HA,14.2612 + BFD_RELOC_PPC_DTPREL,14.2613 + BFD_RELOC_PPC_GOT_TLSGD16,14.2614 + BFD_RELOC_PPC_GOT_TLSGD16_LO,14.2615 + BFD_RELOC_PPC_GOT_TLSGD16_HI,14.2616 + BFD_RELOC_PPC_GOT_TLSGD16_HA,14.2617 + BFD_RELOC_PPC_GOT_TLSLD16,14.2618 + BFD_RELOC_PPC_GOT_TLSLD16_LO,14.2619 + BFD_RELOC_PPC_GOT_TLSLD16_HI,14.2620 + BFD_RELOC_PPC_GOT_TLSLD16_HA,14.2621 + BFD_RELOC_PPC_GOT_TPREL16,14.2622 + BFD_RELOC_PPC_GOT_TPREL16_LO,14.2623 + BFD_RELOC_PPC_GOT_TPREL16_HI,14.2624 + BFD_RELOC_PPC_GOT_TPREL16_HA,14.2625 + BFD_RELOC_PPC_GOT_DTPREL16,14.2626 + BFD_RELOC_PPC_GOT_DTPREL16_LO,14.2627 + BFD_RELOC_PPC_GOT_DTPREL16_HI,14.2628 + BFD_RELOC_PPC_GOT_DTPREL16_HA,14.2629 + BFD_RELOC_PPC64_TPREL16_DS,14.2630 + BFD_RELOC_PPC64_TPREL16_LO_DS,14.2631 + BFD_RELOC_PPC64_TPREL16_HIGHER,14.2632 + BFD_RELOC_PPC64_TPREL16_HIGHERA,14.2633 + BFD_RELOC_PPC64_TPREL16_HIGHEST,14.2634 + BFD_RELOC_PPC64_TPREL16_HIGHESTA,14.2635 + BFD_RELOC_PPC64_DTPREL16_DS,14.2636 + BFD_RELOC_PPC64_DTPREL16_LO_DS,14.2637 + BFD_RELOC_PPC64_DTPREL16_HIGHER,14.2638 + BFD_RELOC_PPC64_DTPREL16_HIGHERA,14.2639 + BFD_RELOC_PPC64_DTPREL16_HIGHEST,14.2640 + BFD_RELOC_PPC64_DTPREL16_HIGHESTA,14.2641 +14.2642 +/* IBM 370/390 relocations */14.2643 + BFD_RELOC_I370_D12,14.2644 +14.2645 +/* The type of reloc used to build a constructor table - at the moment14.2646 +probably a 32 bit wide absolute relocation, but the target can choose.14.2647 +It generally does map to one of the other relocation types. */14.2648 + BFD_RELOC_CTOR,14.2649 +14.2650 +/* ARM 26 bit pc-relative branch. The lowest two bits must be zero and are14.2651 +not stored in the instruction. */14.2652 + BFD_RELOC_ARM_PCREL_BRANCH,14.2653 +14.2654 +/* ARM 26 bit pc-relative branch. The lowest bit must be zero and is14.2655 +not stored in the instruction. The 2nd lowest bit comes from a 1 bit14.2656 +field in the instruction. */14.2657 + BFD_RELOC_ARM_PCREL_BLX,14.2658 +14.2659 +/* Thumb 22 bit pc-relative branch. The lowest bit must be zero and is14.2660 +not stored in the instruction. The 2nd lowest bit comes from a 1 bit14.2661 +field in the instruction. */14.2662 + BFD_RELOC_THUMB_PCREL_BLX,14.2663 +14.2664 +/* These relocs are only used within the ARM assembler. They are not14.2665 +(at present) written to any object files. */14.2666 + BFD_RELOC_ARM_IMMEDIATE,14.2667 + BFD_RELOC_ARM_ADRL_IMMEDIATE,14.2668 + BFD_RELOC_ARM_OFFSET_IMM,14.2669 + BFD_RELOC_ARM_SHIFT_IMM,14.2670 + BFD_RELOC_ARM_SMI,14.2671 + BFD_RELOC_ARM_SWI,14.2672 + BFD_RELOC_ARM_MULTI,14.2673 + BFD_RELOC_ARM_CP_OFF_IMM,14.2674 + BFD_RELOC_ARM_CP_OFF_IMM_S2,14.2675 + BFD_RELOC_ARM_ADR_IMM,14.2676 + BFD_RELOC_ARM_LDR_IMM,14.2677 + BFD_RELOC_ARM_LITERAL,14.2678 + BFD_RELOC_ARM_IN_POOL,14.2679 + BFD_RELOC_ARM_OFFSET_IMM8,14.2680 + BFD_RELOC_ARM_HWLITERAL,14.2681 + BFD_RELOC_ARM_THUMB_ADD,14.2682 + BFD_RELOC_ARM_THUMB_IMM,14.2683 + BFD_RELOC_ARM_THUMB_SHIFT,14.2684 + BFD_RELOC_ARM_THUMB_OFFSET,14.2685 + BFD_RELOC_ARM_GOT12,14.2686 + BFD_RELOC_ARM_GOT32,14.2687 + BFD_RELOC_ARM_JUMP_SLOT,14.2688 + BFD_RELOC_ARM_COPY,14.2689 + BFD_RELOC_ARM_GLOB_DAT,14.2690 + BFD_RELOC_ARM_PLT32,14.2691 + BFD_RELOC_ARM_RELATIVE,14.2692 + BFD_RELOC_ARM_GOTOFF,14.2693 + BFD_RELOC_ARM_GOTPC,14.2694 +14.2695 +/* Pc-relative or absolute relocation depending on target. Used for14.2696 +entries in .init_array sections. */14.2697 + BFD_RELOC_ARM_TARGET1,14.2698 +14.2699 +/* Read-only segment base relative address. */14.2700 + BFD_RELOC_ARM_ROSEGREL32,14.2701 +14.2702 +/* Data segment base relative address. */14.2703 + BFD_RELOC_ARM_SBREL32,14.2704 +14.2705 +/* This reloc is used for References to RTTI dta from exception handling14.2706 +tables. The actual definition depends on the target. It may be a14.2707 +pc-relative or some form of GOT-indirect relocation. */14.2708 + BFD_RELOC_ARM_TARGET2,14.2709 +14.2710 +/* 31-bit PC relative address. */14.2711 + BFD_RELOC_ARM_PREL31,14.2712 +14.2713 +/* Renesas / SuperH SH relocs. Not all of these appear in object files. */14.2714 + BFD_RELOC_SH_PCDISP8BY2,14.2715 + BFD_RELOC_SH_PCDISP12BY2,14.2716 + BFD_RELOC_SH_IMM3,14.2717 + BFD_RELOC_SH_IMM3U,14.2718 + BFD_RELOC_SH_DISP12,14.2719 + BFD_RELOC_SH_DISP12BY2,14.2720 + BFD_RELOC_SH_DISP12BY4,14.2721 + BFD_RELOC_SH_DISP12BY8,14.2722 + BFD_RELOC_SH_DISP20,14.2723 + BFD_RELOC_SH_DISP20BY8,14.2724 + BFD_RELOC_SH_IMM4,14.2725 + BFD_RELOC_SH_IMM4BY2,14.2726 + BFD_RELOC_SH_IMM4BY4,14.2727 + BFD_RELOC_SH_IMM8,14.2728 + BFD_RELOC_SH_IMM8BY2,14.2729 + BFD_RELOC_SH_IMM8BY4,14.2730 + BFD_RELOC_SH_PCRELIMM8BY2,14.2731 + BFD_RELOC_SH_PCRELIMM8BY4,14.2732 + BFD_RELOC_SH_SWITCH16,14.2733 + BFD_RELOC_SH_SWITCH32,14.2734 + BFD_RELOC_SH_USES,14.2735 + BFD_RELOC_SH_COUNT,14.2736 + BFD_RELOC_SH_ALIGN,14.2737 + BFD_RELOC_SH_CODE,14.2738 + BFD_RELOC_SH_DATA,14.2739 + BFD_RELOC_SH_LABEL,14.2740 + BFD_RELOC_SH_LOOP_START,14.2741 + BFD_RELOC_SH_LOOP_END,14.2742 + BFD_RELOC_SH_COPY,14.2743 + BFD_RELOC_SH_GLOB_DAT,14.2744 + BFD_RELOC_SH_JMP_SLOT,14.2745 + BFD_RELOC_SH_RELATIVE,14.2746 + BFD_RELOC_SH_GOTPC,14.2747 + BFD_RELOC_SH_GOT_LOW16,14.2748 + BFD_RELOC_SH_GOT_MEDLOW16,14.2749 + BFD_RELOC_SH_GOT_MEDHI16,14.2750 + BFD_RELOC_SH_GOT_HI16,14.2751 + BFD_RELOC_SH_GOTPLT_LOW16,14.2752 + BFD_RELOC_SH_GOTPLT_MEDLOW16,14.2753 + BFD_RELOC_SH_GOTPLT_MEDHI16,14.2754 + BFD_RELOC_SH_GOTPLT_HI16,14.2755 + BFD_RELOC_SH_PLT_LOW16,14.2756 + BFD_RELOC_SH_PLT_MEDLOW16,14.2757 + BFD_RELOC_SH_PLT_MEDHI16,14.2758 + BFD_RELOC_SH_PLT_HI16,14.2759 + BFD_RELOC_SH_GOTOFF_LOW16,14.2760 + BFD_RELOC_SH_GOTOFF_MEDLOW16,14.2761 + BFD_RELOC_SH_GOTOFF_MEDHI16,14.2762 + BFD_RELOC_SH_GOTOFF_HI16,14.2763 + BFD_RELOC_SH_GOTPC_LOW16,14.2764 + BFD_RELOC_SH_GOTPC_MEDLOW16,14.2765 + BFD_RELOC_SH_GOTPC_MEDHI16,14.2766 + BFD_RELOC_SH_GOTPC_HI16,14.2767 + BFD_RELOC_SH_COPY64,14.2768 + BFD_RELOC_SH_GLOB_DAT64,14.2769 + BFD_RELOC_SH_JMP_SLOT64,14.2770 + BFD_RELOC_SH_RELATIVE64,14.2771 + BFD_RELOC_SH_GOT10BY4,14.2772 + BFD_RELOC_SH_GOT10BY8,14.2773 + BFD_RELOC_SH_GOTPLT10BY4,14.2774 + BFD_RELOC_SH_GOTPLT10BY8,14.2775 + BFD_RELOC_SH_GOTPLT32,14.2776 + BFD_RELOC_SH_SHMEDIA_CODE,14.2777 + BFD_RELOC_SH_IMMU5,14.2778 + BFD_RELOC_SH_IMMS6,14.2779 + BFD_RELOC_SH_IMMS6BY32,14.2780 + BFD_RELOC_SH_IMMU6,14.2781 + BFD_RELOC_SH_IMMS10,14.2782 + BFD_RELOC_SH_IMMS10BY2,14.2783 + BFD_RELOC_SH_IMMS10BY4,14.2784 + BFD_RELOC_SH_IMMS10BY8,14.2785 + BFD_RELOC_SH_IMMS16,14.2786 + BFD_RELOC_SH_IMMU16,14.2787 + BFD_RELOC_SH_IMM_LOW16,14.2788 + BFD_RELOC_SH_IMM_LOW16_PCREL,14.2789 + BFD_RELOC_SH_IMM_MEDLOW16,14.2790 + BFD_RELOC_SH_IMM_MEDLOW16_PCREL,14.2791 + BFD_RELOC_SH_IMM_MEDHI16,14.2792 + BFD_RELOC_SH_IMM_MEDHI16_PCREL,14.2793 + BFD_RELOC_SH_IMM_HI16,14.2794 + BFD_RELOC_SH_IMM_HI16_PCREL,14.2795 + BFD_RELOC_SH_PT_16,14.2796 + BFD_RELOC_SH_TLS_GD_32,14.2797 + BFD_RELOC_SH_TLS_LD_32,14.2798 + BFD_RELOC_SH_TLS_LDO_32,14.2799 + BFD_RELOC_SH_TLS_IE_32,14.2800 + BFD_RELOC_SH_TLS_LE_32,14.2801 + BFD_RELOC_SH_TLS_DTPMOD32,14.2802 + BFD_RELOC_SH_TLS_DTPOFF32,14.2803 + BFD_RELOC_SH_TLS_TPOFF32,14.2804 +14.2805 +/* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must14.2806 +be zero and is not stored in the instruction. */14.2807 + BFD_RELOC_THUMB_PCREL_BRANCH9,14.2808 + BFD_RELOC_THUMB_PCREL_BRANCH12,14.2809 + BFD_RELOC_THUMB_PCREL_BRANCH23,14.2810 +14.2811 +/* ARC Cores relocs.14.2812 +ARC 22 bit pc-relative branch. The lowest two bits must be zero and are14.2813 +not stored in the instruction. The high 20 bits are installed in bits 2614.2814 +through 7 of the instruction. */14.2815 + BFD_RELOC_ARC_B22_PCREL,14.2816 +14.2817 +/* ARC 26 bit absolute branch. The lowest two bits must be zero and are not14.2818 +stored in the instruction. The high 24 bits are installed in bits 2314.2819 +through 0. */14.2820 + BFD_RELOC_ARC_B26,14.2821 +14.2822 +/* Mitsubishi D10V relocs.14.2823 +This is a 10-bit reloc with the right 2 bits14.2824 +assumed to be 0. */14.2825 + BFD_RELOC_D10V_10_PCREL_R,14.2826 +14.2827 +/* Mitsubishi D10V relocs.14.2828 +This is a 10-bit reloc with the right 2 bits14.2829 +assumed to be 0. This is the same as the previous reloc14.2830 +except it is in the left container, i.e.,14.2831 +shifted left 15 bits. */14.2832 + BFD_RELOC_D10V_10_PCREL_L,14.2833 +14.2834 +/* This is an 18-bit reloc with the right 2 bits14.2835 +assumed to be 0. */14.2836 + BFD_RELOC_D10V_18,14.2837 +14.2838 +/* This is an 18-bit reloc with the right 2 bits14.2839 +assumed to be 0. */14.2840 + BFD_RELOC_D10V_18_PCREL,14.2841 +14.2842 +/* Mitsubishi D30V relocs.14.2843 +This is a 6-bit absolute reloc. */14.2844 + BFD_RELOC_D30V_6,14.2845 +14.2846 +/* This is a 6-bit pc-relative reloc with14.2847 +the right 3 bits assumed to be 0. */14.2848 + BFD_RELOC_D30V_9_PCREL,14.2849 +14.2850 +/* This is a 6-bit pc-relative reloc with14.2851 +the right 3 bits assumed to be 0. Same14.2852 +as the previous reloc but on the right side14.2853 +of the container. */14.2854 + BFD_RELOC_D30V_9_PCREL_R,14.2855 +14.2856 +/* This is a 12-bit absolute reloc with the14.2857 +right 3 bitsassumed to be 0. */14.2858 + BFD_RELOC_D30V_15,14.2859 +14.2860 +/* This is a 12-bit pc-relative reloc with14.2861 +the right 3 bits assumed to be 0. */14.2862 + BFD_RELOC_D30V_15_PCREL,14.2863 +14.2864 +/* This is a 12-bit pc-relative reloc with14.2865 +the right 3 bits assumed to be 0. Same14.2866 +as the previous reloc but on the right side14.2867 +of the container. */14.2868 + BFD_RELOC_D30V_15_PCREL_R,14.2869 +14.2870 +/* This is an 18-bit absolute reloc with14.2871 +the right 3 bits assumed to be 0. */14.2872 + BFD_RELOC_D30V_21,14.2873 +14.2874 +/* This is an 18-bit pc-relative reloc with14.2875 +the right 3 bits assumed to be 0. */14.2876 + BFD_RELOC_D30V_21_PCREL,14.2877 +14.2878 +/* This is an 18-bit pc-relative reloc with14.2879 +the right 3 bits assumed to be 0. Same14.2880 +as the previous reloc but on the right side14.2881 +of the container. */14.2882 + BFD_RELOC_D30V_21_PCREL_R,14.2883 +14.2884 +/* This is a 32-bit absolute reloc. */14.2885 + BFD_RELOC_D30V_32,14.2886 +14.2887 +/* This is a 32-bit pc-relative reloc. */14.2888 + BFD_RELOC_D30V_32_PCREL,14.2889 +14.2890 +/* DLX relocs */14.2891 + BFD_RELOC_DLX_HI16_S,14.2892 +14.2893 +/* DLX relocs */14.2894 + BFD_RELOC_DLX_LO16,14.2895 +14.2896 +/* DLX relocs */14.2897 + BFD_RELOC_DLX_JMP26,14.2898 +14.2899 +/* Renesas M32R (formerly Mitsubishi M32R) relocs.14.2900 +This is a 24 bit absolute address. */14.2901 + BFD_RELOC_M32R_24,14.2902 +14.2903 +/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0. */14.2904 + BFD_RELOC_M32R_10_PCREL,14.2905 +14.2906 +/* This is an 18-bit reloc with the right 2 bits assumed to be 0. */14.2907 + BFD_RELOC_M32R_18_PCREL,14.2908 +14.2909 +/* This is a 26-bit reloc with the right 2 bits assumed to be 0. */14.2910 + BFD_RELOC_M32R_26_PCREL,14.2911 +14.2912 +/* This is a 16-bit reloc containing the high 16 bits of an address14.2913 +used when the lower 16 bits are treated as unsigned. */14.2914 + BFD_RELOC_M32R_HI16_ULO,14.2915 +14.2916 +/* This is a 16-bit reloc containing the high 16 bits of an address14.2917 +used when the lower 16 bits are treated as signed. */14.2918 + BFD_RELOC_M32R_HI16_SLO,14.2919 +14.2920 +/* This is a 16-bit reloc containing the lower 16 bits of an address. */14.2921 + BFD_RELOC_M32R_LO16,14.2922 +14.2923 +/* This is a 16-bit reloc containing the small data area offset for use in14.2924 +add3, load, and store instructions. */14.2925 + BFD_RELOC_M32R_SDA16,14.2926 +14.2927 +/* For PIC. */14.2928 + BFD_RELOC_M32R_GOT24,14.2929 + BFD_RELOC_M32R_26_PLTREL,14.2930 + BFD_RELOC_M32R_COPY,14.2931 + BFD_RELOC_M32R_GLOB_DAT,14.2932 + BFD_RELOC_M32R_JMP_SLOT,14.2933 + BFD_RELOC_M32R_RELATIVE,14.2934 + BFD_RELOC_M32R_GOTOFF,14.2935 + BFD_RELOC_M32R_GOTOFF_HI_ULO,14.2936 + BFD_RELOC_M32R_GOTOFF_HI_SLO,14.2937 + BFD_RELOC_M32R_GOTOFF_LO,14.2938 + BFD_RELOC_M32R_GOTPC24,14.2939 + BFD_RELOC_M32R_GOT16_HI_ULO,14.2940 + BFD_RELOC_M32R_GOT16_HI_SLO,14.2941 + BFD_RELOC_M32R_GOT16_LO,14.2942 + BFD_RELOC_M32R_GOTPC_HI_ULO,14.2943 + BFD_RELOC_M32R_GOTPC_HI_SLO,14.2944 + BFD_RELOC_M32R_GOTPC_LO,14.2945 +14.2946 +/* This is a 9-bit reloc */14.2947 + BFD_RELOC_V850_9_PCREL,14.2948 +14.2949 +/* This is a 22-bit reloc */14.2950 + BFD_RELOC_V850_22_PCREL,14.2951 +14.2952 +/* This is a 16 bit offset from the short data area pointer. */14.2953 + BFD_RELOC_V850_SDA_16_16_OFFSET,14.2954 +14.2955 +/* This is a 16 bit offset (of which only 15 bits are used) from the14.2956 +short data area pointer. */14.2957 + BFD_RELOC_V850_SDA_15_16_OFFSET,14.2958 +14.2959 +/* This is a 16 bit offset from the zero data area pointer. */14.2960 + BFD_RELOC_V850_ZDA_16_16_OFFSET,14.2961 +14.2962 +/* This is a 16 bit offset (of which only 15 bits are used) from the14.2963 +zero data area pointer. */14.2964 + BFD_RELOC_V850_ZDA_15_16_OFFSET,14.2965 +14.2966 +/* This is an 8 bit offset (of which only 6 bits are used) from the14.2967 +tiny data area pointer. */14.2968 + BFD_RELOC_V850_TDA_6_8_OFFSET,14.2969 +14.2970 +/* This is an 8bit offset (of which only 7 bits are used) from the tiny14.2971 +data area pointer. */14.2972 + BFD_RELOC_V850_TDA_7_8_OFFSET,14.2973 +14.2974 +/* This is a 7 bit offset from the tiny data area pointer. */14.2975 + BFD_RELOC_V850_TDA_7_7_OFFSET,14.2976 +14.2977 +/* This is a 16 bit offset from the tiny data area pointer. */14.2978 + BFD_RELOC_V850_TDA_16_16_OFFSET,14.2979 +14.2980 +/* This is a 5 bit offset (of which only 4 bits are used) from the tiny14.2981 +data area pointer. */14.2982 + BFD_RELOC_V850_TDA_4_5_OFFSET,14.2983 +14.2984 +/* This is a 4 bit offset from the tiny data area pointer. */14.2985 + BFD_RELOC_V850_TDA_4_4_OFFSET,14.2986 +14.2987 +/* This is a 16 bit offset from the short data area pointer, with the14.2988 +bits placed non-contiguously in the instruction. */14.2989 + BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,14.2990 +14.2991 +/* This is a 16 bit offset from the zero data area pointer, with the14.2992 +bits placed non-contiguously in the instruction. */14.2993 + BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,14.2994 +14.2995 +/* This is a 6 bit offset from the call table base pointer. */14.2996 + BFD_RELOC_V850_CALLT_6_7_OFFSET,14.2997 +14.2998 +/* This is a 16 bit offset from the call table base pointer. */14.2999 + BFD_RELOC_V850_CALLT_16_16_OFFSET,14.3000 +14.3001 +/* Used for relaxing indirect function calls. */14.3002 + BFD_RELOC_V850_LONGCALL,14.3003 +14.3004 +/* Used for relaxing indirect jumps. */14.3005 + BFD_RELOC_V850_LONGJUMP,14.3006 +14.3007 +/* Used to maintain alignment whilst relaxing. */14.3008 + BFD_RELOC_V850_ALIGN,14.3009 +14.3010 +/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu14.3011 +instructions. */14.3012 + BFD_RELOC_V850_LO16_SPLIT_OFFSET,14.3013 +14.3014 +/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the14.3015 +instruction. */14.3016 + BFD_RELOC_MN10300_32_PCREL,14.3017 +14.3018 +/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the14.3019 +instruction. */14.3020 + BFD_RELOC_MN10300_16_PCREL,14.3021 +14.3022 +/* This is a 8bit DP reloc for the tms320c30, where the most14.3023 +significant 8 bits of a 24 bit word are placed into the least14.3024 +significant 8 bits of the opcode. */14.3025 + BFD_RELOC_TIC30_LDP,14.3026 +14.3027 +/* This is a 7bit reloc for the tms320c54x, where the least14.3028 +significant 7 bits of a 16 bit word are placed into the least14.3029 +significant 7 bits of the opcode. */14.3030 + BFD_RELOC_TIC54X_PARTLS7,14.3031 +14.3032 +/* This is a 9bit DP reloc for the tms320c54x, where the most14.3033 +significant 9 bits of a 16 bit word are placed into the least14.3034 +significant 9 bits of the opcode. */14.3035 + BFD_RELOC_TIC54X_PARTMS9,14.3036 +14.3037 +/* This is an extended address 23-bit reloc for the tms320c54x. */14.3038 + BFD_RELOC_TIC54X_23,14.3039 +14.3040 +/* This is a 16-bit reloc for the tms320c54x, where the least14.3041 +significant 16 bits of a 23-bit extended address are placed into14.3042 +the opcode. */14.3043 + BFD_RELOC_TIC54X_16_OF_23,14.3044 +14.3045 +/* This is a reloc for the tms320c54x, where the most14.3046 +significant 7 bits of a 23-bit extended address are placed into14.3047 +the opcode. */14.3048 + BFD_RELOC_TIC54X_MS7_OF_23,14.3049 +14.3050 +/* This is a 48 bit reloc for the FR30 that stores 32 bits. */14.3051 + BFD_RELOC_FR30_48,14.3052 +14.3053 +/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into14.3054 +two sections. */14.3055 + BFD_RELOC_FR30_20,14.3056 +14.3057 +/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in14.3058 +4 bits. */14.3059 + BFD_RELOC_FR30_6_IN_4,14.3060 +14.3061 +/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset14.3062 +into 8 bits. */14.3063 + BFD_RELOC_FR30_8_IN_8,14.3064 +14.3065 +/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset14.3066 +into 8 bits. */14.3067 + BFD_RELOC_FR30_9_IN_8,14.3068 +14.3069 +/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset14.3070 +into 8 bits. */14.3071 + BFD_RELOC_FR30_10_IN_8,14.3072 +14.3073 +/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative14.3074 +short offset into 8 bits. */14.3075 + BFD_RELOC_FR30_9_PCREL,14.3076 +14.3077 +/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative14.3078 +short offset into 11 bits. */14.3079 + BFD_RELOC_FR30_12_PCREL,14.3080 +14.3081 +/* Motorola Mcore relocations. */14.3082 + BFD_RELOC_MCORE_PCREL_IMM8BY4,14.3083 + BFD_RELOC_MCORE_PCREL_IMM11BY2,14.3084 + BFD_RELOC_MCORE_PCREL_IMM4BY2,14.3085 + BFD_RELOC_MCORE_PCREL_32,14.3086 + BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,14.3087 + BFD_RELOC_MCORE_RVA,14.3088 +14.3089 +/* These are relocations for the GETA instruction. */14.3090 + BFD_RELOC_MMIX_GETA,14.3091 + BFD_RELOC_MMIX_GETA_1,14.3092 + BFD_RELOC_MMIX_GETA_2,14.3093 + BFD_RELOC_MMIX_GETA_3,14.3094 +14.3095 +/* These are relocations for a conditional branch instruction. */14.3096 + BFD_RELOC_MMIX_CBRANCH,14.3097 + BFD_RELOC_MMIX_CBRANCH_J,14.3098 + BFD_RELOC_MMIX_CBRANCH_1,14.3099 + BFD_RELOC_MMIX_CBRANCH_2,14.3100 + BFD_RELOC_MMIX_CBRANCH_3,14.3101 +14.3102 +/* These are relocations for the PUSHJ instruction. */14.3103 + BFD_RELOC_MMIX_PUSHJ,14.3104 + BFD_RELOC_MMIX_PUSHJ_1,14.3105 + BFD_RELOC_MMIX_PUSHJ_2,14.3106 + BFD_RELOC_MMIX_PUSHJ_3,14.3107 + BFD_RELOC_MMIX_PUSHJ_STUBBABLE,14.3108 +14.3109 +/* These are relocations for the JMP instruction. */14.3110 + BFD_RELOC_MMIX_JMP,14.3111 + BFD_RELOC_MMIX_JMP_1,14.3112 + BFD_RELOC_MMIX_JMP_2,14.3113 + BFD_RELOC_MMIX_JMP_3,14.3114 +14.3115 +/* This is a relocation for a relative address as in a GETA instruction or14.3116 +a branch. */14.3117 + BFD_RELOC_MMIX_ADDR19,14.3118 +14.3119 +/* This is a relocation for a relative address as in a JMP instruction. */14.3120 + BFD_RELOC_MMIX_ADDR27,14.3121 +14.3122 +/* This is a relocation for an instruction field that may be a general14.3123 +register or a value 0..255. */14.3124 + BFD_RELOC_MMIX_REG_OR_BYTE,14.3125 +14.3126 +/* This is a relocation for an instruction field that may be a general14.3127 +register. */14.3128 + BFD_RELOC_MMIX_REG,14.3129 +14.3130 +/* This is a relocation for two instruction fields holding a register and14.3131 +an offset, the equivalent of the relocation. */14.3132 + BFD_RELOC_MMIX_BASE_PLUS_OFFSET,14.3133 +14.3134 +/* This relocation is an assertion that the expression is not allocated as14.3135 +a global register. It does not modify contents. */14.3136 + BFD_RELOC_MMIX_LOCAL,14.3137 +14.3138 +/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative14.3139 +short offset into 7 bits. */14.3140 + BFD_RELOC_AVR_7_PCREL,14.3141 +14.3142 +/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative14.3143 +short offset into 12 bits. */14.3144 + BFD_RELOC_AVR_13_PCREL,14.3145 +14.3146 +/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually14.3147 +program memory address) into 16 bits. */14.3148 + BFD_RELOC_AVR_16_PM,14.3149 +14.3150 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually14.3151 +data memory address) into 8 bit immediate value of LDI insn. */14.3152 + BFD_RELOC_AVR_LO8_LDI,14.3153 +14.3154 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit14.3155 +of data memory address) into 8 bit immediate value of LDI insn. */14.3156 + BFD_RELOC_AVR_HI8_LDI,14.3157 +14.3158 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit14.3159 +of program memory address) into 8 bit immediate value of LDI insn. */14.3160 + BFD_RELOC_AVR_HH8_LDI,14.3161 +14.3162 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value14.3163 +(usually data memory address) into 8 bit immediate value of SUBI insn. */14.3164 + BFD_RELOC_AVR_LO8_LDI_NEG,14.3165 +14.3166 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value14.3167 +(high 8 bit of data memory address) into 8 bit immediate value of14.3168 +SUBI insn. */14.3169 + BFD_RELOC_AVR_HI8_LDI_NEG,14.3170 +14.3171 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value14.3172 +(most high 8 bit of program memory address) into 8 bit immediate value14.3173 +of LDI or SUBI insn. */14.3174 + BFD_RELOC_AVR_HH8_LDI_NEG,14.3175 +14.3176 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually14.3177 +command address) into 8 bit immediate value of LDI insn. */14.3178 + BFD_RELOC_AVR_LO8_LDI_PM,14.3179 +14.3180 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit14.3181 +of command address) into 8 bit immediate value of LDI insn. */14.3182 + BFD_RELOC_AVR_HI8_LDI_PM,14.3183 +14.3184 +/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit14.3185 +of command address) into 8 bit immediate value of LDI insn. */14.3186 + BFD_RELOC_AVR_HH8_LDI_PM,14.3187 +14.3188 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value14.3189 +(usually command address) into 8 bit immediate value of SUBI insn. */14.3190 + BFD_RELOC_AVR_LO8_LDI_PM_NEG,14.3191 +14.3192 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value14.3193 +(high 8 bit of 16 bit command address) into 8 bit immediate value14.3194 +of SUBI insn. */14.3195 + BFD_RELOC_AVR_HI8_LDI_PM_NEG,14.3196 +14.3197 +/* This is a 16 bit reloc for the AVR that stores negated 8 bit value14.3198 +(high 6 bit of 22 bit command address) into 8 bit immediate14.3199 +value of SUBI insn. */14.3200 + BFD_RELOC_AVR_HH8_LDI_PM_NEG,14.3201 +14.3202 +/* This is a 32 bit reloc for the AVR that stores 23 bit value14.3203 +into 22 bits. */14.3204 + BFD_RELOC_AVR_CALL,14.3205 +14.3206 +/* This is a 16 bit reloc for the AVR that stores all needed bits14.3207 +for absolute addressing with ldi with overflow check to linktime */14.3208 + BFD_RELOC_AVR_LDI,14.3209 +14.3210 +/* This is a 6 bit reloc for the AVR that stores offset for ldd/std14.3211 +instructions */14.3212 + BFD_RELOC_AVR_6,14.3213 +14.3214 +/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw14.3215 +instructions */14.3216 + BFD_RELOC_AVR_6_ADIW,14.3217 +14.3218 +/* Direct 12 bit. */14.3219 + BFD_RELOC_390_12,14.3220 +14.3221 +/* 12 bit GOT offset. */14.3222 + BFD_RELOC_390_GOT12,14.3223 +14.3224 +/* 32 bit PC relative PLT address. */14.3225 + BFD_RELOC_390_PLT32,14.3226 +14.3227 +/* Copy symbol at runtime. */14.3228 + BFD_RELOC_390_COPY,14.3229 +14.3230 +/* Create GOT entry. */14.3231 + BFD_RELOC_390_GLOB_DAT,14.3232 +14.3233 +/* Create PLT entry. */14.3234 + BFD_RELOC_390_JMP_SLOT,14.3235 +14.3236 +/* Adjust by program base. */14.3237 + BFD_RELOC_390_RELATIVE,14.3238 +14.3239 +/* 32 bit PC relative offset to GOT. */14.3240 + BFD_RELOC_390_GOTPC,14.3241 +14.3242 +/* 16 bit GOT offset. */14.3243 + BFD_RELOC_390_GOT16,14.3244 +14.3245 +/* PC relative 16 bit shifted by 1. */14.3246 + BFD_RELOC_390_PC16DBL,14.3247 +14.3248 +/* 16 bit PC rel. PLT shifted by 1. */14.3249 + BFD_RELOC_390_PLT16DBL,14.3250 +14.3251 +/* PC relative 32 bit shifted by 1. */14.3252 + BFD_RELOC_390_PC32DBL,14.3253 +14.3254 +/* 32 bit PC rel. PLT shifted by 1. */14.3255 + BFD_RELOC_390_PLT32DBL,14.3256 +14.3257 +/* 32 bit PC rel. GOT shifted by 1. */14.3258 + BFD_RELOC_390_GOTPCDBL,14.3259 +14.3260 +/* 64 bit GOT offset. */14.3261 + BFD_RELOC_390_GOT64,14.3262 +14.3263 +/* 64 bit PC relative PLT address. */14.3264 + BFD_RELOC_390_PLT64,14.3265 +14.3266 +/* 32 bit rel. offset to GOT entry. */14.3267 + BFD_RELOC_390_GOTENT,14.3268 +14.3269 +/* 64 bit offset to GOT. */14.3270 + BFD_RELOC_390_GOTOFF64,14.3271 +14.3272 +/* 12-bit offset to symbol-entry within GOT, with PLT handling. */14.3273 + BFD_RELOC_390_GOTPLT12,14.3274 +14.3275 +/* 16-bit offset to symbol-entry within GOT, with PLT handling. */14.3276 + BFD_RELOC_390_GOTPLT16,14.3277 +14.3278 +/* 32-bit offset to symbol-entry within GOT, with PLT handling. */14.3279 + BFD_RELOC_390_GOTPLT32,14.3280 +14.3281 +/* 64-bit offset to symbol-entry within GOT, with PLT handling. */14.3282 + BFD_RELOC_390_GOTPLT64,14.3283 +14.3284 +/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */14.3285 + BFD_RELOC_390_GOTPLTENT,14.3286 +14.3287 +/* 16-bit rel. offset from the GOT to a PLT entry. */14.3288 + BFD_RELOC_390_PLTOFF16,14.3289 +14.3290 +/* 32-bit rel. offset from the GOT to a PLT entry. */14.3291 + BFD_RELOC_390_PLTOFF32,14.3292 +14.3293 +/* 64-bit rel. offset from the GOT to a PLT entry. */14.3294 + BFD_RELOC_390_PLTOFF64,14.3295 +14.3296 +/* s390 tls relocations. */14.3297 + BFD_RELOC_390_TLS_LOAD,14.3298 + BFD_RELOC_390_TLS_GDCALL,14.3299 + BFD_RELOC_390_TLS_LDCALL,14.3300 + BFD_RELOC_390_TLS_GD32,14.3301 + BFD_RELOC_390_TLS_GD64,14.3302 + BFD_RELOC_390_TLS_GOTIE12,14.3303 + BFD_RELOC_390_TLS_GOTIE32,14.3304 + BFD_RELOC_390_TLS_GOTIE64,14.3305 + BFD_RELOC_390_TLS_LDM32,14.3306 + BFD_RELOC_390_TLS_LDM64,14.3307 + BFD_RELOC_390_TLS_IE32,14.3308 + BFD_RELOC_390_TLS_IE64,14.3309 + BFD_RELOC_390_TLS_IEENT,14.3310 + BFD_RELOC_390_TLS_LE32,14.3311 + BFD_RELOC_390_TLS_LE64,14.3312 + BFD_RELOC_390_TLS_LDO32,14.3313 + BFD_RELOC_390_TLS_LDO64,14.3314 + BFD_RELOC_390_TLS_DTPMOD,14.3315 + BFD_RELOC_390_TLS_DTPOFF,14.3316 + BFD_RELOC_390_TLS_TPOFF,14.3317 +14.3318 +/* Long displacement extension. */14.3319 + BFD_RELOC_390_20,14.3320 + BFD_RELOC_390_GOT20,14.3321 + BFD_RELOC_390_GOTPLT20,14.3322 + BFD_RELOC_390_TLS_GOTIE20,14.3323 +14.3324 +/* Scenix IP2K - 9-bit register number / data address */14.3325 + BFD_RELOC_IP2K_FR9,14.3326 +14.3327 +/* Scenix IP2K - 4-bit register/data bank number */14.3328 + BFD_RELOC_IP2K_BANK,14.3329 +14.3330 +/* Scenix IP2K - low 13 bits of instruction word address */14.3331 + BFD_RELOC_IP2K_ADDR16CJP,14.3332 +14.3333 +/* Scenix IP2K - high 3 bits of instruction word address */14.3334 + BFD_RELOC_IP2K_PAGE3,14.3335 +14.3336 +/* Scenix IP2K - ext/low/high 8 bits of data address */14.3337 + BFD_RELOC_IP2K_LO8DATA,14.3338 + BFD_RELOC_IP2K_HI8DATA,14.3339 + BFD_RELOC_IP2K_EX8DATA,14.3340 +14.3341 +/* Scenix IP2K - low/high 8 bits of instruction word address */14.3342 + BFD_RELOC_IP2K_LO8INSN,14.3343 + BFD_RELOC_IP2K_HI8INSN,14.3344 +14.3345 +/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */14.3346 + BFD_RELOC_IP2K_PC_SKIP,14.3347 +14.3348 +/* Scenix IP2K - 16 bit word address in text section. */14.3349 + BFD_RELOC_IP2K_TEXT,14.3350 +14.3351 +/* Scenix IP2K - 7-bit sp or dp offset */14.3352 + BFD_RELOC_IP2K_FR_OFFSET,14.3353 +14.3354 +/* Scenix VPE4K coprocessor - data/insn-space addressing */14.3355 + BFD_RELOC_VPE4KMATH_DATA,14.3356 + BFD_RELOC_VPE4KMATH_INSN,14.3357 +14.3358 +/* These two relocations are used by the linker to determine which of14.3359 +the entries in a C++ virtual function table are actually used. When14.3360 +the --gc-sections option is given, the linker will zero out the entries14.3361 +that are not used, so that the code for those functions need not be14.3362 +included in the output.14.3363 +14.3364 +VTABLE_INHERIT is a zero-space relocation used to describe to the14.3365 +linker the inheritance tree of a C++ virtual function table. The14.3366 +relocation's symbol should be the parent class' vtable, and the14.3367 +relocation should be located at the child vtable.14.3368 +14.3369 +VTABLE_ENTRY is a zero-space relocation that describes the use of a14.3370 +virtual function table entry. The reloc's symbol should refer to the14.3371 +table of the class mentioned in the code. Off of that base, an offset14.3372 +describes the entry that is being used. For Rela hosts, this offset14.3373 +is stored in the reloc's addend. For Rel hosts, we are forced to put14.3374 +this offset in the reloc's section offset. */14.3375 + BFD_RELOC_VTABLE_INHERIT,14.3376 + BFD_RELOC_VTABLE_ENTRY,14.3377 +14.3378 +/* Intel IA64 Relocations. */14.3379 + BFD_RELOC_IA64_IMM14,14.3380 + BFD_RELOC_IA64_IMM22,14.3381 + BFD_RELOC_IA64_IMM64,14.3382 + BFD_RELOC_IA64_DIR32MSB,14.3383 + BFD_RELOC_IA64_DIR32LSB,14.3384 + BFD_RELOC_IA64_DIR64MSB,14.3385 + BFD_RELOC_IA64_DIR64LSB,14.3386 + BFD_RELOC_IA64_GPREL22,14.3387 + BFD_RELOC_IA64_GPREL64I,14.3388 + BFD_RELOC_IA64_GPREL32MSB,14.3389 + BFD_RELOC_IA64_GPREL32LSB,14.3390 + BFD_RELOC_IA64_GPREL64MSB,14.3391 + BFD_RELOC_IA64_GPREL64LSB,14.3392 + BFD_RELOC_IA64_LTOFF22,14.3393 + BFD_RELOC_IA64_LTOFF64I,14.3394 + BFD_RELOC_IA64_PLTOFF22,14.3395 + BFD_RELOC_IA64_PLTOFF64I,14.3396 + BFD_RELOC_IA64_PLTOFF64MSB,14.3397 + BFD_RELOC_IA64_PLTOFF64LSB,14.3398 + BFD_RELOC_IA64_FPTR64I,14.3399 + BFD_RELOC_IA64_FPTR32MSB,14.3400 + BFD_RELOC_IA64_FPTR32LSB,14.3401 + BFD_RELOC_IA64_FPTR64MSB,14.3402 + BFD_RELOC_IA64_FPTR64LSB,14.3403 + BFD_RELOC_IA64_PCREL21B,14.3404 + BFD_RELOC_IA64_PCREL21BI,14.3405 + BFD_RELOC_IA64_PCREL21M,14.3406 + BFD_RELOC_IA64_PCREL21F,14.3407 + BFD_RELOC_IA64_PCREL22,14.3408 + BFD_RELOC_IA64_PCREL60B,14.3409 + BFD_RELOC_IA64_PCREL64I,14.3410 + BFD_RELOC_IA64_PCREL32MSB,14.3411 + BFD_RELOC_IA64_PCREL32LSB,14.3412 + BFD_RELOC_IA64_PCREL64MSB,14.3413 + BFD_RELOC_IA64_PCREL64LSB,14.3414 + BFD_RELOC_IA64_LTOFF_FPTR22,14.3415 + BFD_RELOC_IA64_LTOFF_FPTR64I,14.3416 + BFD_RELOC_IA64_LTOFF_FPTR32MSB,14.3417 + BFD_RELOC_IA64_LTOFF_FPTR32LSB,14.3418 + BFD_RELOC_IA64_LTOFF_FPTR64MSB,14.3419 + BFD_RELOC_IA64_LTOFF_FPTR64LSB,14.3420 + BFD_RELOC_IA64_SEGREL32MSB,14.3421 + BFD_RELOC_IA64_SEGREL32LSB,14.3422 + BFD_RELOC_IA64_SEGREL64MSB,14.3423 + BFD_RELOC_IA64_SEGREL64LSB,14.3424 + BFD_RELOC_IA64_SECREL32MSB,14.3425 + BFD_RELOC_IA64_SECREL32LSB,14.3426 + BFD_RELOC_IA64_SECREL64MSB,14.3427 + BFD_RELOC_IA64_SECREL64LSB,14.3428 + BFD_RELOC_IA64_REL32MSB,14.3429 + BFD_RELOC_IA64_REL32LSB,14.3430 + BFD_RELOC_IA64_REL64MSB,14.3431 + BFD_RELOC_IA64_REL64LSB,14.3432 + BFD_RELOC_IA64_LTV32MSB,14.3433 + BFD_RELOC_IA64_LTV32LSB,14.3434 + BFD_RELOC_IA64_LTV64MSB,14.3435 + BFD_RELOC_IA64_LTV64LSB,14.3436 + BFD_RELOC_IA64_IPLTMSB,14.3437 + BFD_RELOC_IA64_IPLTLSB,14.3438 + BFD_RELOC_IA64_COPY,14.3439 + BFD_RELOC_IA64_LTOFF22X,14.3440 + BFD_RELOC_IA64_LDXMOV,14.3441 + BFD_RELOC_IA64_TPREL14,14.3442 + BFD_RELOC_IA64_TPREL22,14.3443 + BFD_RELOC_IA64_TPREL64I,14.3444 + BFD_RELOC_IA64_TPREL64MSB,14.3445 + BFD_RELOC_IA64_TPREL64LSB,14.3446 + BFD_RELOC_IA64_LTOFF_TPREL22,14.3447 + BFD_RELOC_IA64_DTPMOD64MSB,14.3448 + BFD_RELOC_IA64_DTPMOD64LSB,14.3449 + BFD_RELOC_IA64_LTOFF_DTPMOD22,14.3450 + BFD_RELOC_IA64_DTPREL14,14.3451 + BFD_RELOC_IA64_DTPREL22,14.3452 + BFD_RELOC_IA64_DTPREL64I,14.3453 + BFD_RELOC_IA64_DTPREL32MSB,14.3454 + BFD_RELOC_IA64_DTPREL32LSB,14.3455 + BFD_RELOC_IA64_DTPREL64MSB,14.3456 + BFD_RELOC_IA64_DTPREL64LSB,14.3457 + BFD_RELOC_IA64_LTOFF_DTPREL22,14.3458 +14.3459 +/* Motorola 68HC11 reloc.14.3460 +This is the 8 bit high part of an absolute address. */14.3461 + BFD_RELOC_M68HC11_HI8,14.3462 +14.3463 +/* Motorola 68HC11 reloc.14.3464 +This is the 8 bit low part of an absolute address. */14.3465 + BFD_RELOC_M68HC11_LO8,14.3466 +14.3467 +/* Motorola 68HC11 reloc.14.3468 +This is the 3 bit of a value. */14.3469 + BFD_RELOC_M68HC11_3B,14.3470 +14.3471 +/* Motorola 68HC11 reloc.14.3472 +This reloc marks the beginning of a jump/call instruction.14.3473 +It is used for linker relaxation to correctly identify beginning14.3474 +of instruction and change some branches to use PC-relative14.3475 +addressing mode. */14.3476 + BFD_RELOC_M68HC11_RL_JUMP,14.3477 +14.3478 +/* Motorola 68HC11 reloc.14.3479 +This reloc marks a group of several instructions that gcc generates14.3480 +and for which the linker relaxation pass can modify and/or remove14.3481 +some of them. */14.3482 + BFD_RELOC_M68HC11_RL_GROUP,14.3483 +14.3484 +/* Motorola 68HC11 reloc.14.3485 +This is the 16-bit lower part of an address. It is used for 'call'14.3486 +instruction to specify the symbol address without any special14.3487 +transformation (due to memory bank window). */14.3488 + BFD_RELOC_M68HC11_LO16,14.3489 +14.3490 +/* Motorola 68HC11 reloc.14.3491 +This is a 8-bit reloc that specifies the page number of an address.14.3492 +It is used by 'call' instruction to specify the page number of14.3493 +the symbol. */14.3494 + BFD_RELOC_M68HC11_PAGE,14.3495 +14.3496 +/* Motorola 68HC11 reloc.14.3497 +This is a 24-bit reloc that represents the address with a 16-bit14.3498 +value and a 8-bit page number. The symbol address is transformed14.3499 +to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */14.3500 + BFD_RELOC_M68HC11_24,14.3501 +14.3502 +/* Motorola 68HC12 reloc.14.3503 +This is the 5 bits of a value. */14.3504 + BFD_RELOC_M68HC12_5B,14.3505 +14.3506 +/* NS CR16C Relocations. */14.3507 + BFD_RELOC_16C_NUM08,14.3508 + BFD_RELOC_16C_NUM08_C,14.3509 + BFD_RELOC_16C_NUM16,14.3510 + BFD_RELOC_16C_NUM16_C,14.3511 + BFD_RELOC_16C_NUM32,14.3512 + BFD_RELOC_16C_NUM32_C,14.3513 + BFD_RELOC_16C_DISP04,14.3514 + BFD_RELOC_16C_DISP04_C,14.3515 + BFD_RELOC_16C_DISP08,14.3516 + BFD_RELOC_16C_DISP08_C,14.3517 + BFD_RELOC_16C_DISP16,14.3518 + BFD_RELOC_16C_DISP16_C,14.3519 + BFD_RELOC_16C_DISP24,14.3520 + BFD_RELOC_16C_DISP24_C,14.3521 + BFD_RELOC_16C_DISP24a,14.3522 + BFD_RELOC_16C_DISP24a_C,14.3523 + BFD_RELOC_16C_REG04,14.3524 + BFD_RELOC_16C_REG04_C,14.3525 + BFD_RELOC_16C_REG04a,14.3526 + BFD_RELOC_16C_REG04a_C,14.3527 + BFD_RELOC_16C_REG14,14.3528 + BFD_RELOC_16C_REG14_C,14.3529 + BFD_RELOC_16C_REG16,14.3530 + BFD_RELOC_16C_REG16_C,14.3531 + BFD_RELOC_16C_REG20,14.3532 + BFD_RELOC_16C_REG20_C,14.3533 + BFD_RELOC_16C_ABS20,14.3534 + BFD_RELOC_16C_ABS20_C,14.3535 + BFD_RELOC_16C_ABS24,14.3536 + BFD_RELOC_16C_ABS24_C,14.3537 + BFD_RELOC_16C_IMM04,14.3538 + BFD_RELOC_16C_IMM04_C,14.3539 + BFD_RELOC_16C_IMM16,14.3540 + BFD_RELOC_16C_IMM16_C,14.3541 + BFD_RELOC_16C_IMM20,14.3542 + BFD_RELOC_16C_IMM20_C,14.3543 + BFD_RELOC_16C_IMM24,14.3544 + BFD_RELOC_16C_IMM24_C,14.3545 + BFD_RELOC_16C_IMM32,14.3546 + BFD_RELOC_16C_IMM32_C,14.3547 +14.3548 +/* NS CRX Relocations. */14.3549 + BFD_RELOC_CRX_REL4,14.3550 + BFD_RELOC_CRX_REL8,14.3551 + BFD_RELOC_CRX_REL8_CMP,14.3552 + BFD_RELOC_CRX_REL16,14.3553 + BFD_RELOC_CRX_REL24,14.3554 + BFD_RELOC_CRX_REL32,14.3555 + BFD_RELOC_CRX_REGREL12,14.3556 + BFD_RELOC_CRX_REGREL22,14.3557 + BFD_RELOC_CRX_REGREL28,14.3558 + BFD_RELOC_CRX_REGREL32,14.3559 + BFD_RELOC_CRX_ABS16,14.3560 + BFD_RELOC_CRX_ABS32,14.3561 + BFD_RELOC_CRX_NUM8,14.3562 + BFD_RELOC_CRX_NUM16,14.3563 + BFD_RELOC_CRX_NUM32,14.3564 + BFD_RELOC_CRX_IMM16,14.3565 + BFD_RELOC_CRX_IMM32,14.3566 + BFD_RELOC_CRX_SWITCH8,14.3567 + BFD_RELOC_CRX_SWITCH16,14.3568 + BFD_RELOC_CRX_SWITCH32,14.3569 +14.3570 +/* These relocs are only used within the CRIS assembler. They are not14.3571 +(at present) written to any object files. */14.3572 + BFD_RELOC_CRIS_BDISP8,14.3573 + BFD_RELOC_CRIS_UNSIGNED_5,14.3574 + BFD_RELOC_CRIS_SIGNED_6,14.3575 + BFD_RELOC_CRIS_UNSIGNED_6,14.3576 + BFD_RELOC_CRIS_SIGNED_8,14.3577 + BFD_RELOC_CRIS_UNSIGNED_8,14.3578 + BFD_RELOC_CRIS_SIGNED_16,14.3579 + BFD_RELOC_CRIS_UNSIGNED_16,14.3580 + BFD_RELOC_CRIS_LAPCQ_OFFSET,14.3581 + BFD_RELOC_CRIS_UNSIGNED_4,14.3582 +14.3583 +/* Relocs used in ELF shared libraries for CRIS. */14.3584 + BFD_RELOC_CRIS_COPY,14.3585 + BFD_RELOC_CRIS_GLOB_DAT,14.3586 + BFD_RELOC_CRIS_JUMP_SLOT,14.3587 + BFD_RELOC_CRIS_RELATIVE,14.3588 +14.3589 +/* 32-bit offset to symbol-entry within GOT. */14.3590 + BFD_RELOC_CRIS_32_GOT,14.3591 +14.3592 +/* 16-bit offset to symbol-entry within GOT. */14.3593 + BFD_RELOC_CRIS_16_GOT,14.3594 +14.3595 +/* 32-bit offset to symbol-entry within GOT, with PLT handling. */14.3596 + BFD_RELOC_CRIS_32_GOTPLT,14.3597 +14.3598 +/* 16-bit offset to symbol-entry within GOT, with PLT handling. */14.3599 + BFD_RELOC_CRIS_16_GOTPLT,14.3600 +14.3601 +/* 32-bit offset to symbol, relative to GOT. */14.3602 + BFD_RELOC_CRIS_32_GOTREL,14.3603 +14.3604 +/* 32-bit offset to symbol with PLT entry, relative to GOT. */14.3605 + BFD_RELOC_CRIS_32_PLT_GOTREL,14.3606 +14.3607 +/* 32-bit offset to symbol with PLT entry, relative to this relocation. */14.3608 + BFD_RELOC_CRIS_32_PLT_PCREL,14.3609 +14.3610 +/* Intel i860 Relocations. */14.3611 + BFD_RELOC_860_COPY,14.3612 + BFD_RELOC_860_GLOB_DAT,14.3613 + BFD_RELOC_860_JUMP_SLOT,14.3614 + BFD_RELOC_860_RELATIVE,14.3615 + BFD_RELOC_860_PC26,14.3616 + BFD_RELOC_860_PLT26,14.3617 + BFD_RELOC_860_PC16,14.3618 + BFD_RELOC_860_LOW0,14.3619 + BFD_RELOC_860_SPLIT0,14.3620 + BFD_RELOC_860_LOW1,14.3621 + BFD_RELOC_860_SPLIT1,14.3622 + BFD_RELOC_860_LOW2,14.3623 + BFD_RELOC_860_SPLIT2,14.3624 + BFD_RELOC_860_LOW3,14.3625 + BFD_RELOC_860_LOGOT0,14.3626 + BFD_RELOC_860_SPGOT0,14.3627 + BFD_RELOC_860_LOGOT1,14.3628 + BFD_RELOC_860_SPGOT1,14.3629 + BFD_RELOC_860_LOGOTOFF0,14.3630 + BFD_RELOC_860_SPGOTOFF0,14.3631 + BFD_RELOC_860_LOGOTOFF1,14.3632 + BFD_RELOC_860_SPGOTOFF1,14.3633 + BFD_RELOC_860_LOGOTOFF2,14.3634 + BFD_RELOC_860_LOGOTOFF3,14.3635 + BFD_RELOC_860_LOPC,14.3636 + BFD_RELOC_860_HIGHADJ,14.3637 + BFD_RELOC_860_HAGOT,14.3638 + BFD_RELOC_860_HAGOTOFF,14.3639 + BFD_RELOC_860_HAPC,14.3640 + BFD_RELOC_860_HIGH,14.3641 + BFD_RELOC_860_HIGOT,14.3642 + BFD_RELOC_860_HIGOTOFF,14.3643 +14.3644 +/* OpenRISC Relocations. */14.3645 + BFD_RELOC_OPENRISC_ABS_26,14.3646 + BFD_RELOC_OPENRISC_REL_26,14.3647 +14.3648 +/* H8 elf Relocations. */14.3649 + BFD_RELOC_H8_DIR16A8,14.3650 + BFD_RELOC_H8_DIR16R8,14.3651 + BFD_RELOC_H8_DIR24A8,14.3652 + BFD_RELOC_H8_DIR24R8,14.3653 + BFD_RELOC_H8_DIR32A16,14.3654 +14.3655 +/* Sony Xstormy16 Relocations. */14.3656 + BFD_RELOC_XSTORMY16_REL_12,14.3657 + BFD_RELOC_XSTORMY16_12,14.3658 + BFD_RELOC_XSTORMY16_24,14.3659 + BFD_RELOC_XSTORMY16_FPTR16,14.3660 +14.3661 +/* Relocations used by VAX ELF. */14.3662 + BFD_RELOC_VAX_GLOB_DAT,14.3663 + BFD_RELOC_VAX_JMP_SLOT,14.3664 + BFD_RELOC_VAX_RELATIVE,14.3665 +14.3666 +/* msp430 specific relocation codes */14.3667 + BFD_RELOC_MSP430_10_PCREL,14.3668 + BFD_RELOC_MSP430_16_PCREL,14.3669 + BFD_RELOC_MSP430_16,14.3670 + BFD_RELOC_MSP430_16_PCREL_BYTE,14.3671 + BFD_RELOC_MSP430_16_BYTE,14.3672 + BFD_RELOC_MSP430_2X_PCREL,14.3673 + BFD_RELOC_MSP430_RL_PCREL,14.3674 +14.3675 +/* IQ2000 Relocations. */14.3676 + BFD_RELOC_IQ2000_OFFSET_16,14.3677 + BFD_RELOC_IQ2000_OFFSET_21,14.3678 + BFD_RELOC_IQ2000_UHI16,14.3679 +14.3680 +/* Special Xtensa relocation used only by PLT entries in ELF shared14.3681 +objects to indicate that the runtime linker should set the value14.3682 +to one of its own internal functions or data structures. */14.3683 + BFD_RELOC_XTENSA_RTLD,14.3684 +14.3685 +/* Xtensa relocations for ELF shared objects. */14.3686 + BFD_RELOC_XTENSA_GLOB_DAT,14.3687 + BFD_RELOC_XTENSA_JMP_SLOT,14.3688 + BFD_RELOC_XTENSA_RELATIVE,14.3689 +14.3690 +/* Xtensa relocation used in ELF object files for symbols that may require14.3691 +PLT entries. Otherwise, this is just a generic 32-bit relocation. */14.3692 + BFD_RELOC_XTENSA_PLT,14.3693 +14.3694 +/* Xtensa relocations to mark the difference of two local symbols.14.3695 +These are only needed to support linker relaxation and can be ignored14.3696 +when not relaxing. The field is set to the value of the difference14.3697 +assuming no relaxation. The relocation encodes the position of the14.3698 +first symbol so the linker can determine whether to adjust the field14.3699 +value. */14.3700 + BFD_RELOC_XTENSA_DIFF8,14.3701 + BFD_RELOC_XTENSA_DIFF16,14.3702 + BFD_RELOC_XTENSA_DIFF32,14.3703 +14.3704 +/* Generic Xtensa relocations for instruction operands. Only the slot14.3705 +number is encoded in the relocation. The relocation applies to the14.3706 +last PC-relative immediate operand, or if there are no PC-relative14.3707 +immediates, to the last immediate operand. */14.3708 + BFD_RELOC_XTENSA_SLOT0_OP,14.3709 + BFD_RELOC_XTENSA_SLOT1_OP,14.3710 + BFD_RELOC_XTENSA_SLOT2_OP,14.3711 + BFD_RELOC_XTENSA_SLOT3_OP,14.3712 + BFD_RELOC_XTENSA_SLOT4_OP,14.3713 + BFD_RELOC_XTENSA_SLOT5_OP,14.3714 + BFD_RELOC_XTENSA_SLOT6_OP,14.3715 + BFD_RELOC_XTENSA_SLOT7_OP,14.3716 + BFD_RELOC_XTENSA_SLOT8_OP,14.3717 + BFD_RELOC_XTENSA_SLOT9_OP,14.3718 + BFD_RELOC_XTENSA_SLOT10_OP,14.3719 + BFD_RELOC_XTENSA_SLOT11_OP,14.3720 + BFD_RELOC_XTENSA_SLOT12_OP,14.3721 + BFD_RELOC_XTENSA_SLOT13_OP,14.3722 + BFD_RELOC_XTENSA_SLOT14_OP,14.3723 +14.3724 +/* Alternate Xtensa relocations. Only the slot is encoded in the14.3725 +relocation. The meaning of these relocations is opcode-specific. */14.3726 + BFD_RELOC_XTENSA_SLOT0_ALT,14.3727 + BFD_RELOC_XTENSA_SLOT1_ALT,14.3728 + BFD_RELOC_XTENSA_SLOT2_ALT,14.3729 + BFD_RELOC_XTENSA_SLOT3_ALT,14.3730 + BFD_RELOC_XTENSA_SLOT4_ALT,14.3731 + BFD_RELOC_XTENSA_SLOT5_ALT,14.3732 + BFD_RELOC_XTENSA_SLOT6_ALT,14.3733 + BFD_RELOC_XTENSA_SLOT7_ALT,14.3734 + BFD_RELOC_XTENSA_SLOT8_ALT,14.3735 + BFD_RELOC_XTENSA_SLOT9_ALT,14.3736 + BFD_RELOC_XTENSA_SLOT10_ALT,14.3737 + BFD_RELOC_XTENSA_SLOT11_ALT,14.3738 + BFD_RELOC_XTENSA_SLOT12_ALT,14.3739 + BFD_RELOC_XTENSA_SLOT13_ALT,14.3740 + BFD_RELOC_XTENSA_SLOT14_ALT,14.3741 +14.3742 +/* Xtensa relocations for backward compatibility. These have all been14.3743 +replaced by BFD_RELOC_XTENSA_SLOT0_OP. */14.3744 + BFD_RELOC_XTENSA_OP0,14.3745 + BFD_RELOC_XTENSA_OP1,14.3746 + BFD_RELOC_XTENSA_OP2,14.3747 +14.3748 +/* Xtensa relocation to mark that the assembler expanded the14.3749 +instructions from an original target. The expansion size is14.3750 +encoded in the reloc size. */14.3751 + BFD_RELOC_XTENSA_ASM_EXPAND,14.3752 +14.3753 +/* Xtensa relocation to mark that the linker should simplify14.3754 +assembler-expanded instructions. This is commonly used14.3755 +internally by the linker after analysis of a14.3756 +BFD_RELOC_XTENSA_ASM_EXPAND. */14.3757 + BFD_RELOC_XTENSA_ASM_SIMPLIFY,14.3758 + BFD_RELOC_UNUSED };14.3759 +typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;14.3760 +reloc_howto_type *bfd_reloc_type_lookup14.3761 + (bfd *abfd, bfd_reloc_code_real_type code);14.3762 +14.3763 +const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);14.3764 +14.3765 +/* Extracted from syms.c. */14.3766 +14.3767 +typedef struct bfd_symbol14.3768 +{14.3769 + /* A pointer to the BFD which owns the symbol. This information14.3770 + is necessary so that a back end can work out what additional14.3771 + information (invisible to the application writer) is carried14.3772 + with the symbol.14.3773 +14.3774 + This field is *almost* redundant, since you can use section->owner14.3775 + instead, except that some symbols point to the global sections14.3776 + bfd_{abs,com,und}_section. This could be fixed by making14.3777 + these globals be per-bfd (or per-target-flavor). FIXME. */14.3778 + struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */14.3779 +14.3780 + /* The text of the symbol. The name is left alone, and not copied; the14.3781 + application may not alter it. */14.3782 + const char *name;14.3783 +14.3784 + /* The value of the symbol. This really should be a union of a14.3785 + numeric value with a pointer, since some flags indicate that14.3786 + a pointer to another symbol is stored here. */14.3787 + symvalue value;14.3788 +14.3789 + /* Attributes of a symbol. */14.3790 +#define BSF_NO_FLAGS 0x0014.3791 +14.3792 + /* The symbol has local scope; <<static>> in <<C>>. The value14.3793 + is the offset into the section of the data. */14.3794 +#define BSF_LOCAL 0x0114.3795 +14.3796 + /* The symbol has global scope; initialized data in <<C>>. The14.3797 + value is the offset into the section of the data. */14.3798 +#define BSF_GLOBAL 0x0214.3799 +14.3800 + /* The symbol has global scope and is exported. The value is14.3801 + the offset into the section of the data. */14.3802 +#define BSF_EXPORT BSF_GLOBAL /* No real difference. */14.3803 +14.3804 + /* A normal C symbol would be one of:14.3805 + <<BSF_LOCAL>>, <<BSF_FORT_COMM>>, <<BSF_UNDEFINED>> or14.3806 + <<BSF_GLOBAL>>. */14.3807 +14.3808 + /* The symbol is a debugging record. The value has an arbitrary14.3809 + meaning, unless BSF_DEBUGGING_RELOC is also set. */14.3810 +#define BSF_DEBUGGING 0x0814.3811 +14.3812 + /* The symbol denotes a function entry point. Used in ELF,14.3813 + perhaps others someday. */14.3814 +#define BSF_FUNCTION 0x1014.3815 +14.3816 + /* Used by the linker. */14.3817 +#define BSF_KEEP 0x2014.3818 +#define BSF_KEEP_G 0x4014.3819 +14.3820 + /* A weak global symbol, overridable without warnings by14.3821 + a regular global symbol of the same name. */14.3822 +#define BSF_WEAK 0x8014.3823 +14.3824 + /* This symbol was created to point to a section, e.g. ELF's14.3825 + STT_SECTION symbols. */14.3826 +#define BSF_SECTION_SYM 0x10014.3827 +14.3828 + /* The symbol used to be a common symbol, but now it is14.3829 + allocated. */14.3830 +#define BSF_OLD_COMMON 0x20014.3831 +14.3832 + /* The default value for common data. */14.3833 +#define BFD_FORT_COMM_DEFAULT_VALUE 014.3834 +14.3835 + /* In some files the type of a symbol sometimes alters its14.3836 + location in an output file - ie in coff a <<ISFCN>> symbol14.3837 + which is also <<C_EXT>> symbol appears where it was14.3838 + declared and not at the end of a section. This bit is set14.3839 + by the target BFD part to convey this information. */14.3840 +#define BSF_NOT_AT_END 0x40014.3841 +14.3842 + /* Signal that the symbol is the label of constructor section. */14.3843 +#define BSF_CONSTRUCTOR 0x80014.3844 +14.3845 + /* Signal that the symbol is a warning symbol. The name is a14.3846 + warning. The name of the next symbol is the one to warn about;14.3847 + if a reference is made to a symbol with the same name as the next14.3848 + symbol, a warning is issued by the linker. */14.3849 +#define BSF_WARNING 0x100014.3850 +14.3851 + /* Signal that the symbol is indirect. This symbol is an indirect14.3852 + pointer to the symbol with the same name as the next symbol. */14.3853 +#define BSF_INDIRECT 0x200014.3854 +14.3855 + /* BSF_FILE marks symbols that contain a file name. This is used14.3856 + for ELF STT_FILE symbols. */14.3857 +#define BSF_FILE 0x400014.3858 +14.3859 + /* Symbol is from dynamic linking information. */14.3860 +#define BSF_DYNAMIC 0x800014.3861 +14.3862 + /* The symbol denotes a data object. Used in ELF, and perhaps14.3863 + others someday. */14.3864 +#define BSF_OBJECT 0x1000014.3865 +14.3866 + /* This symbol is a debugging symbol. The value is the offset14.3867 + into the section of the data. BSF_DEBUGGING should be set14.3868 + as well. */14.3869 +#define BSF_DEBUGGING_RELOC 0x2000014.3870 +14.3871 + /* This symbol is thread local. Used in ELF. */14.3872 +#define BSF_THREAD_LOCAL 0x4000014.3873 +14.3874 + flagword flags;14.3875 +14.3876 + /* A pointer to the section to which this symbol is14.3877 + relative. This will always be non NULL, there are special14.3878 + sections for undefined and absolute symbols. */14.3879 + struct bfd_section *section;14.3880 +14.3881 + /* Back end special data. */14.3882 + union14.3883 + {14.3884 + void *p;14.3885 + bfd_vma i;14.3886 + }14.3887 + udata;14.3888 +}14.3889 +asymbol;14.3890 +14.3891 +#define bfd_get_symtab_upper_bound(abfd) \14.3892 + BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))14.3893 +14.3894 +bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);14.3895 +14.3896 +bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);14.3897 +14.3898 +#define bfd_is_local_label_name(abfd, name) \14.3899 + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))14.3900 +14.3901 +bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);14.3902 +14.3903 +#define bfd_is_target_special_symbol(abfd, sym) \14.3904 + BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))14.3905 +14.3906 +#define bfd_canonicalize_symtab(abfd, location) \14.3907 + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))14.3908 +14.3909 +bfd_boolean bfd_set_symtab14.3910 + (bfd *abfd, asymbol **location, unsigned int count);14.3911 +14.3912 +void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);14.3913 +14.3914 +#define bfd_make_empty_symbol(abfd) \14.3915 + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))14.3916 +14.3917 +asymbol *_bfd_generic_make_empty_symbol (bfd *);14.3918 +14.3919 +#define bfd_make_debug_symbol(abfd,ptr,size) \14.3920 + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))14.3921 +14.3922 +int bfd_decode_symclass (asymbol *symbol);14.3923 +14.3924 +bfd_boolean bfd_is_undefined_symclass (int symclass);14.3925 +14.3926 +void bfd_symbol_info (asymbol *symbol, symbol_info *ret);14.3927 +14.3928 +bfd_boolean bfd_copy_private_symbol_data14.3929 + (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);14.3930 +14.3931 +#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \14.3932 + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \14.3933 + (ibfd, isymbol, obfd, osymbol))14.3934 +14.3935 +/* Extracted from bfd.c. */14.3936 +struct bfd14.3937 +{14.3938 + /* A unique identifier of the BFD */14.3939 + unsigned int id;14.3940 +14.3941 + /* The filename the application opened the BFD with. */14.3942 + const char *filename;14.3943 +14.3944 + /* A pointer to the target jump table. */14.3945 + const struct bfd_target *xvec;14.3946 +14.3947 + /* The IOSTREAM, and corresponding IO vector that provide access14.3948 + to the file backing the BFD. */14.3949 + void *iostream;14.3950 + const struct bfd_iovec *iovec;14.3951 +14.3952 + /* Is the file descriptor being cached? That is, can it be closed as14.3953 + needed, and re-opened when accessed later? */14.3954 + bfd_boolean cacheable;14.3955 +14.3956 + /* Marks whether there was a default target specified when the14.3957 + BFD was opened. This is used to select which matching algorithm14.3958 + to use to choose the back end. */14.3959 + bfd_boolean target_defaulted;14.3960 +14.3961 + /* The caching routines use these to maintain a14.3962 + least-recently-used list of BFDs. */14.3963 + struct bfd *lru_prev, *lru_next;14.3964 +14.3965 + /* When a file is closed by the caching routines, BFD retains14.3966 + state information on the file here... */14.3967 + ufile_ptr where;14.3968 +14.3969 + /* ... and here: (``once'' means at least once). */14.3970 + bfd_boolean opened_once;14.3971 +14.3972 + /* Set if we have a locally maintained mtime value, rather than14.3973 + getting it from the file each time. */14.3974 + bfd_boolean mtime_set;14.3975 +14.3976 + /* File modified time, if mtime_set is TRUE. */14.3977 + long mtime;14.3978 +14.3979 + /* Reserved for an unimplemented file locking extension. */14.3980 + int ifd;14.3981 +14.3982 + /* The format which belongs to the BFD. (object, core, etc.) */14.3983 + bfd_format format;14.3984 +14.3985 + /* The direction with which the BFD was opened. */14.3986 + enum bfd_direction14.3987 + {14.3988 + no_direction = 0,14.3989 + read_direction = 1,14.3990 + write_direction = 2,14.3991 + both_direction = 314.3992 + }14.3993 + direction;14.3994 +14.3995 + /* Format_specific flags. */14.3996 + flagword flags;14.3997 +14.3998 + /* Currently my_archive is tested before adding origin to14.3999 + anything. I believe that this can become always an add of14.4000 + origin, with origin set to 0 for non archive files. */14.4001 + ufile_ptr origin;14.4002 +14.4003 + /* Remember when output has begun, to stop strange things14.4004 + from happening. */14.4005 + bfd_boolean output_has_begun;14.4006 +14.4007 + /* A hash table for section names. */14.4008 + struct bfd_hash_table section_htab;14.4009 +14.4010 + /* Pointer to linked list of sections. */14.4011 + struct bfd_section *sections;14.4012 +14.4013 + /* The place where we add to the section list. */14.4014 + struct bfd_section **section_tail;14.4015 +14.4016 + /* The number of sections. */14.4017 + unsigned int section_count;14.4018 +14.4019 + /* Stuff only useful for object files:14.4020 + The start address. */14.4021 + bfd_vma start_address;14.4022 +14.4023 + /* Used for input and output. */14.4024 + unsigned int symcount;14.4025 +14.4026 + /* Symbol table for output BFD (with symcount entries). */14.4027 + struct bfd_symbol **outsymbols;14.4028 +14.4029 + /* Used for slurped dynamic symbol tables. */14.4030 + unsigned int dynsymcount;14.4031 +14.4032 + /* Pointer to structure which contains architecture information. */14.4033 + const struct bfd_arch_info *arch_info;14.4034 +14.4035 + /* Flag set if symbols from this BFD should not be exported. */14.4036 + bfd_boolean no_export;14.4037 +14.4038 + /* Stuff only useful for archives. */14.4039 + void *arelt_data;14.4040 + struct bfd *my_archive; /* The containing archive BFD. */14.4041 + struct bfd *next; /* The next BFD in the archive. */14.4042 + struct bfd *archive_head; /* The first BFD in the archive. */14.4043 + bfd_boolean has_armap;14.4044 +14.4045 + /* A chain of BFD structures involved in a link. */14.4046 + struct bfd *link_next;14.4047 +14.4048 + /* A field used by _bfd_generic_link_add_archive_symbols. This will14.4049 + be used only for archive elements. */14.4050 + int archive_pass;14.4051 +14.4052 + /* Used by the back end to hold private data. */14.4053 + union14.4054 + {14.4055 + struct aout_data_struct *aout_data;14.4056 + struct artdata *aout_ar_data;14.4057 + struct _oasys_data *oasys_obj_data;14.4058 + struct _oasys_ar_data *oasys_ar_data;14.4059 + struct coff_tdata *coff_obj_data;14.4060 + struct pe_tdata *pe_obj_data;14.4061 + struct xcoff_tdata *xcoff_obj_data;14.4062 + struct ecoff_tdata *ecoff_obj_data;14.4063 + struct ieee_data_struct *ieee_data;14.4064 + struct ieee_ar_data_struct *ieee_ar_data;14.4065 + struct srec_data_struct *srec_data;14.4066 + struct ihex_data_struct *ihex_data;14.4067 + struct tekhex_data_struct *tekhex_data;14.4068 + struct elf_obj_tdata *elf_obj_data;14.4069 + struct nlm_obj_tdata *nlm_obj_data;14.4070 + struct bout_data_struct *bout_data;14.4071 + struct mmo_data_struct *mmo_data;14.4072 + struct sun_core_struct *sun_core_data;14.4073 + struct sco5_core_struct *sco5_core_data;14.4074 + struct trad_core_struct *trad_core_data;14.4075 + struct som_data_struct *som_data;14.4076 + struct hpux_core_struct *hpux_core_data;14.4077 + struct hppabsd_core_struct *hppabsd_core_data;14.4078 + struct sgi_core_struct *sgi_core_data;14.4079 + struct lynx_core_struct *lynx_core_data;14.4080 + struct osf_core_struct *osf_core_data;14.4081 + struct cisco_core_struct *cisco_core_data;14.4082 + struct versados_data_struct *versados_data;14.4083 + struct netbsd_core_struct *netbsd_core_data;14.4084 + struct mach_o_data_struct *mach_o_data;14.4085 + struct mach_o_fat_data_struct *mach_o_fat_data;14.4086 + struct bfd_pef_data_struct *pef_data;14.4087 + struct bfd_pef_xlib_data_struct *pef_xlib_data;14.4088 + struct bfd_sym_data_struct *sym_data;14.4089 + void *any;14.4090 + }14.4091 + tdata;14.4092 +14.4093 + /* Used by the application to hold private data. */14.4094 + void *usrdata;14.4095 +14.4096 + /* Where all the allocated stuff under this BFD goes. This is a14.4097 + struct objalloc *, but we use void * to avoid requiring the inclusion14.4098 + of objalloc.h. */14.4099 + void *memory;14.4100 +};14.4101 +14.4102 +typedef enum bfd_error14.4103 +{14.4104 + bfd_error_no_error = 0,14.4105 + bfd_error_system_call,14.4106 + bfd_error_invalid_target,14.4107 + bfd_error_wrong_format,14.4108 + bfd_error_wrong_object_format,14.4109 + bfd_error_invalid_operation,14.4110 + bfd_error_no_memory,14.4111 + bfd_error_no_symbols,14.4112 + bfd_error_no_armap,14.4113 + bfd_error_no_more_archived_files,14.4114 + bfd_error_malformed_archive,14.4115 + bfd_error_file_not_recognized,14.4116 + bfd_error_file_ambiguously_recognized,14.4117 + bfd_error_no_contents,14.4118 + bfd_error_nonrepresentable_section,14.4119 + bfd_error_no_debug_section,14.4120 + bfd_error_bad_value,14.4121 + bfd_error_file_truncated,14.4122 + bfd_error_file_too_big,14.4123 + bfd_error_invalid_error_code14.4124 +}14.4125 +bfd_error_type;14.4126 +14.4127 +bfd_error_type bfd_get_error (void);14.4128 +14.4129 +void bfd_set_error (bfd_error_type error_tag);14.4130 +14.4131 +const char *bfd_errmsg (bfd_error_type error_tag);14.4132 +14.4133 +void bfd_perror (const char *message);14.4134 +14.4135 +typedef void (*bfd_error_handler_type) (const char *, ...);14.4136 +14.4137 +bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);14.4138 +14.4139 +void bfd_set_error_program_name (const char *);14.4140 +14.4141 +bfd_error_handler_type bfd_get_error_handler (void);14.4142 +14.4143 +long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);14.4144 +14.4145 +long bfd_canonicalize_reloc14.4146 + (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);14.4147 +14.4148 +void bfd_set_reloc14.4149 + (bfd *abfd, asection *sec, arelent **rel, unsigned int count);14.4150 +14.4151 +bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);14.4152 +14.4153 +int bfd_get_arch_size (bfd *abfd);14.4154 +14.4155 +int bfd_get_sign_extend_vma (bfd *abfd);14.4156 +14.4157 +bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);14.4158 +14.4159 +unsigned int bfd_get_gp_size (bfd *abfd);14.4160 +14.4161 +void bfd_set_gp_size (bfd *abfd, unsigned int i);14.4162 +14.4163 +bfd_vma bfd_scan_vma (const char *string, const char **end, int base);14.4164 +14.4165 +bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);14.4166 +14.4167 +#define bfd_copy_private_header_data(ibfd, obfd) \14.4168 + BFD_SEND (obfd, _bfd_copy_private_header_data, \14.4169 + (ibfd, obfd))14.4170 +bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);14.4171 +14.4172 +#define bfd_copy_private_bfd_data(ibfd, obfd) \14.4173 + BFD_SEND (obfd, _bfd_copy_private_bfd_data, \14.4174 + (ibfd, obfd))14.4175 +bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);14.4176 +14.4177 +#define bfd_merge_private_bfd_data(ibfd, obfd) \14.4178 + BFD_SEND (obfd, _bfd_merge_private_bfd_data, \14.4179 + (ibfd, obfd))14.4180 +bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);14.4181 +14.4182 +#define bfd_set_private_flags(abfd, flags) \14.4183 + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))14.4184 +#define bfd_sizeof_headers(abfd, reloc) \14.4185 + BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc))14.4186 +14.4187 +#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \14.4188 + BFD_SEND (abfd, _bfd_find_nearest_line, \14.4189 + (abfd, sec, syms, off, file, func, line))14.4190 +14.4191 +#define bfd_debug_info_start(abfd) \14.4192 + BFD_SEND (abfd, _bfd_debug_info_start, (abfd))14.4193 +14.4194 +#define bfd_debug_info_end(abfd) \14.4195 + BFD_SEND (abfd, _bfd_debug_info_end, (abfd))14.4196 +14.4197 +#define bfd_debug_info_accumulate(abfd, section) \14.4198 + BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))14.4199 +14.4200 +#define bfd_stat_arch_elt(abfd, stat) \14.4201 + BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))14.4202 +14.4203 +#define bfd_update_armap_timestamp(abfd) \14.4204 + BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))14.4205 +14.4206 +#define bfd_set_arch_mach(abfd, arch, mach)\14.4207 + BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))14.4208 +14.4209 +#define bfd_relax_section(abfd, section, link_info, again) \14.4210 + BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))14.4211 +14.4212 +#define bfd_gc_sections(abfd, link_info) \14.4213 + BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))14.4214 +14.4215 +#define bfd_merge_sections(abfd, link_info) \14.4216 + BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))14.4217 +14.4218 +#define bfd_is_group_section(abfd, sec) \14.4219 + BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))14.4220 +14.4221 +#define bfd_discard_group(abfd, sec) \14.4222 + BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))14.4223 +14.4224 +#define bfd_link_hash_table_create(abfd) \14.4225 + BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))14.4226 +14.4227 +#define bfd_link_hash_table_free(abfd, hash) \14.4228 + BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))14.4229 +14.4230 +#define bfd_link_add_symbols(abfd, info) \14.4231 + BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))14.4232 +14.4233 +#define bfd_link_just_syms(abfd, sec, info) \14.4234 + BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))14.4235 +14.4236 +#define bfd_final_link(abfd, info) \14.4237 + BFD_SEND (abfd, _bfd_final_link, (abfd, info))14.4238 +14.4239 +#define bfd_free_cached_info(abfd) \14.4240 + BFD_SEND (abfd, _bfd_free_cached_info, (abfd))14.4241 +14.4242 +#define bfd_get_dynamic_symtab_upper_bound(abfd) \14.4243 + BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))14.4244 +14.4245 +#define bfd_print_private_bfd_data(abfd, file)\14.4246 + BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))14.4247 +14.4248 +#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \14.4249 + BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))14.4250 +14.4251 +#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \14.4252 + BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \14.4253 + dyncount, dynsyms, ret))14.4254 +14.4255 +#define bfd_get_dynamic_reloc_upper_bound(abfd) \14.4256 + BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))14.4257 +14.4258 +#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \14.4259 + BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))14.4260 +14.4261 +extern bfd_byte *bfd_get_relocated_section_contents14.4262 + (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,14.4263 + bfd_boolean, asymbol **);14.4264 +14.4265 +bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);14.4266 +14.4267 +struct bfd_preserve14.4268 +{14.4269 + void *marker;14.4270 + void *tdata;14.4271 + flagword flags;14.4272 + const struct bfd_arch_info *arch_info;14.4273 + struct bfd_section *sections;14.4274 + struct bfd_section **section_tail;14.4275 + unsigned int section_count;14.4276 + struct bfd_hash_table section_htab;14.4277 +};14.4278 +14.4279 +bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);14.4280 +14.4281 +void bfd_preserve_restore (bfd *, struct bfd_preserve *);14.4282 +14.4283 +void bfd_preserve_finish (bfd *, struct bfd_preserve *);14.4284 +14.4285 +/* Extracted from archive.c. */14.4286 +symindex bfd_get_next_mapent14.4287 + (bfd *abfd, symindex previous, carsym **sym);14.4288 +14.4289 +bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);14.4290 +14.4291 +bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);14.4292 +14.4293 +/* Extracted from corefile.c. */14.4294 +const char *bfd_core_file_failing_command (bfd *abfd);14.4295 +14.4296 +int bfd_core_file_failing_signal (bfd *abfd);14.4297 +14.4298 +bfd_boolean core_file_matches_executable_p14.4299 + (bfd *core_bfd, bfd *exec_bfd);14.4300 +14.4301 +/* Extracted from targets.c. */14.4302 +#define BFD_SEND(bfd, message, arglist) \14.4303 + ((*((bfd)->xvec->message)) arglist)14.4304 +14.4305 +#ifdef DEBUG_BFD_SEND14.4306 +#undef BFD_SEND14.4307 +#define BFD_SEND(bfd, message, arglist) \14.4308 + (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \14.4309 + ((*((bfd)->xvec->message)) arglist) : \14.4310 + (bfd_assert (__FILE__,__LINE__), NULL))14.4311 +#endif14.4312 +#define BFD_SEND_FMT(bfd, message, arglist) \14.4313 + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)14.4314 +14.4315 +#ifdef DEBUG_BFD_SEND14.4316 +#undef BFD_SEND_FMT14.4317 +#define BFD_SEND_FMT(bfd, message, arglist) \14.4318 + (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \14.4319 + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \14.4320 + (bfd_assert (__FILE__,__LINE__), NULL))14.4321 +#endif14.4322 +14.4323 +enum bfd_flavour14.4324 +{14.4325 + bfd_target_unknown_flavour,14.4326 + bfd_target_aout_flavour,14.4327 + bfd_target_coff_flavour,14.4328 + bfd_target_ecoff_flavour,14.4329 + bfd_target_xcoff_flavour,14.4330 + bfd_target_elf_flavour,14.4331 + bfd_target_ieee_flavour,14.4332 + bfd_target_nlm_flavour,14.4333 + bfd_target_oasys_flavour,14.4334 + bfd_target_tekhex_flavour,14.4335 + bfd_target_srec_flavour,14.4336 + bfd_target_ihex_flavour,14.4337 + bfd_target_som_flavour,14.4338 + bfd_target_os9k_flavour,14.4339 + bfd_target_versados_flavour,14.4340 + bfd_target_msdos_flavour,14.4341 + bfd_target_ovax_flavour,14.4342 + bfd_target_evax_flavour,14.4343 + bfd_target_mmo_flavour,14.4344 + bfd_target_mach_o_flavour,14.4345 + bfd_target_pef_flavour,14.4346 + bfd_target_pef_xlib_flavour,14.4347 + bfd_target_sym_flavour14.4348 +};14.4349 +14.4350 +enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };14.4351 +14.4352 +/* Forward declaration. */14.4353 +typedef struct bfd_link_info _bfd_link_info;14.4354 +14.4355 +typedef struct bfd_target14.4356 +{14.4357 + /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc. */14.4358 + char *name;14.4359 +14.4360 + /* The "flavour" of a back end is a general indication about14.4361 + the contents of a file. */14.4362 + enum bfd_flavour flavour;14.4363 +14.4364 + /* The order of bytes within the data area of a file. */14.4365 + enum bfd_endian byteorder;14.4366 +14.4367 + /* The order of bytes within the header parts of a file. */14.4368 + enum bfd_endian header_byteorder;14.4369 +14.4370 + /* A mask of all the flags which an executable may have set -14.4371 + from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>. */14.4372 + flagword object_flags;14.4373 +14.4374 + /* A mask of all the flags which a section may have set - from14.4375 + the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>. */14.4376 + flagword section_flags;14.4377 +14.4378 + /* The character normally found at the front of a symbol.14.4379 + (if any), perhaps `_'. */14.4380 + char symbol_leading_char;14.4381 +14.4382 + /* The pad character for file names within an archive header. */14.4383 + char ar_pad_char;14.4384 +14.4385 + /* The maximum number of characters in an archive header. */14.4386 + unsigned short ar_max_namelen;14.4387 +14.4388 + /* Entries for byte swapping for data. These are different from the14.4389 + other entry points, since they don't take a BFD as the first argument.14.4390 + Certain other handlers could do the same. */14.4391 + bfd_uint64_t (*bfd_getx64) (const void *);14.4392 + bfd_int64_t (*bfd_getx_signed_64) (const void *);14.4393 + void (*bfd_putx64) (bfd_uint64_t, void *);14.4394 + bfd_vma (*bfd_getx32) (const void *);14.4395 + bfd_signed_vma (*bfd_getx_signed_32) (const void *);14.4396 + void (*bfd_putx32) (bfd_vma, void *);14.4397 + bfd_vma (*bfd_getx16) (const void *);14.4398 + bfd_signed_vma (*bfd_getx_signed_16) (const void *);14.4399 + void (*bfd_putx16) (bfd_vma, void *);14.4400 +14.4401 + /* Byte swapping for the headers. */14.4402 + bfd_uint64_t (*bfd_h_getx64) (const void *);14.4403 + bfd_int64_t (*bfd_h_getx_signed_64) (const void *);14.4404 + void (*bfd_h_putx64) (bfd_uint64_t, void *);14.4405 + bfd_vma (*bfd_h_getx32) (const void *);14.4406 + bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);14.4407 + void (*bfd_h_putx32) (bfd_vma, void *);14.4408 + bfd_vma (*bfd_h_getx16) (const void *);14.4409 + bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);14.4410 + void (*bfd_h_putx16) (bfd_vma, void *);14.4411 +14.4412 + /* Format dependent routines: these are vectors of entry points14.4413 + within the target vector structure, one for each format to check. */14.4414 +14.4415 + /* Check the format of a file being read. Return a <<bfd_target *>> or zero. */14.4416 + const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);14.4417 +14.4418 + /* Set the format of a file being written. */14.4419 + bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);14.4420 +14.4421 + /* Write cached information into a file being written, at <<bfd_close>>. */14.4422 + bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);14.4423 +14.4424 +14.4425 + /* Generic entry points. */14.4426 +#define BFD_JUMP_TABLE_GENERIC(NAME) \14.4427 + NAME##_close_and_cleanup, \14.4428 + NAME##_bfd_free_cached_info, \14.4429 + NAME##_new_section_hook, \14.4430 + NAME##_get_section_contents, \14.4431 + NAME##_get_section_contents_in_window14.4432 +14.4433 + /* Called when the BFD is being closed to do any necessary cleanup. */14.4434 + bfd_boolean (*_close_and_cleanup) (bfd *);14.4435 + /* Ask the BFD to free all cached information. */14.4436 + bfd_boolean (*_bfd_free_cached_info) (bfd *);14.4437 + /* Called when a new section is created. */14.4438 + bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);14.4439 + /* Read the contents of a section. */14.4440 + bfd_boolean (*_bfd_get_section_contents)14.4441 + (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);14.4442 + bfd_boolean (*_bfd_get_section_contents_in_window)14.4443 + (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);14.4444 +14.4445 + /* Entry points to copy private data. */14.4446 +#define BFD_JUMP_TABLE_COPY(NAME) \14.4447 + NAME##_bfd_copy_private_bfd_data, \14.4448 + NAME##_bfd_merge_private_bfd_data, \14.4449 + NAME##_bfd_copy_private_section_data, \14.4450 + NAME##_bfd_copy_private_symbol_data, \14.4451 + NAME##_bfd_copy_private_header_data, \14.4452 + NAME##_bfd_set_private_flags, \14.4453 + NAME##_bfd_print_private_bfd_data14.4454 +14.4455 + /* Called to copy BFD general private data from one object file14.4456 + to another. */14.4457 + bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);14.4458 + /* Called to merge BFD general private data from one object file14.4459 + to a common output file when linking. */14.4460 + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);14.4461 + /* Called to copy BFD private section data from one object file14.4462 + to another. */14.4463 + bfd_boolean (*_bfd_copy_private_section_data)14.4464 + (bfd *, sec_ptr, bfd *, sec_ptr);14.4465 + /* Called to copy BFD private symbol data from one symbol14.4466 + to another. */14.4467 + bfd_boolean (*_bfd_copy_private_symbol_data)14.4468 + (bfd *, asymbol *, bfd *, asymbol *);14.4469 + /* Called to copy BFD private header data from one object file14.4470 + to another. */14.4471 + bfd_boolean (*_bfd_copy_private_header_data)14.4472 + (bfd *, bfd *);14.4473 + /* Called to set private backend flags. */14.4474 + bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);14.4475 +14.4476 + /* Called to print private BFD data. */14.4477 + bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);14.4478 +14.4479 + /* Core file entry points. */14.4480 +#define BFD_JUMP_TABLE_CORE(NAME) \14.4481 + NAME##_core_file_failing_command, \14.4482 + NAME##_core_file_failing_signal, \14.4483 + NAME##_core_file_matches_executable_p14.4484 +14.4485 + char * (*_core_file_failing_command) (bfd *);14.4486 + int (*_core_file_failing_signal) (bfd *);14.4487 + bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);14.4488 +14.4489 + /* Archive entry points. */14.4490 +#define BFD_JUMP_TABLE_ARCHIVE(NAME) \14.4491 + NAME##_slurp_armap, \14.4492 + NAME##_slurp_extended_name_table, \14.4493 + NAME##_construct_extended_name_table, \14.4494 + NAME##_truncate_arname, \14.4495 + NAME##_write_armap, \14.4496 + NAME##_read_ar_hdr, \14.4497 + NAME##_openr_next_archived_file, \14.4498 + NAME##_get_elt_at_index, \14.4499 + NAME##_generic_stat_arch_elt, \14.4500 + NAME##_update_armap_timestamp14.4501 +14.4502 + bfd_boolean (*_bfd_slurp_armap) (bfd *);14.4503 + bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);14.4504 + bfd_boolean (*_bfd_construct_extended_name_table)14.4505 + (bfd *, char **, bfd_size_type *, const char **);14.4506 + void (*_bfd_truncate_arname) (bfd *, const char *, char *);14.4507 + bfd_boolean (*write_armap)14.4508 + (bfd *, unsigned int, struct orl *, unsigned int, int);14.4509 + void * (*_bfd_read_ar_hdr_fn) (bfd *);14.4510 + bfd * (*openr_next_archived_file) (bfd *, bfd *);14.4511 +#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))14.4512 + bfd * (*_bfd_get_elt_at_index) (bfd *, symindex);14.4513 + int (*_bfd_stat_arch_elt) (bfd *, struct stat *);14.4514 + bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);14.4515 +14.4516 + /* Entry points used for symbols. */14.4517 +#define BFD_JUMP_TABLE_SYMBOLS(NAME) \14.4518 + NAME##_get_symtab_upper_bound, \14.4519 + NAME##_canonicalize_symtab, \14.4520 + NAME##_make_empty_symbol, \14.4521 + NAME##_print_symbol, \14.4522 + NAME##_get_symbol_info, \14.4523 + NAME##_bfd_is_local_label_name, \14.4524 + NAME##_bfd_is_target_special_symbol, \14.4525 + NAME##_get_lineno, \14.4526 + NAME##_find_nearest_line, \14.4527 + NAME##_bfd_make_debug_symbol, \14.4528 + NAME##_read_minisymbols, \14.4529 + NAME##_minisymbol_to_symbol14.4530 +14.4531 + long (*_bfd_get_symtab_upper_bound) (bfd *);14.4532 + long (*_bfd_canonicalize_symtab)14.4533 + (bfd *, struct bfd_symbol **);14.4534 + struct bfd_symbol *14.4535 + (*_bfd_make_empty_symbol) (bfd *);14.4536 + void (*_bfd_print_symbol)14.4537 + (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);14.4538 +#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))14.4539 + void (*_bfd_get_symbol_info)14.4540 + (bfd *, struct bfd_symbol *, symbol_info *);14.4541 +#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))14.4542 + bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);14.4543 + bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);14.4544 + alent * (*_get_lineno) (bfd *, struct bfd_symbol *);14.4545 + bfd_boolean (*_bfd_find_nearest_line)14.4546 + (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,14.4547 + const char **, const char **, unsigned int *);14.4548 + /* Back-door to allow format-aware applications to create debug symbols14.4549 + while using BFD for everything else. Currently used by the assembler14.4550 + when creating COFF files. */14.4551 + asymbol * (*_bfd_make_debug_symbol)14.4552 + (bfd *, void *, unsigned long size);14.4553 +#define bfd_read_minisymbols(b, d, m, s) \14.4554 + BFD_SEND (b, _read_minisymbols, (b, d, m, s))14.4555 + long (*_read_minisymbols)14.4556 + (bfd *, bfd_boolean, void **, unsigned int *);14.4557 +#define bfd_minisymbol_to_symbol(b, d, m, f) \14.4558 + BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))14.4559 + asymbol * (*_minisymbol_to_symbol)14.4560 + (bfd *, bfd_boolean, const void *, asymbol *);14.4561 +14.4562 + /* Routines for relocs. */14.4563 +#define BFD_JUMP_TABLE_RELOCS(NAME) \14.4564 + NAME##_get_reloc_upper_bound, \14.4565 + NAME##_canonicalize_reloc, \14.4566 + NAME##_bfd_reloc_type_lookup14.4567 +14.4568 + long (*_get_reloc_upper_bound) (bfd *, sec_ptr);14.4569 + long (*_bfd_canonicalize_reloc)14.4570 + (bfd *, sec_ptr, arelent **, struct bfd_symbol **);14.4571 + /* See documentation on reloc types. */14.4572 + reloc_howto_type *14.4573 + (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);14.4574 +14.4575 + /* Routines used when writing an object file. */14.4576 +#define BFD_JUMP_TABLE_WRITE(NAME) \14.4577 + NAME##_set_arch_mach, \14.4578 + NAME##_set_section_contents14.4579 +14.4580 + bfd_boolean (*_bfd_set_arch_mach)14.4581 + (bfd *, enum bfd_architecture, unsigned long);14.4582 + bfd_boolean (*_bfd_set_section_contents)14.4583 + (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);14.4584 +14.4585 + /* Routines used by the linker. */14.4586 +#define BFD_JUMP_TABLE_LINK(NAME) \14.4587 + NAME##_sizeof_headers, \14.4588 + NAME##_bfd_get_relocated_section_contents, \14.4589 + NAME##_bfd_relax_section, \14.4590 + NAME##_bfd_link_hash_table_create, \14.4591 + NAME##_bfd_link_hash_table_free, \14.4592 + NAME##_bfd_link_add_symbols, \14.4593 + NAME##_bfd_link_just_syms, \14.4594 + NAME##_bfd_final_link, \14.4595 + NAME##_bfd_link_split_section, \14.4596 + NAME##_bfd_gc_sections, \14.4597 + NAME##_bfd_merge_sections, \14.4598 + NAME##_bfd_is_group_section, \14.4599 + NAME##_bfd_discard_group, \14.4600 + NAME##_section_already_linked \14.4601 +14.4602 + int (*_bfd_sizeof_headers) (bfd *, bfd_boolean);14.4603 + bfd_byte * (*_bfd_get_relocated_section_contents)14.4604 + (bfd *, struct bfd_link_info *, struct bfd_link_order *,14.4605 + bfd_byte *, bfd_boolean, struct bfd_symbol **);14.4606 +14.4607 + bfd_boolean (*_bfd_relax_section)14.4608 + (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);14.4609 +14.4610 + /* Create a hash table for the linker. Different backends store14.4611 + different information in this table. */14.4612 + struct bfd_link_hash_table *14.4613 + (*_bfd_link_hash_table_create) (bfd *);14.4614 +14.4615 + /* Release the memory associated with the linker hash table. */14.4616 + void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);14.4617 +14.4618 + /* Add symbols from this object file into the hash table. */14.4619 + bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);14.4620 +14.4621 + /* Indicate that we are only retrieving symbol values from this section. */14.4622 + void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);14.4623 +14.4624 + /* Do a link based on the link_order structures attached to each14.4625 + section of the BFD. */14.4626 + bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);14.4627 +14.4628 + /* Should this section be split up into smaller pieces during linking. */14.4629 + bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);14.4630 +14.4631 + /* Remove sections that are not referenced from the output. */14.4632 + bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);14.4633 +14.4634 + /* Attempt to merge SEC_MERGE sections. */14.4635 + bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);14.4636 +14.4637 + /* Is this section a member of a group? */14.4638 + bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);14.4639 +14.4640 + /* Discard members of a group. */14.4641 + bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);14.4642 +14.4643 + /* Check if SEC has been already linked during a reloceatable or14.4644 + final link. */14.4645 + void (*_section_already_linked) (bfd *, struct bfd_section *);14.4646 +14.4647 + /* Routines to handle dynamic symbols and relocs. */14.4648 +#define BFD_JUMP_TABLE_DYNAMIC(NAME) \14.4649 + NAME##_get_dynamic_symtab_upper_bound, \14.4650 + NAME##_canonicalize_dynamic_symtab, \14.4651 + NAME##_get_synthetic_symtab, \14.4652 + NAME##_get_dynamic_reloc_upper_bound, \14.4653 + NAME##_canonicalize_dynamic_reloc14.4654 +14.4655 + /* Get the amount of memory required to hold the dynamic symbols. */14.4656 + long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);14.4657 + /* Read in the dynamic symbols. */14.4658 + long (*_bfd_canonicalize_dynamic_symtab)14.4659 + (bfd *, struct bfd_symbol **);14.4660 + /* Create synthetized symbols. */14.4661 + long (*_bfd_get_synthetic_symtab)14.4662 + (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,14.4663 + struct bfd_symbol **);14.4664 + /* Get the amount of memory required to hold the dynamic relocs. */14.4665 + long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);14.4666 + /* Read in the dynamic relocs. */14.4667 + long (*_bfd_canonicalize_dynamic_reloc)14.4668 + (bfd *, arelent **, struct bfd_symbol **);14.4669 +14.4670 + /* Opposite endian version of this target. */14.4671 + const struct bfd_target * alternative_target;14.4672 +14.4673 + /* Data for use by back-end routines, which isn't14.4674 + generic enough to belong in this structure. */14.4675 + const void *backend_data;14.4676 +14.4677 +} bfd_target;14.4678 +14.4679 +bfd_boolean bfd_set_default_target (const char *name);14.4680 +14.4681 +const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);14.4682 +14.4683 +const char ** bfd_target_list (void);14.4684 +14.4685 +const bfd_target *bfd_search_for_target14.4686 + (int (*search_func) (const bfd_target *, void *),14.4687 + void *);14.4688 +14.4689 +/* Extracted from format.c. */14.4690 +bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);14.4691 +14.4692 +bfd_boolean bfd_check_format_matches14.4693 + (bfd *abfd, bfd_format format, char ***matching);14.4694 +14.4695 +bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);14.4696 +14.4697 +const char *bfd_format_string (bfd_format format);14.4698 +14.4699 +/* Extracted from linker.c. */14.4700 +bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);14.4701 +14.4702 +#define bfd_link_split_section(abfd, sec) \14.4703 + BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))14.4704 +14.4705 +void bfd_section_already_linked (bfd *abfd, asection *sec);14.4706 +14.4707 +#define bfd_section_already_linked(abfd, sec) \14.4708 + BFD_SEND (abfd, _section_already_linked, (abfd, sec))14.4709 +14.4710 +/* Extracted from simple.c. */14.4711 +bfd_byte *bfd_simple_get_relocated_section_contents14.4712 + (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);14.4713 +14.4714 +#ifdef __cplusplus14.4715 +}14.4716 +#endif14.4717 +#endif
15.1 --- /dev/null Thu Jan 01 00:00:00 1970 +000015.2 +++ b/src/xlat/disasm/dis-asm.h Tue Mar 06 12:19:08 2012 +100015.3 @@ -0,0 +1,333 @@15.4 +/* Interface between the opcode library and its callers.15.5 +15.6 + Copyright 1999, 2000, 2001, 2002, 2003, 2004, 200515.7 + Free Software Foundation, Inc.15.8 +15.9 + This program is free software; you can redistribute it and/or modify15.10 + it under the terms of the GNU General Public License as published by15.11 + the Free Software Foundation; either version 2, or (at your option)15.12 + any later version.15.13 +15.14 + This program is distributed in the hope that it will be useful,15.15 + but WITHOUT ANY WARRANTY; without even the implied warranty of15.16 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15.17 + GNU General Public License for more details.15.18 +15.19 + You should have received a copy of the GNU General Public License15.20 + along with this program; if not, write to the Free Software15.21 + Foundation, Inc., 59 Temple Place - Suite 330,15.22 + Boston, MA 02111-1307, USA.15.23 +15.24 + Written by Cygnus Support, 1993.15.25 +15.26 + The opcode library (libopcodes.a) provides instruction decoders for15.27 + a large variety of instruction sets, callable with an identical15.28 + interface, for making instruction-processing programs more independent15.29 + of the instruction set being processed. */15.30 +15.31 +#ifndef DIS_ASM_H15.32 +#define DIS_ASM_H15.33 +15.34 +#ifdef __cplusplus15.35 +extern "C" {15.36 +#endif15.37 +15.38 +#include <stdio.h>15.39 +#include "xlat/disasm/bfd.h"15.40 +15.41 +typedef int (*fprintf_ftype) (void *, const char*, ...);15.42 +15.43 +enum dis_insn_type {15.44 + dis_noninsn, /* Not a valid instruction */15.45 + dis_nonbranch, /* Not a branch instruction */15.46 + dis_branch, /* Unconditional branch */15.47 + dis_condbranch, /* Conditional branch */15.48 + dis_jsr, /* Jump to subroutine */15.49 + dis_condjsr, /* Conditional jump to subroutine */15.50 + dis_dref, /* Data reference instruction */15.51 + dis_dref2 /* Two data references in instruction */15.52 +};15.53 +15.54 +/* This struct is passed into the instruction decoding routine,15.55 + and is passed back out into each callback. The various fields are used15.56 + for conveying information from your main routine into your callbacks,15.57 + for passing information into the instruction decoders (such as the15.58 + addresses of the callback functions), or for passing information15.59 + back from the instruction decoders to their callers.15.60 +15.61 + It must be initialized before it is first passed; this can be done15.62 + by hand, or using one of the initialization macros below. */15.63 +15.64 +typedef struct disassemble_info {15.65 + fprintf_ftype fprintf_func;15.66 + void *stream;15.67 + void *application_data;15.68 +15.69 + /* Target description. We could replace this with a pointer to the bfd,15.70 + but that would require one. There currently isn't any such requirement15.71 + so to avoid introducing one we record these explicitly. */15.72 + /* The bfd_flavour. This can be bfd_target_unknown_flavour. */15.73 + enum bfd_flavour flavour;15.74 + /* The bfd_arch value. */15.75 + enum bfd_architecture arch;15.76 + /* The bfd_mach value. */15.77 + unsigned long mach;15.78 + /* Endianness (for bi-endian cpus). Mono-endian cpus can ignore this. */15.79 + enum bfd_endian endian;15.80 + /* An arch/mach-specific bitmask of selected instruction subsets, mainly15.81 + for processors with run-time-switchable instruction sets. The default,15.82 + zero, means that there is no constraint. CGEN-based opcodes ports15.83 + may use ISA_foo masks. */15.84 + unsigned long insn_sets;15.85 +15.86 + /* Some targets need information about the current section to accurately15.87 + display insns. If this is NULL, the target disassembler function15.88 + will have to make its best guess. */15.89 + asection *section;15.90 +15.91 + /* An array of pointers to symbols either at the location being disassembled15.92 + or at the start of the function being disassembled. The array is sorted15.93 + so that the first symbol is intended to be the one used. The others are15.94 + present for any misc. purposes. This is not set reliably, but if it is15.95 + not NULL, it is correct. */15.96 + asymbol **symbols;15.97 + /* Number of symbols in array. */15.98 + int num_symbols;15.99 +15.100 + /* For use by the disassembler.15.101 + The top 16 bits are reserved for public use (and are documented here).15.102 + The bottom 16 bits are for the internal use of the disassembler. */15.103 + unsigned long flags;15.104 +#define INSN_HAS_RELOC 0x8000000015.105 + void *private_data;15.106 +15.107 + /* Function used to get bytes to disassemble. MEMADDR is the15.108 + address of the stuff to be disassembled, MYADDR is the address to15.109 + put the bytes in, and LENGTH is the number of bytes to read.15.110 + INFO is a pointer to this struct.15.111 + Returns an errno value or 0 for success. */15.112 + int (*read_memory_func)15.113 + (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,15.114 + struct disassemble_info *info);15.115 +15.116 + /* Function which should be called if we get an error that we can't15.117 + recover from. STATUS is the errno value from read_memory_func and15.118 + MEMADDR is the address that we were trying to read. INFO is a15.119 + pointer to this struct. */15.120 + void (*memory_error_func)15.121 + (int status, bfd_vma memaddr, struct disassemble_info *info);15.122 +15.123 + /* Function called to print ADDR. */15.124 + void (*print_address_func)15.125 + (bfd_vma addr, struct disassemble_info *info);15.126 +15.127 + /* Function called to determine if there is a symbol at the given ADDR.15.128 + If there is, the function returns 1, otherwise it returns 0.15.129 + This is used by ports which support an overlay manager where15.130 + the overlay number is held in the top part of an address. In15.131 + some circumstances we want to include the overlay number in the15.132 + address, (normally because there is a symbol associated with15.133 + that address), but sometimes we want to mask out the overlay bits. */15.134 + int (* symbol_at_address_func)15.135 + (bfd_vma addr, struct disassemble_info * info);15.136 +15.137 + /* Function called to check if a SYMBOL is can be displayed to the user.15.138 + This is used by some ports that want to hide special symbols when15.139 + displaying debugging outout. */15.140 + bfd_boolean (* symbol_is_valid)15.141 + (asymbol *, struct disassemble_info * info);15.142 +15.143 + /* These are for buffer_read_memory. */15.144 + bfd_byte *buffer;15.145 + bfd_vma buffer_vma;15.146 + unsigned int buffer_length;15.147 +15.148 + /* This variable may be set by the instruction decoder. It suggests15.149 + the number of bytes objdump should display on a single line. If15.150 + the instruction decoder sets this, it should always set it to15.151 + the same value in order to get reasonable looking output. */15.152 + int bytes_per_line;15.153 +15.154 + /* The next two variables control the way objdump displays the raw data. */15.155 + /* For example, if bytes_per_line is 8 and bytes_per_chunk is 4, the */15.156 + /* output will look like this:15.157 + 00: 00000000 0000000015.158 + with the chunks displayed according to "display_endian". */15.159 + int bytes_per_chunk;15.160 + enum bfd_endian display_endian;15.161 +15.162 + /* Number of octets per incremented target address15.163 + Normally one, but some DSPs have byte sizes of 16 or 32 bits. */15.164 + unsigned int octets_per_byte;15.165 +15.166 + /* The number of zeroes we want to see at the end of a section before we15.167 + start skipping them. */15.168 + unsigned int skip_zeroes;15.169 +15.170 + /* The number of zeroes to skip at the end of a section. If the number15.171 + of zeroes at the end is between SKIP_ZEROES_AT_END and SKIP_ZEROES,15.172 + they will be disassembled. If there are fewer than15.173 + SKIP_ZEROES_AT_END, they will be skipped. This is a heuristic15.174 + attempt to avoid disassembling zeroes inserted by section15.175 + alignment. */15.176 + unsigned int skip_zeroes_at_end;15.177 +15.178 + /* Results from instruction decoders. Not all decoders yet support15.179 + this information. This info is set each time an instruction is15.180 + decoded, and is only valid for the last such instruction.15.181 +15.182 + To determine whether this decoder supports this information, set15.183 + insn_info_valid to 0, decode an instruction, then check it. */15.184 +15.185 + char insn_info_valid; /* Branch info has been set. */15.186 + char branch_delay_insns; /* How many sequential insn's will run before15.187 + a branch takes effect. (0 = normal) */15.188 + char data_size; /* Size of data reference in insn, in bytes */15.189 + enum dis_insn_type insn_type; /* Type of instruction */15.190 + bfd_vma target; /* Target address of branch or dref, if known;15.191 + zero if unknown. */15.192 + bfd_vma target2; /* Second target address for dref2 */15.193 +15.194 + /* Command line options specific to the target disassembler. */15.195 + char * disassembler_options;15.196 +15.197 +} disassemble_info;15.198 +15.199 +15.200 +/* Standard disassemblers. Disassemble one instruction at the given15.201 + target address. Return number of octets processed. */15.202 +typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);15.203 +15.204 +extern int print_insn_big_mips (bfd_vma, disassemble_info *);15.205 +extern int print_insn_little_mips (bfd_vma, disassemble_info *);15.206 +extern int print_insn_i386 (bfd_vma, disassemble_info *);15.207 +extern int print_insn_i386_att (bfd_vma, disassemble_info *);15.208 +extern int print_insn_i386_intel (bfd_vma, disassemble_info *);15.209 +extern int print_insn_ia64 (bfd_vma, disassemble_info *);15.210 +extern int print_insn_i370 (bfd_vma, disassemble_info *);15.211 +extern int print_insn_m68hc11 (bfd_vma, disassemble_info *);15.212 +extern int print_insn_m68hc12 (bfd_vma, disassemble_info *);15.213 +extern int print_insn_m68k (bfd_vma, disassemble_info *);15.214 +extern int print_insn_z8001 (bfd_vma, disassemble_info *);15.215 +extern int print_insn_z8002 (bfd_vma, disassemble_info *);15.216 +extern int print_insn_h8300 (bfd_vma, disassemble_info *);15.217 +extern int print_insn_h8300h (bfd_vma, disassemble_info *);15.218 +extern int print_insn_h8300s (bfd_vma, disassemble_info *);15.219 +extern int print_insn_h8500 (bfd_vma, disassemble_info *);15.220 +extern int print_insn_alpha (bfd_vma, disassemble_info *);15.221 +extern int print_insn_big_arm (bfd_vma, disassemble_info *);15.222 +extern int print_insn_little_arm (bfd_vma, disassemble_info *);15.223 +extern int print_insn_sparc (bfd_vma, disassemble_info *);15.224 +extern int print_insn_big_a29k (bfd_vma, disassemble_info *);15.225 +extern int print_insn_little_a29k (bfd_vma, disassemble_info *);15.226 +extern int print_insn_avr (bfd_vma, disassemble_info *);15.227 +extern int print_insn_d10v (bfd_vma, disassemble_info *);15.228 +extern int print_insn_d30v (bfd_vma, disassemble_info *);15.229 +extern int print_insn_dlx (bfd_vma, disassemble_info *);15.230 +extern int print_insn_fr30 (bfd_vma, disassemble_info *);15.231 +extern int print_insn_hppa (bfd_vma, disassemble_info *);15.232 +extern int print_insn_i860 (bfd_vma, disassemble_info *);15.233 +extern int print_insn_i960 (bfd_vma, disassemble_info *);15.234 +extern int print_insn_ip2k (bfd_vma, disassemble_info *);15.235 +extern int print_insn_m32r (bfd_vma, disassemble_info *);15.236 +extern int print_insn_m88k (bfd_vma, disassemble_info *);15.237 +extern int print_insn_maxq_little (bfd_vma, disassemble_info *);15.238 +extern int print_insn_maxq_big (bfd_vma, disassemble_info *);15.239 +extern int print_insn_mcore (bfd_vma, disassemble_info *);15.240 +extern int print_insn_mmix (bfd_vma, disassemble_info *);15.241 +extern int print_insn_mn10200 (bfd_vma, disassemble_info *);15.242 +extern int print_insn_mn10300 (bfd_vma, disassemble_info *);15.243 +extern int print_insn_msp430 (bfd_vma, disassemble_info *);15.244 +extern int print_insn_ns32k (bfd_vma, disassemble_info *);15.245 +extern int print_insn_crx (bfd_vma, disassemble_info *);15.246 +extern int print_insn_openrisc (bfd_vma, disassemble_info *);15.247 +extern int print_insn_big_or32 (bfd_vma, disassemble_info *);15.248 +extern int print_insn_little_or32 (bfd_vma, disassemble_info *);15.249 +extern int print_insn_pdp11 (bfd_vma, disassemble_info *);15.250 +extern int print_insn_pj (bfd_vma, disassemble_info *);15.251 +extern int print_insn_big_powerpc (bfd_vma, disassemble_info *);15.252 +extern int print_insn_little_powerpc (bfd_vma, disassemble_info *);15.253 +extern int print_insn_rs6000 (bfd_vma, disassemble_info *);15.254 +extern int print_insn_s390 (bfd_vma, disassemble_info *);15.255 +extern int print_insn_sh (bfd_vma, disassemble_info *);15.256 +extern int print_insn_tic30 (bfd_vma, disassemble_info *);15.257 +extern int print_insn_tic4x (bfd_vma, disassemble_info *);15.258 +extern int print_insn_tic54x (bfd_vma, disassemble_info *);15.259 +extern int print_insn_tic80 (bfd_vma, disassemble_info *);15.260 +extern int print_insn_v850 (bfd_vma, disassemble_info *);15.261 +extern int print_insn_vax (bfd_vma, disassemble_info *);15.262 +extern int print_insn_w65 (bfd_vma, disassemble_info *);15.263 +extern int print_insn_xstormy16 (bfd_vma, disassemble_info *);15.264 +extern int print_insn_xtensa (bfd_vma, disassemble_info *);15.265 +extern int print_insn_sh64 (bfd_vma, disassemble_info *);15.266 +extern int print_insn_sh64x_media (bfd_vma, disassemble_info *);15.267 +extern int print_insn_frv (bfd_vma, disassemble_info *);15.268 +extern int print_insn_iq2000 (bfd_vma, disassemble_info *);15.269 +15.270 +extern disassembler_ftype arc_get_disassembler (void *);15.271 +extern disassembler_ftype cris_get_disassembler (bfd *);15.272 +15.273 +extern void print_mips_disassembler_options (FILE *);15.274 +extern void print_ppc_disassembler_options (FILE *);15.275 +extern void print_arm_disassembler_options (FILE *);15.276 +extern void parse_arm_disassembler_option (char *);15.277 +extern int get_arm_regname_num_options (void);15.278 +extern int set_arm_regname_option (int);15.279 +extern int get_arm_regnames (int, const char **, const char **, const char ***);15.280 +extern bfd_boolean arm_symbol_is_valid (asymbol *, struct disassemble_info *);15.281 +15.282 +/* Fetch the disassembler for a given BFD, if that support is available. */15.283 +extern disassembler_ftype disassembler (bfd *);15.284 +15.285 +/* Amend the disassemble_info structure as necessary for the target architecture.15.286 + Should only be called after initialising the info->arch field. */15.287 +extern void disassemble_init_for_target (struct disassemble_info * info);15.288 +15.289 +/* Document any target specific options available from the disassembler. */15.290 +extern void disassembler_usage (FILE *);15.291 +15.292 +15.293 +/* This block of definitions is for particular callers who read instructions15.294 + into a buffer before calling the instruction decoder. */15.295 +15.296 +/* Here is a function which callers may wish to use for read_memory_func.15.297 + It gets bytes from a buffer. */15.298 +extern int buffer_read_memory15.299 + (bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *);15.300 +15.301 +/* This function goes with buffer_read_memory.15.302 + It prints a message using info->fprintf_func and info->stream. */15.303 +extern void perror_memory (int, bfd_vma, struct disassemble_info *);15.304 +15.305 +15.306 +/* Just print the address in hex. This is included for completeness even15.307 + though both GDB and objdump provide their own (to print symbolic15.308 + addresses). */15.309 +extern void generic_print_address15.310 + (bfd_vma, struct disassemble_info *);15.311 +15.312 +/* Always true. */15.313 +extern int generic_symbol_at_address15.314 + (bfd_vma, struct disassemble_info *);15.315 +15.316 +/* Also always true. */15.317 +extern bfd_boolean generic_symbol_is_valid15.318 + (asymbol *, struct disassemble_info *);15.319 +15.320 +/* Method to initialize a disassemble_info struct. This should be15.321 + called by all applications creating such a struct. */15.322 +extern void init_disassemble_info (struct disassemble_info *info, void *stream,15.323 + fprintf_ftype fprintf_func);15.324 +15.325 +/* For compatibility with existing code. */15.326 +#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \15.327 + init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))15.328 +#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \15.329 + init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))15.330 +15.331 +15.332 +#ifdef __cplusplus15.333 +}15.334 +#endif15.335 +15.336 +#endif /* ! defined (DIS_ASM_H) */
16.1 --- /dev/null Thu Jan 01 00:00:00 1970 +000016.2 +++ b/src/xlat/disasm/dis-buf.c Tue Mar 06 12:19:08 2012 +100016.3 @@ -0,0 +1,126 @@16.4 +/* Disassemble from a buffer, for GNU.16.5 + Copyright 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 200516.6 + Free Software Foundation, Inc.16.7 +16.8 +This program is free software; you can redistribute it and/or modify16.9 +it under the terms of the GNU General Public License as published by16.10 +the Free Software Foundation; either version 2 of the License, or16.11 +(at your option) any later version.16.12 +16.13 +This program is distributed in the hope that it will be useful,16.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of16.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16.16 +GNU General Public License for more details.16.17 +16.18 +You should have received a copy of the GNU General Public License16.19 +along with this program; if not, write to the Free Software16.20 +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */16.21 +16.22 +#include "xlat/disasm/sysdep.h"16.23 +#include "xlat/disasm/dis-asm.h"16.24 +#include <errno.h>16.25 +#include "gettext.h"16.26 +16.27 +/* Get LENGTH bytes from info's buffer, at target address memaddr.16.28 + Transfer them to myaddr. */16.29 +int16.30 +buffer_read_memory (memaddr, myaddr, length, info)16.31 + bfd_vma memaddr;16.32 + bfd_byte *myaddr;16.33 + unsigned int length;16.34 + struct disassemble_info *info;16.35 +{16.36 + unsigned int opb = info->octets_per_byte;16.37 + uintptr_t octets = memaddr * opb;16.38 +16.39 + memcpy (myaddr, info->buffer + octets, length);16.40 +16.41 + return 0;16.42 +}16.43 +16.44 +/* Print an error message. We can assume that this is in response to16.45 + an error return from buffer_read_memory. */16.46 +void16.47 +perror_memory (status, memaddr, info)16.48 + int status;16.49 + bfd_vma memaddr;16.50 + struct disassemble_info *info;16.51 +{16.52 + if (status != EIO)16.53 + /* Can't happen. */16.54 + info->fprintf_func (info->stream, _("Unknown error %d\n"), status);16.55 + else16.56 + {16.57 + char buf[30];16.58 +16.59 + /* Actually, address between memaddr and memaddr + len was16.60 + out of bounds. */16.61 + sprintf_vma (buf, memaddr);16.62 + info->fprintf_func (info->stream,16.63 + _("Address 0x%s is out of bounds.\n"), buf);16.64 + }16.65 +}16.66 +16.67 +/* This could be in a separate file, to save miniscule amounts of space16.68 + in statically linked executables. */16.69 +16.70 +/* Just print the address is hex. This is included for completeness even16.71 + though both GDB and objdump provide their own (to print symbolic16.72 + addresses). */16.73 +16.74 +void16.75 +generic_print_address (addr, info)16.76 + bfd_vma addr;16.77 + struct disassemble_info *info;16.78 +{16.79 + char buf[30];16.80 +16.81 + sprintf_vma (buf, addr);16.82 + (*info->fprintf_func) (info->stream, "0x%s", buf);16.83 +}16.84 +16.85 +#if 016.86 +/* Just concatenate the address as hex. This is included for16.87 + completeness even though both GDB and objdump provide their own (to16.88 + print symbolic addresses). */16.89 +16.90 +void generic_strcat_address PARAMS ((bfd_vma, char *, int));16.91 +16.92 +void16.93 +generic_strcat_address (addr, buf, len)16.94 + bfd_vma addr;16.95 + char *buf;16.96 + int len;16.97 +{16.98 + if (buf != (char *)NULL && len > 0)16.99 + {16.100 + char tmpBuf[30];16.101 +16.102 + sprintf_vma (tmpBuf, addr);16.103 + if ((strlen (buf) + strlen (tmpBuf)) <= (unsigned int) len)16.104 + strcat (buf, tmpBuf);16.105 + else16.106 + strncat (buf, tmpBuf, (len - strlen(buf)));16.107 + }16.108 + return;16.109 +}16.110 +#endif16.111 +16.112 +/* Just return true. */16.113 +16.114 +int16.115 +generic_symbol_at_address (addr, info)16.116 + bfd_vma addr ATTRIBUTE_UNUSED;16.117 + struct disassemble_info *info ATTRIBUTE_UNUSED;16.118 +{16.119 + return 1;16.120 +}16.121 +16.122 +/* Just return TRUE. */16.123 +16.124 +bfd_boolean16.125 +generic_symbol_is_valid (asymbol * sym ATTRIBUTE_UNUSED,16.126 + struct disassemble_info *info ATTRIBUTE_UNUSED)16.127 +{16.128 + return TRUE;16.129 +}
17.1 --- /dev/null Thu Jan 01 00:00:00 1970 +000017.2 +++ b/src/xlat/disasm/dis-init.c Tue Mar 06 12:19:08 2012 +100017.3 @@ -0,0 +1,43 @@17.4 +/* Initialize "struct disassemble_info".17.5 +17.6 + Copyright 2003 Free Software Foundation, Inc.17.7 +17.8 + This program is free software; you can redistribute it and/or17.9 + modify it under the terms of the GNU General Public License as17.10 + published by the Free Software Foundation; either version 2 of the17.11 + License, or (at your option) any later version.17.12 +17.13 + This program is distributed in the hope that it will be useful, but17.14 + WITHOUT ANY WARRANTY; without even the implied warranty of17.15 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU17.16 + General Public License for more details.17.17 +17.18 + You should have received a copy of the GNU General Public License17.19 + along with this program; if not, write to the Free Software17.20 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA17.21 + 02111-1307, USA. */17.22 +17.23 +#include "xlat/disasm/sysdep.h"17.24 +#include "xlat/disasm/dis-asm.h"17.25 +#include "xlat/disasm/bfd.h"17.26 +17.27 +void17.28 +init_disassemble_info (struct disassemble_info *info, void *stream,17.29 + fprintf_ftype fprintf_func)17.30 +{17.31 + memset (info, 0, sizeof (*info));17.32 +17.33 + info->flavour = bfd_target_unknown_flavour;17.34 + info->arch = bfd_arch_unknown;17.35 + info->endian = BFD_ENDIAN_UNKNOWN;17.36 + info->octets_per_byte = 1;17.37 + info->fprintf_func = fprintf_func;17.38 + info->stream = stream;17.39 + info->read_memory_func = buffer_read_memory;17.40 + info->memory_error_func = perror_memory;17.41 + info->print_address_func = generic_print_address;17.42 + info->symbol_at_address_func = generic_symbol_at_address;17.43 + info->symbol_is_valid = generic_symbol_is_valid;17.44 + info->display_endian = BFD_ENDIAN_UNKNOWN;17.45 +}17.46 +
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +000018.2 +++ b/src/xlat/disasm/i386-dis.c Tue Mar 06 12:19:08 2012 +100018.3 @@ -0,0 +1,4379 @@18.4 +/* Print i386 instructions for GDB, the GNU debugger.18.5 + Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,18.6 + 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.18.7 +18.8 + This file is part of GDB.18.9 +18.10 + This program is free software; you can redistribute it and/or modify18.11 + it under the terms of the GNU General Public License as published by18.12 + the Free Software Foundation; either version 2 of the License, or18.13 + (at your option) any later version.18.14 +18.15 + This program is distributed in the hope that it will be useful,18.16 + but WITHOUT ANY WARRANTY; without even the implied warranty of18.17 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the18.18 + GNU General Public License for more details.18.19 +18.20 + You should have received a copy of the GNU General Public License18.21 + along with this program; if not, write to the Free Software18.22 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */18.23 +18.24 +/* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)18.25 + July 198818.26 + modified by John Hassey (hassey@dg-rtp.dg.com)18.27 + x86-64 support added by Jan Hubicka (jh@suse.cz)18.28 + VIA PadLock support by Michal Ludvig (mludvig@suse.cz). */18.29 +18.30 +/* The main tables describing the instructions is essentially a copy18.31 + of the "Opcode Map" chapter (Appendix A) of the Intel 8038618.32 + Programmers Manual. Usually, there is a capital letter, followed18.33 + by a small letter. The capital letter tell the addressing mode,18.34 + and the small letter tells about the operand size. Refer to18.35 + the Intel manual for details. */18.36 +18.37 +#include "xlat/disasm/dis-asm.h"18.38 +#include "xlat/disasm/sysdep.h"18.39 +#include "xlat/xlatdasm.h"18.40 +#include "gettext.h"18.41 +18.42 +#define MAXLEN 2018.43 +18.44 +#include <setjmp.h>18.45 +18.46 +#ifndef UNIXWARE_COMPAT18.47 +/* Set non-zero for broken, compatible instructions. Set to zero for18.48 + non-broken opcodes. */18.49 +#define UNIXWARE_COMPAT 118.50 +#endif18.51 +18.52 +static int fetch_data (struct disassemble_info *, bfd_byte *);18.53 +static void ckprefix (void);18.54 +static const char *prefix_name (int, int);18.55 +static int print_insn (bfd_vma, disassemble_info *);18.56 +static void dofloat (int);18.57 +static void OP_ST (int, int);18.58 +static void OP_STi (int, int);18.59 +static int putop (const char *, int);18.60 +static void oappend (const char *);18.61 +static void append_seg (void);18.62 +static void OP_indirE (int, int);18.63 +static void OP_E (int, int);18.64 +static void OP_G (int, int);18.65 +static bfd_vma get64 (void);18.66 +static bfd_signed_vma get32 (void);18.67 +static bfd_signed_vma get32s (void);18.68 +static int get16 (void);18.69 +static void set_op (bfd_vma, int);18.70 +static void OP_REG (int, int);18.71 +static void OP_IMREG (int, int);18.72 +static void OP_I (int, int);18.73 +static void OP_I64 (int, int);18.74 +static void OP_sI (int, int);18.75 +static void OP_J (int, int);18.76 +static void OP_SEG (int, int);18.77 +static void OP_DIR (int, int);18.78 +static void OP_OFF (int, int);18.79 +static void OP_OFF64 (int, int);18.80 +static void ptr_reg (int, int);18.81 +static void OP_ESreg (int, int);18.82 +static void OP_DSreg (int, int);18.83 +static void OP_C (int, int);18.84 +static void OP_D (int, int);18.85 +static void OP_T (int, int);18.86 +static void OP_Rd (int, int);18.87 +static void OP_MMX (int, int);18.88 +static void OP_XMM (int, int);18.89 +static void OP_EM (int, int);18.90 +static void OP_EX (int, int);18.91 +static void OP_MS (int, int);18.92 +static void OP_XS (int, int);18.93 +static void OP_M (int, int);18.94 +static void OP_0fae (int, int);18.95 +static void OP_0f07 (int, int);18.96 +static void NOP_Fixup (int, int);18.97 +static void OP_3DNowSuffix (int, int);18.98 +static void OP_SIMD_Suffix (int, int);18.99 +static void SIMD_Fixup (int, int);18.100 +static void PNI_Fixup (int, int);18.101 +static void INVLPG_Fixup (int, int);18.102 +static void BadOp (void);18.103 +18.104 +struct dis_private {18.105 + /* Points to first byte not fetched. */18.106 + bfd_byte *max_fetched;18.107 + bfd_byte the_buffer[MAXLEN];18.108 + bfd_vma insn_start;18.109 + int orig_sizeflag;18.110 + jmp_buf bailout;18.111 +};18.112 +18.113 +/* The opcode for the fwait instruction, which we treat as a prefix18.114 + when we can. */18.115 +#define FWAIT_OPCODE (0x9b)18.116 +18.117 +/* Set to 1 for 64bit mode disassembly. */18.118 +static int mode_64bit;18.119 +18.120 +/* Flags for the prefixes for the current instruction. See below. */18.121 +static int prefixes;18.122 +18.123 +/* REX prefix the current instruction. See below. */18.124 +static int rex;18.125 +/* Bits of REX we've already used. */18.126 +static int rex_used;18.127 +#define REX_MODE64 818.128 +#define REX_EXTX 418.129 +#define REX_EXTY 218.130 +#define REX_EXTZ 118.131 +/* Mark parts used in the REX prefix. When we are testing for18.132 + empty prefix (for 8bit register REX extension), just mask it18.133 + out. Otherwise test for REX bit is excuse for existence of REX18.134 + only in case value is nonzero. */18.135 +#define USED_REX(value) \18.136 + { \18.137 + if (value) \18.138 + rex_used |= (rex & value) ? (value) | 0x40 : 0; \18.139 + else \18.140 + rex_used |= 0x40; \18.141 + }18.142 +18.143 +/* Flags for prefixes which we somehow handled when printing the18.144 + current instruction. */18.145 +static int used_prefixes;18.146 +18.147 +/* Flags stored in PREFIXES. */18.148 +#define PREFIX_REPZ 118.149 +#define PREFIX_REPNZ 218.150 +#define PREFIX_LOCK 418.151 +#define PREFIX_CS 818.152 +#define PREFIX_SS 0x1018.153 +#define PREFIX_DS 0x2018.154 +#define PREFIX_ES 0x4018.155 +#define PREFIX_FS 0x8018.156 +#define PREFIX_GS 0x10018.157 +#define PREFIX_DATA 0x20018.158 +#define PREFIX_ADDR 0x40018.159 +#define PREFIX_FWAIT 0x80018.160 +18.161 +/* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)18.162 + to ADDR (exclusive) are valid. Returns 1 for success, longjmps18.163 + on error. */18.164 +#define FETCH_DATA(info, addr) \18.165 + ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \18.166 + ? 1 : fetch_data ((info), (addr)))18.167 +18.168 +static int18.169 +fetch_data (struct disassemble_info *info, bfd_byte *addr)18.170 +{18.171 + int status;18.172 + struct dis_private *priv = (struct dis_private *) info->private_data;18.173 + bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);18.174 +18.175 + status = (*info->read_memory_func) (start,18.176 + priv->max_fetched,18.177 + addr - priv->max_fetched,18.178 + info);18.179 + if (status != 0)18.180 + {18.181 + /* If we did manage to read at least one byte, then18.182 + print_insn_i386 will do something sensible. Otherwise, print18.183 + an error. We do that here because this is where we know18.184 + STATUS. */18.185 + if (priv->max_fetched == priv->the_buffer)18.186 + (*info->memory_error_func) (status, start, info);18.187 + longjmp (priv->bailout, 1);18.188 + }18.189 + else18.190 + priv->max_fetched = addr;18.191 + return 1;18.192 +}18.193 +18.194 +#define XX NULL, 018.195 +18.196 +#define Eb OP_E, b_mode18.197 +#define Ev OP_E, v_mode18.198 +#define Ed OP_E, d_mode18.199 +#define Eq OP_E, q_mode18.200 +#define Edq OP_E, dq_mode18.201 +#define Edqw OP_E, dqw_mode18.202 +#define indirEv OP_indirE, v_mode18.203 +#define indirEp OP_indirE, f_mode18.204 +#define Ew OP_E, w_mode18.205 +#define Ma OP_E, v_mode18.206 +#define M OP_M, 0 /* lea, lgdt, etc. */18.207 +#define Mp OP_M, f_mode /* 32 or 48 bit memory operand for LDS, LES etc */18.208 +#define Gb OP_G, b_mode18.209 +#define Gv OP_G, v_mode18.210 +#define Gd OP_G, d_mode18.211 +#define Gdq OP_G, dq_mode18.212 +#define Gw OP_G, w_mode18.213 +#define Rd OP_Rd, d_mode18.214 +#define Rm OP_Rd, m_mode18.215 +#define Ib OP_I, b_mode18.216 +#define sIb OP_sI, b_mode /* sign extened byte */18.217 +#define Iv OP_I, v_mode18.218 +#define Iq OP_I, q_mode18.219 +#define Iv64 OP_I64, v_mode18.220 +#define Iw OP_I, w_mode18.221 +#define I1 OP_I, const_1_mode18.222 +#define Jb OP_J, b_mode18.223 +#define Jv OP_J, v_mode18.224 +#define Cm OP_C, m_mode18.225 +#define Dm OP_D, m_mode18.226 +#define Td OP_T, d_mode18.227 +18.228 +#define RMeAX OP_REG, eAX_reg18.229 +#define RMeBX OP_REG, eBX_reg18.230 +#define RMeCX OP_REG, eCX_reg18.231 +#define RMeDX OP_REG, eDX_reg18.232 +#define RMeSP OP_REG, eSP_reg18.233 +#define RMeBP OP_REG, eBP_reg18.234 +#define RMeSI OP_REG, eSI_reg18.235 +#define RMeDI OP_REG, eDI_reg18.236 +#define RMrAX OP_REG, rAX_reg18.237 +#define RMrBX OP_REG, rBX_reg18.238 +#define RMrCX OP_REG, rCX_reg18.239 +#define RMrDX OP_REG, rDX_reg18.240 +#define RMrSP OP_REG, rSP_reg18.241 +#define RMrBP OP_REG, rBP_reg18.242 +#define RMrSI OP_REG, rSI_reg18.243 +#define RMrDI OP_REG, rDI_reg18.244 +#define RMAL OP_REG, al_reg18.245 +#define RMAL OP_REG, al_reg18.246 +#define RMCL OP_REG, cl_reg18.247 +#define RMDL OP_REG, dl_reg18.248 +#define RMBL OP_REG, bl_reg18.249 +#define RMAH OP_REG, ah_reg18.250 +#define RMCH OP_REG, ch_reg18.251 +#define RMDH OP_REG, dh_reg18.252 +#define RMBH OP_REG, bh_reg18.253 +#define RMAX OP_REG, ax_reg18.254 +#define RMDX OP_REG, dx_reg18.255 +18.256 +#define eAX OP_IMREG, eAX_reg18.257 +#define eBX OP_IMREG, eBX_reg18.258 +#define eCX OP_IMREG, eCX_reg18.259 +#define eDX OP_IMREG, eDX_reg18.260 +#define eSP OP_IMREG, eSP_reg18.261 +#define eBP OP_IMREG, eBP_reg18.262 +#define eSI OP_IMREG, eSI_reg18.263 +#define eDI OP_IMREG, eDI_reg18.264 +#define AL OP_IMREG, al_reg18.265 +#define AL OP_IMREG, al_reg18.266 +#define CL OP_IMREG, cl_reg18.267 +#define DL OP_IMREG, dl_reg18.268 +#define BL OP_IMREG, bl_reg18.269 +#define AH OP_IMREG, ah_reg18.270 +#define CH OP_IMREG, ch_reg18.271 +#define DH OP_IMREG, dh_reg18.272 +#define BH OP_IMREG, bh_reg18.273 +#define AX OP_IMREG, ax_reg18.274 +#define DX OP_IMREG, dx_reg18.275 +#define indirDX OP_IMREG, indir_dx_reg18.276 +18.277 +#define Sw OP_SEG, w_mode18.278 +#define Ap OP_DIR, 018.279 +#define Ob OP_OFF, b_mode18.280 +#define Ob64 OP_OFF64, b_mode18.281 +#define Ov OP_OFF, v_mode18.282 +#define Ov64 OP_OFF64, v_mode18.283 +#define Xb OP_DSreg, eSI_reg18.284 +#define Xv OP_DSreg, eSI_reg18.285 +#define Yb OP_ESreg, eDI_reg18.286 +#define Yv OP_ESreg, eDI_reg18.287 +#define DSBX OP_DSreg, eBX_reg18.288 +18.289 +#define es OP_REG, es_reg18.290 +#define ss OP_REG, ss_reg18.291 +#define cs OP_REG, cs_reg18.292 +#define ds OP_REG, ds_reg18.293 +#define fs OP_REG, fs_reg18.294 +#define gs OP_REG, gs_reg18.295 +18.296 +#define MX OP_MMX, 018.297 +#define XM OP_XMM, 018.298 +#define EM OP_EM, v_mode18.299 +#define EX OP_EX, v_mode18.300 +#define MS OP_MS, v_mode18.301 +#define XS OP_XS, v_mode18.302 +#define OPSUF OP_3DNowSuffix, 018.303 +#define OPSIMD OP_SIMD_Suffix, 018.304 +18.305 +#define cond_jump_flag NULL, cond_jump_mode18.306 +#define loop_jcxz_flag NULL, loop_jcxz_mode18.307 +18.308 +/* bits in sizeflag */18.309 +#define SUFFIX_ALWAYS 418.310 +#define AFLAG 218.311 +#define DFLAG 118.312 +18.313 +#define b_mode 1 /* byte operand */18.314 +#define v_mode 2 /* operand size depends on prefixes */18.315 +#define w_mode 3 /* word operand */18.316 +#define d_mode 4 /* double word operand */18.317 +#define q_mode 5 /* quad word operand */18.318 +#define t_mode 6 /* ten-byte operand */18.319 +#define x_mode 7 /* 16-byte XMM operand */18.320 +#define m_mode 8 /* d_mode in 32bit, q_mode in 64bit mode. */18.321 +#define cond_jump_mode 918.322 +#define loop_jcxz_mode 1018.323 +#define dq_mode 11 /* operand size depends on REX prefixes. */18.324 +#define dqw_mode 12 /* registers like dq_mode, memory like w_mode. */18.325 +#define f_mode 13 /* 4- or 6-byte pointer operand */18.326 +#define const_1_mode 1418.327 +18.328 +#define es_reg 10018.329 +#define cs_reg 10118.330 +#define ss_reg 10218.331 +#define ds_reg 10318.332 +#define fs_reg 10418.333 +#define gs_reg 10518.334 +18.335 +#define eAX_reg 10818.336 +#define eCX_reg 10918.337 +#define eDX_reg 11018.338 +#define eBX_reg 11118.339 +#define eSP_reg 11218.340 +#define eBP_reg 11318.341 +#define eSI_reg 11418.342 +#define eDI_reg 11518.343 +18.344 +#define al_reg 11618.345 +#define cl_reg 11718.346 +#define dl_reg 11818.347 +#define bl_reg 11918.348 +#define ah_reg 12018.349 +#define ch_reg 12118.350 +#define dh_reg 12218.351 +#define bh_reg 12318.352 +18.353 +#define ax_reg 12418.354 +#define cx_reg 12518.355 +#define dx_reg 12618.356 +#define bx_reg 12718.357 +#define sp_reg 12818.358 +#define bp_reg 12918.359 +#define si_reg 13018.360 +#define di_reg 13118.361 +18.362 +#define rAX_reg 13218.363 +#define rCX_reg 13318.364 +#define rDX_reg 13418.365 +#define rBX_reg 13518.366 +#define rSP_reg 13618.367 +#define rBP_reg 13718.368 +#define rSI_reg 13818.369 +#define rDI_reg 13918.370 +18.371 +#define indir_dx_reg 15018.372 +18.373 +#define FLOATCODE 118.374 +#define USE_GROUPS 218.375 +#define USE_PREFIX_USER_TABLE 318.376 +#define X86_64_SPECIAL 418.377 +18.378 +#define FLOAT NULL, NULL, FLOATCODE, NULL, 0, NULL, 018.379 +18.380 +#define GRP1b NULL, NULL, USE_GROUPS, NULL, 0, NULL, 018.381 +#define GRP1S NULL, NULL, USE_GROUPS, NULL, 1, NULL, 018.382 +#define GRP1Ss NULL, NULL, USE_GROUPS, NULL, 2, NULL, 018.383 +#define GRP2b NULL, NULL, USE_GROUPS, NULL, 3, NULL, 018.384 +#define GRP2S NULL, NULL, USE_GROUPS, NULL, 4, NULL, 018.385 +#define GRP2b_one NULL, NULL, USE_GROUPS, NULL, 5, NULL, 018.386 +#define GRP2S_one NULL, NULL, USE_GROUPS, NULL, 6, NULL, 018.387 +#define GRP2b_cl NULL, NULL, USE_GROUPS, NULL, 7, NULL, 018.388 +#define GRP2S_cl NULL, NULL, USE_GROUPS, NULL, 8, NULL, 018.389 +#define GRP3b NULL, NULL, USE_GROUPS, NULL, 9, NULL, 018.390 +#define GRP3S NULL, NULL, USE_GROUPS, NULL, 10, NULL, 018.391 +#define GRP4 NULL, NULL, USE_GROUPS, NULL, 11, NULL, 018.392 +#define GRP5 NULL, NULL, USE_GROUPS, NULL, 12, NULL, 018.393 +#define GRP6 NULL, NULL, USE_GROUPS, NULL, 13, NULL, 018.394 +#define GRP7 NULL, NULL, USE_GROUPS, NULL, 14, NULL, 018.395 +#define GRP8 NULL, NULL, USE_GROUPS, NULL, 15, NULL, 018.396 +#define GRP9 NULL, NULL, USE_GROUPS, NULL, 16, NULL, 018.397 +#define GRP10 NULL, NULL, USE_GROUPS, NULL, 17, NULL, 018.398 +#define GRP11 NULL, NULL, USE_GROUPS, NULL, 18, NULL, 018.399 +#define GRP12 NULL, NULL, USE_GROUPS, NULL, 19, NULL, 018.400 +#define GRP13 NULL, NULL, USE_GROUPS, NULL, 20, NULL, 018.401 +#define GRP14 NULL, NULL, USE_GROUPS, NULL, 21, NULL, 018.402 +#define GRPAMD NULL, NULL, USE_GROUPS, NULL, 22, NULL, 018.403 +#define GRPPADLCK1 NULL, NULL, USE_GROUPS, NULL, 23, NULL, 018.404 +#define GRPPADLCK2 NULL, NULL, USE_GROUPS, NULL, 24, NULL, 018.405 +18.406 +#define PREGRP0 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 0, NULL, 018.407 +#define PREGRP1 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 1, NULL, 018.408 +#define PREGRP2 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 2, NULL, 018.409 +#define PREGRP3 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 3, NULL, 018.410 +#define PREGRP4 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 4, NULL, 018.411 +#define PREGRP5 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 5, NULL, 018.412 +#define PREGRP6 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 6, NULL, 018.413 +#define PREGRP7 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 7, NULL, 018.414 +#define PREGRP8 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 8, NULL, 018.415 +#define PREGRP9 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 9, NULL, 018.416 +#define PREGRP10 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 10, NULL, 018.417 +#define PREGRP11 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 11, NULL, 018.418 +#define PREGRP12 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 12, NULL, 018.419 +#define PREGRP13 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 13, NULL, 018.420 +#define PREGRP14 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 14, NULL, 018.421 +#define PREGRP15 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 15, NULL, 018.422 +#define PREGRP16 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 16, NULL, 018.423 +#define PREGRP17 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 17, NULL, 018.424 +#define PREGRP18 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 18, NULL, 018.425 +#define PREGRP19 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 19, NULL, 018.426 +#define PREGRP20 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 20, NULL, 018.427 +#define PREGRP21 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 21, NULL, 018.428 +#define PREGRP22 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 22, NULL, 018.429 +#define PREGRP23 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 23, NULL, 018.430 +#define PREGRP24 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 24, NULL, 018.431 +#define PREGRP25 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 25, NULL, 018.432 +#define PREGRP26 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 26, NULL, 018.433 +#define PREGRP27 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 27, NULL, 018.434 +#define PREGRP28 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 28, NULL, 018.435 +#define PREGRP29 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 29, NULL, 018.436 +#define PREGRP30 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 30, NULL, 018.437 +#define PREGRP31 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 31, NULL, 018.438 +#define PREGRP32 NULL, NULL, USE_PREFIX_USER_TABLE, NULL, 32, NULL, 018.439 +18.440 +#define X86_64_0 NULL, NULL, X86_64_SPECIAL, NULL, 0, NULL, 018.441 +18.442 +typedef void (*op_rtn) (int bytemode, int sizeflag);18.443 +18.444 +struct dis386 {18.445 + const char *name;18.446 + op_rtn op1;18.447 + int bytemode1;18.448 + op_rtn op2;18.449 + int bytemode2;18.450 + op_rtn op3;18.451 + int bytemode3;18.452 +};18.453 +18.454 +/* Upper case letters in the instruction names here are macros.18.455 + 'A' => print 'b' if no register operands or suffix_always is true18.456 + 'B' => print 'b' if suffix_always is true18.457 + 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand18.458 + . size prefix18.459 + 'E' => print 'e' if 32-bit form of jcxz18.460 + 'F' => print 'w' or 'l' depending on address size prefix (loop insns)18.461 + 'H' => print ",pt" or ",pn" branch hint18.462 + 'I' => honor following macro letter even in Intel mode (implemented only18.463 + . for some of the macro letters)18.464 + 'J' => print 'l'18.465 + 'L' => print 'l' if suffix_always is true18.466 + 'N' => print 'n' if instruction has no wait "prefix"18.467 + 'O' => print 'd', or 'o'18.468 + 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,18.469 + . or suffix_always is true. print 'q' if rex prefix is present.18.470 + 'Q' => print 'w', 'l' or 'q' if no register operands or suffix_always18.471 + . is true18.472 + 'R' => print 'w', 'l' or 'q' ("wd" or "dq" in intel mode)18.473 + 'S' => print 'w', 'l' or 'q' if suffix_always is true18.474 + 'T' => print 'q' in 64bit mode and behave as 'P' otherwise18.475 + 'U' => print 'q' in 64bit mode and behave as 'Q' otherwise18.476 + 'W' => print 'b' or 'w' ("w" or "de" in intel mode)18.477 + 'X' => print 's', 'd' depending on data16 prefix (for XMM)18.478 + 'Y' => 'q' if instruction has an REX 64bit overwrite prefix18.479 +18.480 + Many of the above letters print nothing in Intel mode. See "putop"18.481 + for the details.18.482 +18.483 + Braces '{' and '}', and vertical bars '|', indicate alternative18.484 + mnemonic strings for AT&T, Intel, X86_64 AT&T, and X86_64 Intel18.485 + modes. In cases where there are only two alternatives, the X86_6418.486 + instruction is reserved, and "(bad)" is printed.18.487 +*/18.488 +18.489 +static const struct dis386 dis386[] = {18.490 + /* 00 */18.491 + { "addB", Eb, Gb, XX },18.492 + { "addS", Ev, Gv, XX },18.493 + { "addB", Gb, Eb, XX },18.494 + { "addS", Gv, Ev, XX },18.495 + { "addB", AL, Ib, XX },18.496 + { "addS", eAX, Iv, XX },18.497 + { "push{T|}", es, XX, XX },18.498 + { "pop{T|}", es, XX, XX },18.499 + /* 08 */18.500 + { "orB", Eb, Gb, XX },18.501 + { "orS", Ev, Gv, XX },18.502 + { "orB", Gb, Eb, XX },18.503 + { "orS", Gv, Ev, XX },18.504 + { "orB", AL, Ib, XX },18.505 + { "orS", eAX, Iv, XX },18.506 + { "push{T|}", cs, XX, XX },18.507 + { "(bad)", XX, XX, XX }, /* 0x0f extended opcode escape */18.508 + /* 10 */18.509 + { "adcB", Eb, Gb, XX },18.510 + { "adcS", Ev, Gv, XX },18.511 + { "adcB", Gb, Eb, XX },18.512 + { "adcS", Gv, Ev, XX },18.513 + { "adcB", AL, Ib, XX },18.514 + { "adcS", eAX, Iv, XX },18.515 + { "push{T|}", ss, XX, XX },18.516 + { "popT|}", ss, XX, XX },18.517 + /* 18 */18.518 + { "sbbB", Eb, Gb, XX },18.519 + { "sbbS", Ev, Gv, XX },18.520 + { "sbbB", Gb, Eb, XX },18.521 + { "sbbS", Gv, Ev, XX },18.522 + { "sbbB", AL, Ib, XX },18.523 + { "sbbS", eAX, Iv, XX },18.524 + { "push{T|}", ds, XX, XX },18.525 + { "pop{T|}", ds, XX, XX },18.526 + /* 20 */18.527 + { "andB", Eb, Gb, XX },18.528 + { "andS", Ev, Gv, XX },18.529 + { "andB", Gb, Eb, XX },18.530 + { "andS", Gv, Ev, XX },18.531 + { "andB", AL, Ib, XX },18.532 + { "andS", eAX, Iv, XX },18.533 + { "(bad)", XX, XX, XX }, /* SEG ES prefix */18.534 + { "daa{|}", XX, XX, XX },18.535 + /* 28 */18.536 + { "subB", Eb, Gb, XX },18.537 + { "subS", Ev, Gv, XX },18.538 + { "subB", Gb, Eb, XX },18.539 + { "subS", Gv, Ev, XX },18.540 + { "subB", AL, Ib, XX },18.541 + { "subS", eAX, Iv, XX },18.542 + { "(bad)", XX, XX, XX }, /* SEG CS prefix */18.543 + { "das{|}", XX, XX, XX },18.544 + /* 30 */18.545 + { "xorB", Eb, Gb, XX },18.546 + { "xorS", Ev, Gv, XX },18.547 + { "xorB", Gb, Eb, XX },18.548 + { "xorS", Gv, Ev, XX },18.549 + { "xorB", AL, Ib, XX },18.550 + { "xorS", eAX, Iv, XX },18.551 + { "(bad)", XX, XX, XX }, /* SEG SS prefix */18.552 + { "aaa{|}", XX, XX, XX },18.553 + /* 38 */18.554 + { "cmpB", Eb, Gb, XX },18.555 + { "cmpS", Ev, Gv, XX },18.556 + { "cmpB", Gb, Eb, XX },18.557 + { "cmpS", Gv, Ev, XX },18.558 + { "cmpB", AL, Ib, XX },18.559 + { "cmpS", eAX, Iv, XX },18.560 + { "(bad)", XX, XX, XX }, /* SEG DS prefix */18.561 + { "aas{|}", XX, XX, XX },18.562 + /* 40 */18.563 + { "inc{S|}", RMeAX, XX, XX },18.564 + { "inc{S|}", RMeCX, XX, XX },18.565 + { "inc{S|}", RMeDX, XX, XX },18.566 + { "inc{S|}", RMeBX, XX, XX },18.567 + { "inc{S|}", RMeSP, XX, XX },18.568 + { "inc{S|}", RMeBP, XX, XX },18.569 + { "inc{S|}", RMeSI, XX, XX },18.570 + { "inc{S|}", RMeDI, XX, XX },18.571 + /* 48 */18.572 + { "dec{S|}", RMeAX, XX, XX },18.573 + { "dec{S|}", RMeCX, XX, XX },18.574 + { "dec{S|}", RMeDX, XX, XX },18.575 + { "dec{S|}", RMeBX, XX, XX },18.576 + { "dec{S|}", RMeSP, XX, XX },18.577 + { "dec{S|}", RMeBP, XX, XX },18.578 + { "dec{S|}", RMeSI, XX, XX },18.579 + { "dec{S|}", RMeDI, XX, XX },18.580 + /* 50 */18.581 + { "pushS", RMrAX, XX, XX },18.582 + { "pushS", RMrCX, XX, XX },18.583 + { "pushS", RMrDX, XX, XX },18.584 + { "pushS", RMrBX, XX, XX },18.585 + { "pushS", RMrSP, XX, XX },18.586 + { "pushS", RMrBP, XX, XX },18.587 + { "pushS", RMrSI, XX, XX },18.588 + { "pushS", RMrDI, XX, XX },18.589 + /* 58 */18.590 + { "popS", RMrAX, XX, XX },18.591 + { "popS", RMrCX, XX, XX },18.592 + { "popS", RMrDX, XX, XX },18.593 + { "popS", RMrBX, XX, XX },18.594 + { "popS", RMrSP, XX, XX },18.595 + { "popS", RMrBP, XX, XX },18.596 + { "popS", RMrSI, XX, XX },18.597 + { "popS", RMrDI, XX, XX },18.598 + /* 60 */18.599 + { "pusha{P|}", XX, XX, XX },18.600 + { "popa{P|}", XX, XX, XX },18.601 + { "bound{S|}", Gv, Ma, XX },18.602 + { X86_64_0 },18.603 + { "(bad)", XX, XX, XX }, /* seg fs */18.604 + { "(bad)", XX, XX, XX }, /* seg gs */18.605 + { "(bad)", XX, XX, XX }, /* op size prefix */18.606 + { "(bad)", XX, XX, XX }, /* adr size prefix */18.607 + /* 68 */18.608 + { "pushT", Iq, XX, XX },18.609 + { "imulS", Gv, Ev, Iv },18.610 + { "pushT", sIb, XX, XX },18.611 + { "imulS", Gv, Ev, sIb },18.612 + { "ins{b||b|}", Yb, indirDX, XX },18.613 + { "ins{R||R|}", Yv, indirDX, XX },18.614 + { "outs{b||b|}", indirDX, Xb, XX },18.615 + { "outs{R||R|}", indirDX, Xv, XX },18.616 + /* 70 */18.617 + { "joH", Jb, XX, cond_jump_flag },18.618 + { "jnoH", Jb, XX, cond_jump_flag },18.619 + { "jbH", Jb, XX, cond_jump_flag },18.620 + { "jaeH", Jb, XX, cond_jump_flag },18.621 + { "jeH", Jb, XX, cond_jump_flag },18.622 + { "jneH", Jb, XX, cond_jump_flag },18.623 + { "jbeH", Jb, XX, cond_jump_flag },18.624 + { "jaH", Jb, XX, cond_jump_flag },18.625 + /* 78 */18.626 + { "jsH", Jb, XX, cond_jump_flag },18.627 + { "jnsH", Jb, XX, cond_jump_flag },18.628 + { "jpH", Jb, XX, cond_jump_flag },18.629 + { "jnpH", Jb, XX, cond_jump_flag },18.630 + { "jlH", Jb, XX, cond_jump_flag },18.631 + { "jgeH", Jb, XX, cond_jump_flag },18.632 + { "jleH", Jb, XX, cond_jump_flag },18.633 + { "jgH", Jb, XX, cond_jump_flag },18.634 + /* 80 */18.635 + { GRP1b },18.636 + { GRP1S },18.637 + { "(bad)", XX, XX, XX },18.638 + { GRP1Ss },18.639 + { "testB", Eb, Gb, XX },18.640 + { "testS", Ev, Gv, XX },18.641 + { "xchgB", Eb, Gb, XX },18.642 + { "xchgS", Ev, Gv, XX },18.643 + /* 88 */18.644 + { "movB", Eb, Gb, XX },18.645 + { "movS", Ev, Gv, XX },18.646 + { "movB", Gb, Eb, XX },18.647 + { "movS", Gv, Ev, XX },18.648 + { "movQ", Ev, Sw, XX },18.649 + { "leaS", Gv, M, XX },18.650 + { "movQ", Sw, Ev, XX },18.651 + { "popU", Ev, XX, XX },18.652 + /* 90 */18.653 + { "nop", NOP_Fixup, 0, XX, XX },18.654 + { "xchgS", RMeCX, eAX, XX },18.655 + { "xchgS", RMeDX, eAX, XX },18.656 + { "xchgS", RMeBX, eAX, XX },18.657 + { "xchgS", RMeSP, eAX, XX },18.658 + { "xchgS", RMeBP, eAX, XX },18.659 + { "xchgS", RMeSI, eAX, XX },18.660 + { "xchgS", RMeDI, eAX, XX },18.661 + /* 98 */18.662 + { "cW{tR||tR|}", XX, XX, XX },18.663 + { "cR{tO||tO|}", XX, XX, XX },18.664 + { "Jcall{T|}", Ap, XX, XX },18.665 + { "(bad)", XX, XX, XX }, /* fwait */18.666 + { "pushfT", XX, XX, XX },18.667 + { "popfT", XX, XX, XX },18.668 + { "sahf{|}", XX, XX, XX },18.669 + { "lahf{|}", XX, XX, XX },18.670 + /* a0 */18.671 + { "movB", AL, Ob64, XX },18.672 + { "movS", eAX, Ov64, XX },18.673 + { "movB", Ob64, AL, XX },18.674 + { "movS", Ov64, eAX, XX },18.675 + { "movs{b||b|}", Yb, Xb, XX },18.676 + { "movs{R||R|}", Yv, Xv, XX },18.677 + { "cmps{b||b|}", Xb, Yb, XX },18.678 + { "cmps{R||R|}", Xv, Yv, XX },18.679 + /* a8 */18.680 + { "testB", AL, Ib, XX },18.681 + { "testS", eAX, Iv, XX },18.682 + { "stosB", Yb, AL, XX },18.683 + { "stosS", Yv, eAX, XX },18.684 + { "lodsB", AL, Xb, XX },18.685 + { "lodsS", eAX, Xv, XX },18.686 + { "scasB", AL, Yb, XX },18.687 + { "scasS", eAX, Yv, XX },18.688 + /* b0 */18.689 + { "movB", RMAL, Ib, XX },18.690 + { "movB", RMCL, Ib, XX },18.691 + { "movB", RMDL, Ib, XX },18.692 + { "movB", RMBL, Ib, XX },18.693 + { "movB", RMAH, Ib, XX },18.694 + { "movB", RMCH, Ib, XX },18.695 + { "movB", RMDH, Ib, XX },18.696 + { "movB", RMBH, Ib, XX },18.697 + /* b8 */18.698 + { "movS", RMeAX, Iv64, XX },18.699 + { "movS", RMeCX, Iv64, XX },18.700 + { "movS", RMeDX, Iv64, XX },18.701 + { "movS", RMeBX, Iv64, XX },18.702 + { "movS", RMeSP, Iv64, XX },18.703 + { "movS", RMeBP, Iv64, XX },18.704 + { "movS", RMeSI, Iv64, XX },18.705 + { "movS", RMeDI, Iv64, XX },18.706 + /* c0 */18.707 + { GRP2b },18.708 + { GRP2S },18.709 + { "retT", Iw, XX, XX },18.710 + { "retT", XX, XX, XX },18.711 + { "les{S|}", Gv, Mp, XX },18.712 + { "ldsS", Gv, Mp, XX },18.713 + { "movA", Eb, Ib, XX },18.714 + { "movQ", Ev, Iv, XX },18.715 + /* c8 */18.716 + { "enterT", Iw, Ib, XX },18.717 + { "leaveT", XX, XX, XX },18.718 + { "lretP", Iw, XX, XX },18.719 + { "lretP", XX, XX, XX },18.720 + { "int3", XX, XX, XX },18.721 + { "int", Ib, XX, XX },18.722 + { "into{|}", XX, XX, XX },18.723 + { "iretP", XX, XX, XX },18.724 + /* d0 */18.725 + { GRP2b_one },18.726 + { GRP2S_one },18.727 + { GRP2b_cl },18.728 + { GRP2S_cl },18.729 + { "aam{|}", sIb, XX, XX },18.730 + { "aad{|}", sIb, XX, XX },18.731 + { "(bad)", XX, XX, XX },18.732 + { "xlat", DSBX, XX, XX },18.733 + /* d8 */18.734 + { FLOAT },18.735 + { FLOAT },18.736 + { FLOAT },18.737 + { FLOAT },18.738 + { FLOAT },18.739 + { FLOAT },18.740 + { FLOAT },18.741 + { FLOAT },18.742 + /* e0 */18.743 + { "loopneFH", Jb, XX, loop_jcxz_flag },18.744 + { "loopeFH", Jb, XX, loop_jcxz_flag },18.745 + { "loopFH", Jb, XX, loop_jcxz_flag },18.746 + { "jEcxzH", Jb, XX, loop_jcxz_flag },18.747 + { "inB", AL, Ib, XX },18.748 + { "inS", eAX, Ib, XX },18.749 + { "outB", Ib, AL, XX },18.750 + { "outS", Ib, eAX, XX },18.751 + /* e8 */18.752 + { "callT", Jv, XX, XX },18.753 + { "jmpT", Jv, XX, XX },18.754 + { "Jjmp{T|}", Ap, XX, XX },18.755 + { "jmp", Jb, XX, XX },18.756 + { "inB", AL, indirDX, XX },18.757 + { "inS", eAX, indirDX, XX },18.758 + { "outB", indirDX, AL, XX },18.759 + { "outS", indirDX, eAX, XX },18.760 + /* f0 */18.761 + { "(bad)", XX, XX, XX }, /* lock prefix */18.762 + { "icebp", XX, XX, XX },18.763 + { "(bad)", XX, XX, XX }, /* repne */18.764 + { "(bad)", XX, XX, XX }, /* repz */18.765 + { "hlt", XX, XX, XX },18.766 + { "cmc", XX, XX, XX },18.767 + { GRP3b },18.768 + { GRP3S },18.769 + /* f8 */18.770 + { "clc", XX, XX, XX },18.771 + { "stc", XX, XX, XX },18.772 + { "cli", XX, XX, XX },18.773 + { "sti", XX, XX, XX },18.774 + { "cld", XX, XX, XX },18.775 + { "std", XX, XX, XX },18.776 + { GRP4 },18.777 + { GRP5 },18.778 +};18.779 +18.780 +static const struct dis386 dis386_twobyte[] = {18.781 + /* 00 */18.782 + { GRP6 },18.783 + { GRP7 },18.784 + { "larS", Gv, Ew, XX },18.785 + { "lslS", Gv, Ew, XX },18.786 + { "(bad)", XX, XX, XX },18.787 + { "syscall", XX, XX, XX },18.788 + { "clts", XX, XX, XX },18.789 + { "sysretP", XX, XX, XX },18.790 + /* 08 */18.791 + { "invd", XX, XX, XX },18.792 + { "wbinvd", XX, XX, XX },18.793 + { "(bad)", XX, XX, XX },18.794 + { "ud2a", XX, XX, XX },18.795 + { "(bad)", XX, XX, XX },18.796 + { GRPAMD },18.797 + { "femms", XX, XX, XX },18.798 + { "", MX, EM, OPSUF }, /* See OP_3DNowSuffix. */18.799 + /* 10 */18.800 + { PREGRP8 },18.801 + { PREGRP9 },18.802 + { PREGRP30 },18.803 + { "movlpX", EX, XM, SIMD_Fixup, 'h' },18.804 + { "unpcklpX", XM, EX, XX },18.805 + { "unpckhpX", XM, EX, XX },18.806 + { PREGRP31 },18.807 + { "movhpX", EX, XM, SIMD_Fixup, 'l' },18.808 + /* 18 */18.809 + { GRP14 },18.810 + { "(bad)", XX, XX, XX },18.811 + { "(bad)", XX, XX, XX },18.812 + { "(bad)", XX, XX, XX },18.813 + { "(bad)", XX, XX, XX },18.814 + { "(bad)", XX, XX, XX },18.815 + { "(bad)", XX, XX, XX },18.816 + { "(bad)", XX, XX, XX },18.817 + /* 20 */18.818 + { "movL", Rm, Cm, XX },18.819 + { "movL", Rm, Dm, XX },18.820 + { "movL", Cm, Rm, XX },18.821 + { "movL", Dm, Rm, XX },18.822 + { "movL", Rd, Td, XX },18.823 + { "(bad)", XX, XX, XX },18.824 + { "movL", Td, Rd, XX },18.825 + { "(bad)", XX, XX, XX },18.826 + /* 28 */18.827 + { "movapX", XM, EX, XX },18.828 + { "movapX", EX, XM, XX },18.829 + { PREGRP2 },18.830 + { "movntpX", Ev, XM, XX },18.831 + { PREGRP4 },18.832 + { PREGRP3 },18.833 + { "ucomisX", XM,EX, XX },18.834 + { "comisX", XM,EX, XX },18.835 + /* 30 */18.836 + { "wrmsr", XX, XX, XX },18.837 + { "rdtsc", XX, XX, XX },18.838 + { "rdmsr", XX, XX, XX },18.839 + { "rdpmc", XX, XX, XX },18.840 + { "sysenter", XX, XX, XX },18.841 + { "sysexit", XX, XX, XX },18.842 + { "(bad)", XX, XX, XX },18.843 + { "(bad)", XX, XX, XX },18.844 + /* 38 */18.845 + { "(bad)", XX, XX, XX },18.846 + { "(bad)", XX, XX, XX },18.847 + { "(bad)", XX, XX, XX },18.848 + { "(bad)", XX, XX, XX },18.849 + { "(bad)", XX, XX, XX },18.850 + { "(bad)", XX, XX, XX },18.851 + { "(bad)", XX, XX, XX },18.852 + { "(bad)", XX, XX, XX },18.853 + /* 40 */18.854 + { "cmovo", Gv, Ev, XX },18.855 + { "cmovno", Gv, Ev, XX },18.856 + { "cmovb", Gv, Ev, XX },18.857 + { "cmovae", Gv, Ev, XX },18.858 + { "cmove", Gv, Ev, XX },18.859 + { "cmovne", Gv, Ev, XX },18.860 + { "cmovbe", Gv, Ev, XX },18.861 + { "cmova", Gv, Ev, XX },18.862 + /* 48 */18.863 + { "cmovs", Gv, Ev, XX },18.864 + { "cmovns", Gv, Ev, XX },18.865 + { "cmovp", Gv, Ev, XX },18.866 + { "cmovnp", Gv, Ev, XX },18.867 + { "cmovl", Gv, Ev, XX },18.868 + { "cmovge", Gv, Ev, XX },18.869 + { "cmovle", Gv, Ev, XX },18.870 + { "cmovg", Gv, Ev, XX },18.871 + /* 50 */18.872 + { "movmskpX", Gdq, XS, XX },18.873 + { PREGRP13 },18.874 + { PREGRP12 },18.875 + { PREGRP11 },18.876 + { "andpX", XM, EX, XX },18.877 + { "andnpX", XM, EX, XX },18.878 + { "orpX", XM, EX, XX },18.879 + { "xorpX", XM, EX, XX },18.880 + /* 58 */18.881 + { PREGRP0 },18.882 + { PREGRP10 },18.883 + { PREGRP17 },18.884 + { PREGRP16 },18.885 + { PREGRP14 },18.886 + { PREGRP7 },18.887 + { PREGRP5 },18.888 + { PREGRP6 },18.889 + /* 60 */18.890 + { "punpcklbw", MX, EM, XX },18.891 + { "punpcklwd", MX, EM, XX },18.892 + { "punpckldq", MX, EM, XX },18.893 + { "packsswb", MX, EM, XX },18.894 + { "pcmpgtb", MX, EM, XX },18.895 + { "pcmpgtw", MX, EM, XX },18.896 + { "pcmpgtd", MX, EM, XX },18.897 + { "packuswb", MX, EM, XX },18.898 + /* 68 */18.899 + { "punpckhbw", MX, EM, XX },18.900 + { "punpckhwd", MX, EM, XX },18.901 + { "punpckhdq", MX, EM, XX },18.902 + { "packssdw", MX, EM, XX },18.903 + { PREGRP26 },18.904 + { PREGRP24 },18.905 + { "movd", MX, Edq, XX },18.906 + { PREGRP19 },18.907 + /* 70 */18.908 + { PREGRP22 },18.909 + { GRP10 },18.910 + { GRP11 },18.911 + { GRP12 },18.912 + { "pcmpeqb", MX, EM, XX },18.913 + { "pcmpeqw", MX, EM, XX },18.914 + { "pcmpeqd", MX, EM, XX },18.915 + { "emms", XX, XX, XX },18.916 + /* 78 */18.917 + { "(bad)", XX, XX, XX },18.918 + { "(bad)", XX, XX, XX },18.919 + { "(bad)", XX, XX, XX },18.920 + { "(bad)", XX, XX, XX },18.921 + { PREGRP28 },18.922 + { PREGRP29 },18.923 + { PREGRP23 },18.924 + { PREGRP20 },18.925 + /* 80 */18.926 + { "joH", Jv, XX, cond_jump_flag },18.927 + { "jnoH", Jv, XX, cond_jump_flag },18.928 + { "jbH", Jv, XX, cond_jump_flag },18.929 + { "jaeH", Jv, XX, cond_jump_flag },18.930 + { "jeH", Jv, XX, cond_jump_flag },18.931 + { "jneH", Jv, XX, cond_jump_flag },18.932 + { "jbeH", Jv, XX, cond_jump_flag },18.933 + { "jaH", Jv, XX, cond_jump_flag },18.934 + /* 88 */18.935 + { "jsH", Jv, XX, cond_jump_flag },18.936 + { "jnsH", Jv, XX, cond_jump_flag },18.937 + { "jpH", Jv, XX, cond_jump_flag },18.938 + { "jnpH", Jv, XX, cond_jump_flag },18.939 + { "jlH", Jv, XX, cond_jump_flag },18.940 + { "jgeH", Jv, XX, cond_jump_flag },18.941 + { "jleH", Jv, XX, cond_jump_flag },18.942 + { "jgH", Jv, XX, cond_jump_flag },18.943 + /* 90 */18.944 + { "seto", Eb, XX, XX },18.945 + { "setno", Eb, XX, XX },18.946 + { "setb", Eb, XX, XX },18.947 + { "setae", Eb, XX, XX },18.948 + { "sete", Eb, XX, XX },18.949 + { "setne", Eb, XX, XX },18.950 + { "setbe", Eb, XX, XX },18.951 + { "seta", Eb, XX, XX },18.952 + /* 98 */18.953 + { "sets", Eb, XX, XX },18.954 + { "setns", Eb, XX, XX },18.955 + { "setp", Eb, XX, XX },18.956 + { "setnp", Eb, XX, XX },18.957 + { "setl", Eb, XX, XX },18.958 + { "setge", Eb, XX, XX },18.959 + { "setle", Eb, XX, XX },18.960 + { "setg", Eb, XX, XX },18.961 + /* a0 */18.962 + { "pushT", fs, XX, XX },18.963 + { "popT", fs, XX, XX },18.964 + { "cpuid", XX, XX, XX },18.965 + { "btS", Ev, Gv, XX },18.966 + { "shldS", Ev, Gv, Ib },18.967 + { "shldS", Ev, Gv, CL },18.968 + { GRPPADLCK2 },18.969 + { GRPPADLCK1 },18.970 + /* a8 */18.971 + { "pushT", gs, XX, XX },18.972 + { "popT", gs, XX, XX },18.973 + { "rsm", XX, XX, XX },18.974 + { "btsS", Ev, Gv, XX },18.975 + { "shrdS", Ev, Gv, Ib },18.976 + { "shrdS", Ev, Gv, CL },18.977 + { GRP13 },18.978 + { "imulS", Gv, Ev, XX },18.979 + /* b0 */18.980 + { "cmpxchgB", Eb, Gb, XX },18.981 + { "cmpxchgS", Ev, Gv, XX },18.982 + { "lssS", Gv, Mp, XX },18.983 + { "btrS", Ev, Gv, XX },18.984 + { "lfsS", Gv, Mp, XX },18.985 + { "lgsS", Gv, Mp, XX },18.986 + { "movz{bR|x|bR|x}", Gv, Eb, XX },18.987 + { "movz{wR|x|wR|x}", Gv, Ew, XX }, /* yes, there really is movzww ! */18.988 + /* b8 */18.989 + { "(bad)", XX, XX, XX },18.990 + { "ud2b", XX, XX, XX },18.991 + { GRP8 },18.992 + { "btcS", Ev, Gv, XX },18.993 + { "bsfS", Gv, Ev, XX },18.994 + { "bsrS", Gv, Ev, XX },18.995 + { "movs{bR|x|bR|x}", Gv, Eb, XX },18.996 + { "movs{wR|x|wR|x}", Gv, Ew, XX }, /* yes, there really is movsww ! */18.997 + /* c0 */18.998 + { "xaddB", Eb, Gb, XX },18.999 + { "xaddS", Ev, Gv, XX },18.1000 + { PREGRP1 },18.1001 + { "movntiS", Ev, Gv, XX },18.1002 + { "pinsrw", MX, Edqw, Ib },18.1003 + { "pextrw", Gdq, MS, Ib },18.1004 + { "shufpX", XM, EX, Ib },18.1005 + { GRP9 },18.1006 + /* c8 */18.1007 + { "bswap", RMeAX, XX, XX },18.1008 + { "bswap", RMeCX, XX, XX },18.1009 + { "bswap", RMeDX, XX, XX },18.1010 + { "bswap", RMeBX, XX, XX },18.1011 + { "bswap", RMeSP, XX, XX },18.1012 + { "bswap", RMeBP, XX, XX },18.1013 + { "bswap", RMeSI, XX, XX },18.1014 + { "bswap", RMeDI, XX, XX },18.1015 + /* d0 */18.1016 + { PREGRP27 },18.1017 + { "psrlw", MX, EM, XX },18.1018 + { "psrld", MX, EM, XX },18.1019 + { "psrlq", MX, EM, XX },18.1020 + { "paddq", MX, EM, XX },18.1021 + { "pmullw", MX, EM, XX },18.1022 + { PREGRP21 },18.1023 + { "pmovmskb", Gdq, MS, XX },18.1024 + /* d8 */18.1025 + { "psubusb", MX, EM, XX },18.1026 + { "psubusw", MX, EM, XX },18.1027 + { "pminub", MX, EM, XX },18.1028 + { "pand", MX, EM, XX },18.1029 + { "paddusb", MX, EM, XX },18.1030 + { "paddusw", MX, EM, XX },18.1031 + { "pmaxub", MX, EM, XX },18.1032 + { "pandn", MX, EM, XX },18.1033 + /* e0 */18.1034 + { "pavgb", MX, EM, XX },18.1035 + { "psraw", MX, EM, XX },18.1036 + { "psrad", MX, EM, XX },18.1037 + { "pavgw", MX, EM, XX },18.1038 + { "pmulhuw", MX, EM, XX },18.1039 + { "pmulhw", MX, EM, XX },18.1040 + { PREGRP15 },18.1041 + { PREGRP25 },18.1042 + /* e8 */18.1043 + { "psubsb", MX, EM, XX },18.1044 + { "psubsw", MX, EM, XX },18.1045 + { "pminsw", MX, EM, XX },18.1046 + { "por", MX, EM, XX },18.1047 + { "paddsb", MX, EM, XX },18.1048 + { "paddsw", MX, EM, XX },18.1049 + { "pmaxsw", MX, EM, XX },18.1050 + { "pxor", MX, EM, XX },18.1051 + /* f0 */18.1052 + { PREGRP32 },18.1053 + { "psllw", MX, EM, XX },18.1054 + { "pslld", MX, EM, XX },18.1055 + { "psllq", MX, EM, XX },18.1056 + { "pmuludq", MX, EM, XX },18.1057 + { "pmaddwd", MX, EM, XX },18.1058 + { "psadbw", MX, EM, XX },18.1059 + { PREGRP18 },18.1060 + /* f8 */18.1061 + { "psubb", MX, EM, XX },18.1062 + { "psubw", MX, EM, XX },18.1063 + { "psubd", MX, EM, XX },18.1064 + { "psubq", MX, EM, XX },18.1065 + { "paddb", MX, EM, XX },18.1066 + { "paddw", MX, EM, XX },18.1067 + { "paddd", MX, EM, XX },18.1068 + { "(bad)", XX, XX, XX }18.1069 +};18.1070 +18.1071 +static const unsigned char onebyte_has_modrm[256] = {18.1072 + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */18.1073 + /* ------------------------------- */18.1074 + /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */18.1075 + /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */18.1076 + /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */18.1077 + /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */18.1078 + /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */18.1079 + /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */18.1080 + /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */18.1081 + /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */18.1082 + /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */18.1083 + /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */18.1084 + /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */18.1085 + /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */18.1086 + /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */18.1087 + /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */18.1088 + /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */18.1089 + /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */18.1090 + /* ------------------------------- */18.1091 + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */18.1092 +};18.1093 +18.1094 +static const unsigned char twobyte_has_modrm[256] = {18.1095 + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */18.1096 + /* ------------------------------- */18.1097 + /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */18.1098 + /* 10 */ 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0, /* 1f */18.1099 + /* 20 */ 1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1, /* 2f */18.1100 + /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */18.1101 + /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */18.1102 + /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */18.1103 + /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */18.1104 + /* 70 */ 1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1, /* 7f */18.1105 + /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */18.1106 + /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */18.1107 + /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */18.1108 + /* b0 */ 1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1, /* bf */18.1109 + /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */18.1110 + /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */18.1111 + /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */18.1112 + /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 /* ff */18.1113 + /* ------------------------------- */18.1114 + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */18.1115 +};18.1116 +18.1117 +static const unsigned char twobyte_uses_SSE_prefix[256] = {18.1118 + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */18.1119 + /* ------------------------------- */18.1120 + /* 00 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0f */18.1121 + /* 10 */ 1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0, /* 1f */18.1122 + /* 20 */ 0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0, /* 2f */18.1123 + /* 30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 3f */18.1124 + /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 4f */18.1125 + /* 50 */ 0,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* 5f */18.1126 + /* 60 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1, /* 6f */18.1127 + /* 70 */ 1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1, /* 7f */18.1128 + /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */18.1129 + /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 9f */18.1130 + /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* af */18.1131 + /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* bf */18.1132 + /* c0 */ 0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, /* cf */18.1133 + /* d0 */ 1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, /* df */18.1134 + /* e0 */ 0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0, /* ef */18.1135 + /* f0 */ 1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0 /* ff */18.1136 + /* ------------------------------- */18.1137 + /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */18.1138 +};18.1139 +18.1140 +static char obuf[100];18.1141 +static char *obufp;18.1142 +static char scratchbuf[100];18.1143 +static unsigned char *start_codep;18.1144 +static unsigned char *insn_codep;18.1145 +static unsigned char *codep;18.1146 +static disassemble_info *the_info;18.1147 +static int mod;18.1148 +static int rm;18.1149 +static int reg;18.1150 +static unsigned char need_modrm;18.1151 +18.1152 +/* If we are accessing mod/rm/reg without need_modrm set, then the18.1153 + values are stale. Hitting this abort likely indicates that you18.1154 + need to update onebyte_has_modrm or twobyte_has_modrm. */18.1155 +#define MODRM_CHECK if (!need_modrm) abort ()18.1156 +18.1157 +static const char **names64;18.1158 +static const char **names32;18.1159 +static const char **names16;18.1160 +static const char **names8;18.1161 +static const char **names8rex;18.1162 +static const char **names_seg;18.1163 +static const char **index16;18.1164 +18.1165 +static const char *intel_names64[] = {18.1166 + "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",18.1167 + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"18.1168 +};18.1169 +static const char *intel_names32[] = {18.1170 + "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",18.1171 + "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"18.1172 +};18.1173 +static const char *intel_names16[] = {18.1174 + "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",18.1175 + "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"18.1176 +};18.1177 +static const char *intel_names8[] = {18.1178 + "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",18.1179 +};18.1180 +static const char *intel_names8rex[] = {18.1181 + "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",18.1182 + "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"18.1183 +};18.1184 +static const char *intel_names_seg[] = {18.1185 + "es", "cs", "ss", "ds", "fs", "gs", "?", "?",18.1186 +};18.1187 +static const char *intel_index16[] = {18.1188 + "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"18.1189 +};18.1190 +18.1191 +static const char *att_names64[] = {18.1192 + "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",18.1193 + "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"18.1194 +};18.1195 +static const char *att_names32[] = {18.1196 + "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",18.1197 + "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"18.1198 +};18.1199 +static const char *att_names16[] = {18.1200 + "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",18.1201 + "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"18.1202 +};18.1203 +static const char *att_names8[] = {18.1204 + "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",18.1205 +};18.1206 +static const char *att_names8rex[] = {18.1207 + "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",18.1208 + "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"18.1209 +};18.1210 +static const char *att_names_seg[] = {18.1211 + "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",18.1212 +};18.1213 +static const char *att_index16[] = {18.1214 + "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"18.1215 +};18.1216 +18.1217 +static const struct dis386 grps[][8] = {18.1218 + /* GRP1b */18.1219 + {18.1220 + { "addA", Eb, Ib, XX },18.1221 + { "orA", Eb, Ib, XX },18.1222 + { "adcA", Eb, Ib, XX },18.1223 + { "sbbA", Eb, Ib, XX },18.1224 + { "andA", Eb, Ib, XX },18.1225 + { "subA", Eb, Ib, XX },18.1226 + { "xorA", Eb, Ib, XX },18.1227 + { "cmpA", Eb, Ib, XX }18.1228 + },18.1229 + /* GRP1S */18.1230 + {18.1231 + { "addQ", Ev, Iv, XX },18.1232 + { "orQ", Ev, Iv, XX },18.1233 + { "adcQ", Ev, Iv, XX },18.1234 + { "sbbQ", Ev, Iv, XX },18.1235 + { "andQ", Ev, Iv, XX },18.1236 + { "subQ", Ev, Iv, XX },18.1237 + { "xorQ", Ev, Iv, XX },18.1238 + { "cmpQ", Ev, Iv, XX }18.1239 + },18.1240 + /* GRP1Ss */18.1241 + {18.1242 + { "addQ", Ev, sIb, XX },18.1243 + { "orQ", Ev, sIb, XX },18.1244 + { "adcQ", Ev, sIb, XX },18.1245 + { "sbbQ", Ev, sIb, XX },18.1246 + { "andQ", Ev, sIb, XX },18.1247 + { "subQ", Ev, sIb, XX },18.1248 + { "xorQ", Ev, sIb, XX },18.1249 + { "cmpQ", Ev, sIb, XX }18.1250 + },18.1251 + /* GRP2b */18.1252 + {18.1253 + { "rolA", Eb, Ib, XX },18.1254 + { "rorA", Eb, Ib, XX },18.1255 + { "rclA", Eb, Ib, XX },18.1256 + { "rcrA", Eb, Ib, XX },18.1257 + { "shlA", Eb, Ib, XX },18.1258 + { "shrA", Eb, Ib, XX },18.1259 + { "(bad)", XX, XX, XX },18.1260 + { "sarA", Eb, Ib, XX },18.1261 + },18.1262 + /* GRP2S */18.1263 + {18.1264 + { "rolQ", Ev, Ib, XX },18.1265 + { "rorQ", Ev, Ib, XX },18.1266 + { "rclQ", Ev, Ib, XX },18.1267 + { "rcrQ", Ev, Ib, XX },18.1268 + { "shlQ", Ev, Ib, XX },18.1269 + { "shrQ", Ev, Ib, XX },18.1270 + { "(bad)", XX, XX, XX },18.1271 + { "sarQ", Ev, Ib, XX },18.1272 + },18.1273 + /* GRP2b_one */18.1274 + {18.1275 + { "rolA", Eb, I1, XX },18.1276 + { "rorA", Eb, I1, XX },18.1277 + { "rclA", Eb, I1, XX },18.1278 + { "rcrA", Eb, I1, XX },18.1279 + { "shlA", Eb, I1, XX },18.1280 + { "shrA", Eb, I1, XX },18.1281 + { "(bad)", XX, XX, XX },18.1282 + { "sarA", Eb, I1, XX },18.1283 + },18.1284 + /* GRP2S_one */18.1285 + {18.1286 + { "rolQ", Ev, I1, XX },18.1287 + { "rorQ", Ev, I1, XX },18.1288 + { "rclQ", Ev, I1, XX },18.1289 + { "rcrQ", Ev, I1, XX },18.1290 + { "shlQ", Ev, I1, XX },18.1291 + { "shrQ", Ev, I1, XX },18.1292 + { "(bad)", XX, XX, XX},18.1293 + { "sarQ", Ev, I1, XX },18.1294 + },18.1295 + /* GRP2b_cl */18.1296 + {18.1297 + { "rolA", Eb, CL, XX },18.1298 + { "rorA", Eb, CL, XX },18.1299 + { "rclA", Eb, CL, XX },18.1300 + { "rcrA", Eb, CL, XX },18.1301 + { "shlA", Eb, CL, XX },18.1302 + { "shrA", Eb, CL, XX },18.1303 + { "(bad)", XX, XX, XX },18.1304 + { "sarA", Eb, CL, XX },18.1305 + },18.1306 + /* GRP2S_cl */18.1307 + {18.1308 + { "rolQ", Ev, CL, XX },18.1309 + { "rorQ", Ev, CL, XX },18.1310 + { "rclQ", Ev, CL, XX },18.1311 + { "rcrQ", Ev, CL, XX },18.1312 + { "shlQ", Ev, CL, XX },18.1313 + { "shrQ", Ev, CL, XX },18.1314 + { "(bad)", XX, XX, XX },18.1315 + { "sarQ", Ev, CL, XX }18.1316 + },18.1317 + /* GRP3b */18.1318 + {18.1319 + { "testA", Eb, Ib, XX },18.1320 + { "(bad)", Eb, XX, XX },18.1321 + { "notA", Eb, XX, XX },18.1322 + { "negA", Eb, XX, XX },18.1323 + { "mulA", Eb, XX, XX }, /* Don't print the implicit %al register, */18.1324 + { "imulA", Eb, XX, XX }, /* to distinguish these opcodes from other */18.1325 + { "divA", Eb, XX, XX }, /* mul/imul opcodes. Do the same for div */18.1326 + { "idivA", Eb, XX, XX } /* and idiv for consistency. */18.1327 + },18.1328 + /* GRP3S */18.1329 + {18.1330 + { "testQ", Ev, Iv, XX },18.1331 + { "(bad)", XX, XX, XX },18.1332 + { "notQ", Ev, XX, XX },18.1333 + { "negQ", Ev, XX, XX },18.1334 + { "mulQ", Ev, XX, XX }, /* Don't print the implicit register. */18.1335 + { "imulQ", Ev, XX, XX },18.1336 + { "divQ", Ev, XX, XX },18.1337 + { "idivQ", Ev, XX, XX },18.1338 + },18.1339 + /* GRP4 */18.1340 + {18.1341 + { "incA", Eb, XX, XX },18.1342 + { "decA", Eb, XX, XX },18.1343 + { "(bad)", XX, XX, XX },18.1344 + { "(bad)", XX, XX, XX },18.1345 + { "(bad)", XX, XX, XX },18.1346 + { "(bad)", XX, XX, XX },18.1347 + { "(bad)", XX, XX, XX },18.1348 + { "(bad)", XX, XX, XX },18.1349 + },18.1350 + /* GRP5 */18.1351 + {18.1352 + { "incQ", Ev, XX, XX },18.1353 + { "decQ", Ev, XX, XX },18.1354 + { "callT", indirEv, XX, XX },18.1355 + { "JcallT", indirEp, XX, XX },18.1356 + { "jmpT", indirEv, XX, XX },18.1357 + { "JjmpT", indirEp, XX, XX },18.1358 + { "pushU", Ev, XX, XX },18.1359 + { "(bad)", XX, XX, XX },18.1360 + },18.1361 + /* GRP6 */18.1362 + {18.1363 + { "sldtQ", Ev, XX, XX },18.1364 + { "strQ", Ev, XX, XX },18.1365 + { "lldt", Ew, XX, XX },18.1366 + { "ltr", Ew, XX, XX },18.1367 + { "verr", Ew, XX, XX },18.1368 + { "verw", Ew, XX, XX },18.1369 + { "(bad)", XX, XX, XX },18.1370 + { "(bad)", XX, XX, XX }18.1371 + },18.1372 + /* GRP7 */18.1373 + {18.1374 + { "sgdtIQ", M, XX, XX },18.1375 + { "sidtIQ", PNI_Fixup, 0, XX, XX },18.1376 + { "lgdt{Q|Q||}", M, XX, XX },18.1377 + { "lidt{Q|Q||}", M, XX, XX },18.1378 + { "smswQ", Ev, XX, XX },18.1379 + { "(bad)", XX, XX, XX },18.1380 + { "lmsw", Ew, XX, XX },18.1381 + { "invlpg", INVLPG_Fixup, w_mode, XX, XX },18.1382 + },18.1383 + /* GRP8 */18.1384 + {18.1385 + { "(bad)", XX, XX, XX },18.1386 + { "(bad)", XX, XX, XX },18.1387 + { "(bad)", XX, XX, XX },18.1388 + { "(bad)", XX, XX, XX },18.1389 + { "btQ", Ev, Ib, XX },18.1390 + { "btsQ", Ev, Ib, XX },18.1391 + { "btrQ", Ev, Ib, XX },18.1392 + { "btcQ", Ev, Ib, XX },18.1393 + },18.1394 + /* GRP9 */18.1395 + {18.1396 + { "(bad)", XX, XX, XX },18.1397 + { "cmpxchg8b", Eq, XX, XX },18.1398 + { "(bad)", XX, XX, XX },18.1399 + { "(bad)", XX, XX, XX },18.1400 + { "(bad)", XX, XX, XX },18.1401 + { "(bad)", XX, XX, XX },18.1402 + { "(bad)", XX, XX, XX },18.1403 + { "(bad)", XX, XX, XX },18.1404 + },18.1405 + /* GRP10 */18.1406 + {18.1407 + { "(bad)", XX, XX, XX },18.1408 + { "(bad)", XX, XX, XX },18.1409 + { "psrlw", MS, Ib, XX },18.1410 + { "(bad)", XX, XX, XX },18.1411 + { "psraw", MS, Ib, XX },18.1412 + { "(bad)", XX, XX, XX },18.1413 + { "psllw", MS, Ib, XX },18.1414 + { "(bad)", XX, XX, XX },18.1415 + },18.1416 + /* GRP11 */18.1417 + {18.1418 + { "(bad)", XX, XX, XX },18.1419 + { "(bad)", XX, XX, XX },18.1420 + { "psrld", MS, Ib, XX },18.1421 + { "(bad)", XX, XX, XX },18.1422 + { "psrad", MS, Ib, XX },18.1423 + { "(bad)", XX, XX, XX },18.1424 + { "pslld", MS, Ib, XX },18.1425 + { "(bad)", XX, XX, XX },18.1426 + },18.1427 + /* GRP12 */18.1428 + {18.1429 + { "(bad)", XX, XX, XX },18.1430 + { "(bad)", XX, XX, XX },18.1431 + { "psrlq", MS, Ib, XX },18.1432 + { "psrldq", MS, Ib, XX },18.1433 + { "(bad)", XX, XX, XX },18.1434 + { "(bad)", XX, XX, XX },18.1435 + { "psllq", MS, Ib, XX },18.1436 + { "pslldq", MS, Ib, XX },18.1437 + },18.1438 + /* GRP13 */18.1439 + {18.1440 + { "fxsave", Ev, XX, XX },18.1441 + { "fxrstor", Ev, XX, XX },18.1442 + { "ldmxcsr", Ev, XX, XX },18.1443 + { "stmxcsr", Ev, XX, XX },18.1444 + { "(bad)", XX, XX, XX },18.1445 + { "lfence", OP_0fae, 0, XX, XX },18.1446 + { "mfence", OP_0fae, 0, XX, XX },18.1447 + { "clflush", OP_0fae, 0, XX, XX },18.1448 + },18.1449 + /* GRP14 */18.1450 + {18.1451 + { "prefetchnta", Ev, XX, XX },18.1452 + { "prefetcht0", Ev, XX, XX },18.1453 + { "prefetcht1", Ev, XX, XX },18.1454 + { "prefetcht2", Ev, XX, XX },18.1455 + { "(bad)", XX, XX, XX },18.1456 + { "(bad)", XX, XX, XX },18.1457 + { "(bad)", XX, XX, XX },18.1458 + { "(bad)", XX, XX, XX },18.1459 + },18.1460 + /* GRPAMD */18.1461 + {18.1462 + { "prefetch", Eb, XX, XX },18.1463 + { "prefetchw", Eb, XX, XX },18.1464 + { "(bad)", XX, XX, XX },18.1465 + { "(bad)", XX, XX, XX },18.1466 + { "(bad)", XX, XX, XX },18.1467 + { "(bad)", XX, XX, XX },18.1468 + { "(bad)", XX, XX, XX },18.1469 + { "(bad)", XX, XX, XX },18.1470 + },18.1471 + /* GRPPADLCK1 */18.1472 + {18.1473 + { "xstorerng", OP_0f07, 0, XX, XX },18.1474 + { "xcryptecb", OP_0f07, 0, XX, XX },18.1475 + { "xcryptcbc", OP_0f07, 0, XX, XX },18.1476 + { "(bad)", OP_0f07, 0, XX, XX },18.1477 + { "xcryptcfb", OP_0f07, 0, XX, XX },18.1478 + { "xcryptofb", OP_0f07, 0, XX, XX },18.1479 + { "(bad)", OP_0f07, 0, XX, XX },18.1480 + { "(bad)", OP_0f07, 0, XX, XX },18.1481 + },18.1482 + /* GRPPADLCK2 */18.1483 + {18.1484 + { "montmul", OP_0f07, 0, XX, XX },18.1485 + { "xsha1", OP_0f07, 0, XX, XX },18.1486 + { "xsha256", OP_0f07, 0, XX, XX },18.1487 + { "(bad)", OP_0f07, 0, XX, XX },18.1488 + { "(bad)", OP_0f07, 0, XX, XX },18.1489 + { "(bad)", OP_0f07, 0, XX, XX },18.1490 + { "(bad)", OP_0f07, 0, XX, XX },18.1491 + { "(bad)", OP_0f07, 0, XX, XX },18.1492 + }18.1493 +};18.1494 +18.1495 +static const struct dis386 prefix_user_table[][4] = {18.1496 + /* PREGRP0 */18.1497 + {18.1498 + { "addps", XM, EX, XX },18.1499 + { "addss", XM, EX, XX },18.1500 + { "addpd", XM, EX, XX },18.1501 + { "addsd", XM, EX, XX },18.1502 + },18.1503 + /* PREGRP1 */18.1504 + {18.1505 + { "", XM, EX, OPSIMD }, /* See OP_SIMD_SUFFIX. */18.1506 + { "", XM, EX, OPSIMD },18.1507 + { "", XM, EX, OPSIMD },18.1508 + { "", XM, EX, OPSIMD },18.1509 + },18.1510 + /* PREGRP2 */18.1511 + {18.1512 + { "cvtpi2ps", XM, EM, XX },18.1513 + { "cvtsi2ssY", XM, Ev, XX },18.1514 + { "cvtpi2pd", XM, EM, XX },18.1515 + { "cvtsi2sdY", XM, Ev, XX },18.1516 + },18.1517 + /* PREGRP3 */18.1518 + {18.1519 + { "cvtps2pi", MX, EX, XX },18.1520 + { "cvtss2siY", Gv, EX, XX },18.1521 + { "cvtpd2pi", MX, EX, XX },18.1522 + { "cvtsd2siY", Gv, EX, XX },18.1523 + },18.1524 + /* PREGRP4 */18.1525 + {18.1526 + { "cvttps2pi", MX, EX, XX },18.1527 + { "cvttss2siY", Gv, EX, XX },18.1528 + { "cvttpd2pi", MX, EX, XX },18.1529 + { "cvttsd2siY", Gv, EX, XX },18.1530 + },18.1531 + /* PREGRP5 */18.1532 + {18.1533 + { "divps", XM, EX, XX },18.1534 + { "divss", XM, EX, XX },18.1535 + { "divpd", XM, EX, XX },18.1536 + { "divsd", XM, EX, XX },18.1537 + },18.1538 + /* PREGRP6 */18.1539 + {18.1540 + { "maxps", XM, EX, XX },18.1541 + { "maxss", XM, EX, XX },18.1542 + { "maxpd", XM, EX, XX },18.1543 + { "maxsd", XM, EX, XX },18.1544 + },18.1545 + /* PREGRP7 */18.1546 + {18.1547 + { "minps", XM, EX, XX },18.1548 + { "minss", XM, EX, XX },18.1549 + { "minpd", XM, EX, XX },18.1550 + { "minsd", XM, EX, XX },18.1551 + },18.1552 + /* PREGRP8 */18.1553 + {18.1554 + { "movups", XM, EX, XX },18.1555 + { "movss", XM, EX, XX },18.1556 + { "movupd", XM, EX, XX },18.1557 + { "movsd", XM, EX, XX },18.1558 + },18.1559 + /* PREGRP9 */18.1560 + {18.1561 + { "movups", EX, XM, XX },18.1562 + { "movss", EX, XM, XX },18.1563 + { "movupd", EX, XM, XX },18.1564 + { "movsd", EX, XM, XX },18.1565 + },18.1566 + /* PREGRP10 */18.1567 + {18.1568 + { "mulps", XM, EX, XX },18.1569 + { "mulss", XM, EX, XX },18.1570 + { "mulpd", XM, EX, XX },18.1571 + { "mulsd", XM, EX, XX },18.1572 + },18.1573 + /* PREGRP11 */18.1574 + {18.1575 + { "rcpps", XM, EX, XX },18.1576 + { "rcpss", XM, EX, XX },18.1577 + { "(bad)", XM, EX, XX },18.1578 + { "(bad)", XM, EX, XX },18.1579 + },18.1580 + /* PREGRP12 */18.1581 + {18.1582 + { "rsqrtps", XM, EX, XX },18.1583 + { "rsqrtss", XM, EX, XX },18.1584 + { "(bad)", XM, EX, XX },18.1585 + { "(bad)", XM, EX, XX },18.1586 + },18.1587 + /* PREGRP13 */18.1588 + {18.1589 + { "sqrtps", XM, EX, XX },18.1590 + { "sqrtss", XM, EX, XX },18.1591 + { "sqrtpd", XM, EX, XX },18.1592 + { "sqrtsd", XM, EX, XX },18.1593 + },18.1594 + /* PREGRP14 */18.1595 + {18.1596 + { "subps", XM, EX, XX },18.1597 + { "subss", XM, EX, XX },18.1598 + { "subpd", XM, EX, XX },18.1599 + { "subsd", XM, EX, XX },18.1600 + },18.1601 + /* PREGRP15 */18.1602 + {18.1603 + { "(bad)", XM, EX, XX },18.1604 + { "cvtdq2pd", XM, EX, XX },18.1605 + { "cvttpd2dq", XM, EX, XX },18.1606 + { "cvtpd2dq", XM, EX, XX },18.1607 + },18.1608 + /* PREGRP16 */18.1609 + {18.1610 + { "cvtdq2ps", XM, EX, XX },18.1611 + { "cvttps2dq",XM, EX, XX },18.1612 + { "cvtps2dq",XM, EX, XX },18.1613 + { "(bad)", XM, EX, XX },18.1614 + },18.1615 + /* PREGRP17 */18.1616 + {18.1617 + { "cvtps2pd", XM, EX, XX },18.1618 + { "cvtss2sd", XM, EX, XX },18.1619 + { "cvtpd2ps", XM, EX, XX },18.1620 + { "cvtsd2ss", XM, EX, XX },18.1621 + },18.1622 + /* PREGRP18 */18.1623 + {18.1624 + { "maskmovq", MX, MS, XX },18.1625 + { "(bad)", XM, EX, XX },18.1626 + { "maskmovdqu", XM, EX, XX },18.1627 + { "(bad)", XM, EX, XX },18.1628 + },18.1629 + /* PREGRP19 */18.1630 + {18.1631 + { "movq", MX, EM, XX },18.1632 + { "movdqu", XM, EX, XX },18.1633 + { "movdqa", XM, EX, XX },18.1634 + { "(bad)", XM, EX, XX },18.1635 + },18.1636 + /* PREGRP20 */18.1637 + {18.1638 + { "movq", EM, MX, XX },18.1639 + { "movdqu", EX, XM, XX },18.1640 + { "movdqa", EX, XM, XX },18.1641 + { "(bad)", EX, XM, XX },18.1642 + },18.1643 + /* PREGRP21 */18.1644 + {18.1645 + { "(bad)", EX, XM, XX },18.1646 + { "movq2dq", XM, MS, XX },18.1647 + { "movq", EX, XM, XX },18.1648 + { "movdq2q", MX, XS, XX },18.1649 + },18.1650 + /* PREGRP22 */18.1651 + {18.1652 + { "pshufw", MX, EM, Ib },18.1653 + { "pshufhw", XM, EX, Ib },18.1654 + { "pshufd", XM, EX, Ib },18.1655 + { "pshuflw", XM, EX, Ib },18.1656 + },18.1657 + /* PREGRP23 */18.1658 + {18.1659 + { "movd", Edq, MX, XX },18.1660 + { "movq", XM, EX, XX },18.1661 + { "movd", Edq, XM, XX },18.1662 + { "(bad)", Ed, XM, XX },18.1663 + },18.1664 + /* PREGRP24 */18.1665 + {18.1666 + { "(bad)", MX, EX, XX },18.1667 + { "(bad)", XM, EX, XX },18.1668 + { "punpckhqdq", XM, EX, XX },18.1669 + { "(bad)", XM, EX, XX },18.1670 + },18.1671 + /* PREGRP25 */18.1672 + {18.1673 + { "movntq", EM, MX, XX },18.1674 + { "(bad)", EM, XM, XX },18.1675 + { "movntdq", EM, XM, XX },18.1676 + { "(bad)", EM, XM, XX },18.1677 + },18.1678 + /* PREGRP26 */18.1679 + {18.1680 + { "(bad)", MX, EX, XX },18.1681 + { "(bad)", XM, EX, XX },18.1682 + { "punpcklqdq", XM, EX, XX },18.1683 + { "(bad)", XM, EX, XX },18.1684 + },18.1685 + /* PREGRP27 */18.1686 + {18.1687 + { "(bad)", MX, EX, XX },18.1688 + { "(bad)", XM, EX, XX },18.1689 + { "addsubpd", XM, EX, XX },18.1690 + { "addsubps", XM, EX, XX },18.1691 + },18.1692 + /* PREGRP28 */18.1693 + {18.1694 + { "(bad)", MX, EX, XX },18.1695 + { "(bad)", XM, EX, XX },18.1696 + { "haddpd", XM, EX, XX },18.1697 + { "haddps", XM, EX, XX },18.1698 + },18.1699 + /* PREGRP29 */18.1700 + {18.1701 + { "(bad)", MX, EX, XX },18.1702 + { "(bad)", XM, EX, XX },18.1703 + { "hsubpd", XM, EX, XX },18.1704 + { "hsubps", XM, EX, XX },18.1705 + },18.1706 + /* PREGRP30 */18.1707 + {18.1708 + { "movlpX", XM, EX, SIMD_Fixup, 'h' }, /* really only 2 operands */18.1709 + { "movsldup", XM, EX, XX },18.1710 + { "movlpd", XM, EX, XX },18.1711 + { "movddup", XM, EX, XX },18.1712 + },18.1713 + /* PREGRP31 */18.1714 + {18.1715 + { "movhpX", XM, EX, SIMD_Fixup, 'l' },18.1716 + { "movshdup", XM, EX, XX },18.1717 + { "movhpd", XM, EX, XX },18.1718 + { "(bad)", XM, EX, XX },18.1719 + },18.1720 + /* PREGRP32 */18.1721 + {18.1722 + { "(bad)", XM, EX, XX },18.1723 + { "(bad)", XM, EX, XX },18.1724 + { "(bad)", XM, EX, XX },18.1725 + { "lddqu", XM, M, XX },18.1726 + },18.1727 +};18.1728 +18.1729 +static const struct dis386 x86_64_table[][2] = {18.1730 + {18.1731 + { "arpl", Ew, Gw, XX },18.1732 + { "movs{||lq|xd}", Gv, Ed, XX },18.1733 + },18.1734 +};18.1735 +18.1736 +#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")18.1737 +18.1738 +static void18.1739 +ckprefix (void)18.1740 +{18.1741 + int newrex;18.1742 + rex = 0;18.1743 + prefixes = 0;18.1744 + used_prefixes = 0;18.1745 + rex_used = 0;18.1746 + while (1)18.1747 + {18.1748 + FETCH_DATA (the_info, codep + 1);18.1749 + newrex = 0;18.1750 + switch (*codep)18.1751 + {18.1752 + /* REX prefixes family. */18.1753 + case 0x40:18.1754 + case 0x41:18.1755 + case 0x42:18.1756 + case 0x43:18.1757 + case 0x44:18.1758 + case 0x45:18.1759 + case 0x46:18.1760 + case 0x47:18.1761 + case 0x48:18.1762 + case 0x49:18.1763 + case 0x4a:18.1764 + case 0x4b:18.1765 + case 0x4c:18.1766 + case 0x4d:18.1767 + case 0x4e:18.1768 + case 0x4f:18.1769 + if (mode_64bit)18.1770 + newrex = *codep;18.1771 + else18.1772 + return;18.1773 + break;18.1774 + case 0xf3:18.1775 + prefixes |= PREFIX_REPZ;18.1776 + break;18.1777 + case 0xf2:18.1778 + prefixes |= PREFIX_REPNZ;18.1779 + break;18.1780 + case 0xf0:18.1781 + prefixes |= PREFIX_LOCK;18.1782 + break;18.1783 + case 0x2e:18.1784 + prefixes |= PREFIX_CS;18.1785 + break;18.1786 + case 0x36:18.1787 + prefixes |= PREFIX_SS;18.1788 + break;18.1789 + case 0x3e:18.1790 + prefixes |= PREFIX_DS;18.1791 + break;18.1792 + case 0x26:18.1793 + prefixes |= PREFIX_ES;18.1794 + break;18.1795 + case 0x64:18.1796 + prefixes |= PREFIX_FS;18.1797 + break;18.1798 + case 0x65:18.1799 + prefixes |= PREFIX_GS;18.1800 + break;18.1801 + case 0x66:18.1802 + prefixes |= PREFIX_DATA;18.1803 + break;18.1804 + case 0x67:18.1805 + prefixes |= PREFIX_ADDR;18.1806 + break;18.1807 + case FWAIT_OPCODE:18.1808 + /* fwait is really an instruction. If there are prefixes18.1809 + before the fwait, they belong to the fwait, *not* to the18.1810 + following instruction. */18.1811 + if (prefixes)18.1812 + {18.1813 + prefixes |= PREFIX_FWAIT;18.1814 + codep++;18.1815 + return;18.1816 + }18.1817 + prefixes = PREFIX_FWAIT;18.1818 + break;18.1819 + default:18.1820 + return;18.1821 + }18.1822 + /* Rex is ignored when followed by another prefix. */18.1823 + if (rex)18.1824 + {18.1825 + oappend (prefix_name (rex, 0));18.1826 + oappend (" ");18.1827 + }18.1828 + rex = newrex;18.1829 + codep++;18.1830 + }18.1831 +}18.1832 +18.1833 +/* Return the name of the prefix byte PREF, or NULL if PREF is not a18.1834 + prefix byte. */18.1835 +18.1836 +static const char *18.1837 +prefix_name (int pref, int sizeflag)18.1838 +{18.1839 + switch (pref)18.1840 + {18.1841 + /* REX prefixes family. */18.1842 + case 0x40:18.1843 + return "rex";18.1844 + case 0x41:18.1845 + return "rexZ";18.1846 + case 0x42:18.1847 + return "rexY";18.1848 + case 0x43:18.1849 + return "rexYZ";18.1850 + case 0x44:18.1851 + return "rexX";18.1852 + case 0x45:18.1853 + return "rexXZ";18.1854 + case 0x46:18.1855 + return "rexXY";18.1856 + case 0x47:18.1857 + return "rexXYZ";18.1858 + case 0x48:18.1859 + return "rex64";18.1860 + case 0x49:18.1861 + return "rex64Z";18.1862 + case 0x4a:18.1863 + return "rex64Y";18.1864 + case 0x4b:18.1865 + return "rex64YZ";18.1866 + case 0x4c:18.1867 + return "rex64X";18.1868 + case 0x4d:18.1869 + return "rex64XZ";18.1870 + case 0x4e:18.1871 + return "rex64XY";18.1872 + case 0x4f:18.1873 + return "rex64XYZ";18.1874 + case 0xf3:18.1875 + return "repz";18.1876 + case 0xf2:18.1877 + return "repnz";18.1878 + case 0xf0:18.1879 + return "lock";18.1880 + case 0x2e:18.1881 + return "cs";18.1882 + case 0x36:18.1883 + return "ss";18.1884 + case 0x3e:18.1885 + return "ds";18.1886 + case 0x26:18.1887 + return "es";18.1888 + case 0x64:18.1889 + return "fs";18.1890 + case 0x65:18.1891 + return "gs";18.1892 + case 0x66:18.1893 + return (sizeflag & DFLAG) ? "data16" : "data32";18.1894 + case 0x67:18.1895 + if (mode_64bit)18.1896 + return (sizeflag & AFLAG) ? "addr32" : "addr64";18.1897 + else18.1898 + return ((sizeflag & AFLAG) && !mode_64bit) ? "addr16" : "addr32";18.1899 + case FWAIT_OPCODE:18.1900 + return "fwait";18.1901 + default:18.1902 + return NULL;18.1903 + }18.1904 +}18.1905 +18.1906 +static char op1out[100], op2out[100], op3out[100];18.1907 +static int op_ad, op_index[3];18.1908 +static int two_source_ops;18.1909 +static bfd_vma op_address[3];18.1910 +static bfd_vma op_riprel[3];18.1911 +static bfd_vma start_pc;18.1912 +18.1913 +/*18.1914 + * On the 386's of 1988, the maximum length of an instruction is 15 bytes.18.1915 + * (see topic "Redundant prefixes" in the "Differences from 8086"18.1916 + * section of the "Virtual 8086 Mode" chapter.)18.1917 + * 'pc' should be the address of this instruction, it will18.1918 + * be used to print the target address if this is a relative jump or call18.1919 + * The function returns the length of this instruction in bytes.18.1920 + */18.1921 +18.1922 +static char intel_syntax;18.1923 +static char open_char;18.1924 +static char close_char;18.1925 +static char separator_char;18.1926 +static char scale_char;18.1927 +18.1928 +/* Here for backwards compatibility. When gdb stops using18.1929 + print_insn_i386_att and print_insn_i386_intel these functions can18.1930 + disappear, and print_insn_i386 be merged into print_insn. */18.1931 +int18.1932 +print_insn_i386_att (bfd_vma pc, disassemble_info *info)18.1933 +{18.1934 + intel_syntax = 0;18.1935 +18.1936 + return print_insn (pc, info);18.1937 +}18.1938 +18.1939 +int18.1940 +print_insn_i386_intel (bfd_vma pc, disassemble_info *info)18.1941 +{18.1942 + intel_syntax = 1;18.1943 +18.1944 + return print_insn (pc, info);18.1945 +}18.1946 +18.1947 +int18.1948 +print_insn_i386 (bfd_vma pc, disassemble_info *info)18.1949 +{18.1950 + intel_syntax = -1;18.1951 +18.1952 + return print_insn (pc, info);18.1953 +}18.1954 +18.1955 +static int18.1956 +print_insn (bfd_vma pc, disassemble_info *info)18.1957 +{18.1958 + const struct dis386 *dp;18.1959 + int i;18.1960 + char *first, *second, *third;18.1961 + int needcomma;18.1962 + unsigned char uses_SSE_prefix, uses_LOCK_prefix;18.1963 + int sizeflag;18.1964 + const char *p;18.1965 + struct dis_private priv;18.1966 +18.1967 + mode_64bit = (info->mach == bfd_mach_x86_64_intel_syntax18.1968 + || info->mach == bfd_mach_x86_64);18.1969 +18.1970 + if (intel_syntax == (char) -1)18.1971 + intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax18.1972 + || info->mach == bfd_mach_x86_64_intel_syntax);18.1973 +18.1974 + if (info->mach == bfd_mach_i386_i38618.1975 + || info->mach == bfd_mach_x86_6418.1976 + || info->mach == bfd_mach_i386_i386_intel_syntax18.1977 + || info->mach == bfd_mach_x86_64_intel_syntax)18.1978 + priv.orig_sizeflag = AFLAG | DFLAG;18.1979 + else if (info->mach == bfd_mach_i386_i8086)18.1980 + priv.orig_sizeflag = 0;18.1981 + else18.1982 + abort ();18.1983 +18.1984 + for (p = info->disassembler_options; p != NULL; )18.1985 + {18.1986 + if (strncmp (p, "x86-64", 6) == 0)18.1987 + {18.1988 + mode_64bit = 1;18.1989 + priv.orig_sizeflag = AFLAG | DFLAG;18.1990 + }18.1991 + else if (strncmp (p, "i386", 4) == 0)18.1992 + {18.1993 + mode_64bit = 0;18.1994 + priv.orig_sizeflag = AFLAG | DFLAG;18.1995 + }18.1996 + else if (strncmp (p, "i8086", 5) == 0)18.1997 + {18.1998 + mode_64bit = 0;18.1999 + priv.orig_sizeflag = 0;18.2000 + }18.2001 + else if (strncmp (p, "intel", 5) == 0)18.2002 + {18.2003 + intel_syntax = 1;18.2004 + }18.2005 + else if (strncmp (p, "att", 3) == 0)18.2006 + {18.2007 + intel_syntax = 0;18.2008 + }18.2009 + else if (strncmp (p, "addr", 4) == 0)18.2010 + {18.2011 + if (p[4] == '1' && p[5] == '6')18.2012 + priv.orig_sizeflag &= ~AFLAG;18.2013 + else if (p[4] == '3' && p[5] == '2')18.2014 + priv.orig_sizeflag |= AFLAG;18.2015 + }18.2016 + else if (strncmp (p, "data", 4) == 0)18.2017 + {18.2018 + if (p[4] == '1' && p[5] == '6')18.2019 + priv.orig_sizeflag &= ~DFLAG;18.2020 + else if (p[4] == '3' && p[5] == '2')18.2021 + priv.orig_sizeflag |= DFLAG;18.2022 + }18.2023 + else if (strncmp (p, "suffix", 6) == 0)18.2024 + priv.orig_sizeflag |= SUFFIX_ALWAYS;18.2025 +18.2026 + p = strchr (p, ',');18.2027 + if (p != NULL)18.2028 + p++;18.2029 + }18.2030 +18.2031 + if (intel_syntax)18.2032 + {18.2033 + names64 = intel_names64;18.2034 + names32 = intel_names32;18.2035 + names16 = intel_names16;18.2036 + names8 = intel_names8;18.2037 + names8rex = intel_names8rex;18.2038 + names_seg = intel_names_seg;18.2039 + index16 = intel_index16;18.2040 + open_char = '[';18.2041 + close_char = ']';18.2042 + separator_char = '+';18.2043 + scale_char = '*';18.2044 + }18.2045 + else18.2046 + {18.2047 + names64 = att_names64;18.2048 + names32 = att_names32;18.2049 + names16 = att_names16;18.2050 + names8 = att_names8;18.2051 + names8rex = att_names8rex;18.2052 + names_seg = att_names_seg;18.2053 + index16 = att_index16;18.2054 + open_char = '(';18.2055 + close_char = ')';18.2056 + separator_char = ',';18.2057 + scale_char = ',';18.2058 + }18.2059 +18.2060 + /* The output looks better if we put 7 bytes on a line, since that18.2061 + puts most long word instructions on a single line. */18.2062 + info->bytes_per_line = 7;18.2063 +18.2064 + info->private_data = &priv;18.2065 + priv.max_fetched = priv.the_buffer;18.2066 + priv.insn_start = pc;18.2067 +18.2068 + obuf[0] = 0;18.2069 + op1out[0] = 0;18.2070 + op2out[0] = 0;18.2071 + op3out[0] = 0;18.2072 +18.2073 + op_index[0] = op_index[1] = op_index[2] = -1;18.2074 +18.2075 + the_info = info;18.2076 + start_pc = pc;18.2077 + start_codep = priv.the_buffer;18.2078 + codep = priv.the_buffer;18.2079 +18.2080 + if (setjmp (priv.bailout) != 0)18.2081 + {18.2082 + const char *name;18.2083 +18.2084 + /* Getting here means we tried for data but didn't get it. That18.2085 + means we have an incomplete instruction of some sort. Just18.2086 + print the first byte as a prefix or a .byte pseudo-op. */18.2087 + if (codep > priv.the_buffer)18.2088 + {18.2089 + name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);18.2090 + if (name != NULL)18.2091 + (*info->fprintf_func) (info->stream, "%s", name);18.2092 + else18.2093 + {18.2094 + /* Just print the first byte as a .byte instruction. */18.2095 + (*info->fprintf_func) (info->stream, ".byte 0x%x",18.2096 + (unsigned int) priv.the_buffer[0]);18.2097 + }18.2098 +18.2099 + return 1;18.2100 + }18.2101 +18.2102 + return -1;18.2103 + }18.2104 +18.2105 + obufp = obuf;18.2106 + ckprefix ();18.2107 +18.2108 + insn_codep = codep;18.2109 + sizeflag = priv.orig_sizeflag;18.2110 +18.2111 + FETCH_DATA (info, codep + 1);18.2112 + two_source_ops = (*codep == 0x62) || (*codep == 0xc8);18.2113 +18.2114 + if ((prefixes & PREFIX_FWAIT)18.2115 + && ((*codep < 0xd8) || (*codep > 0xdf)))18.2116 + {18.2117 + const char *name;18.2118 +18.2119 + /* fwait not followed by floating point instruction. Print the18.2120 + first prefix, which is probably fwait itself. */18.2121 + name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);18.2122 + if (name == NULL)18.2123 + name = INTERNAL_DISASSEMBLER_ERROR;18.2124 + (*info->fprintf_func) (info->stream, "%s", name);18.2125 + return 1;18.2126 + }18.2127 +18.2128 + if (*codep == 0x0f)18.2129 + {18.2130 + FETCH_DATA (info, codep + 2);18.2131 + dp = &dis386_twobyte[*++codep];18.2132 + need_modrm = twobyte_has_modrm[*codep];18.2133 + uses_SSE_prefix = twobyte_uses_SSE_prefix[*codep];18.2134 + uses_LOCK_prefix = (*codep & ~0x02) == 0x20;18.2135 + }18.2136 + else18.2137 + {18.2138 + dp = &dis386[*codep];18.2139 + need_modrm = onebyte_has_modrm[*codep];18.2140 + uses_SSE_prefix = 0;18.2141 + uses_LOCK_prefix = 0;18.2142 + }18.2143 + codep++;18.2144 +18.2145 + if (!uses_SSE_prefix && (prefixes & PREFIX_REPZ))18.2146 + {18.2147 + oappend ("repz ");18.2148 + used_prefixes |= PREFIX_REPZ;18.2149 + }18.2150 + if (!uses_SSE_prefix && (prefixes & PREFIX_REPNZ))18.2151 + {18.2152 + oappend ("repnz ");18.2153 + used_prefixes |= PREFIX_REPNZ;18.2154 + }18.2155 + if (!uses_LOCK_prefix && (prefixes & PREFIX_LOCK))18.2156 + {18.2157 + oappend ("lock ");18.2158 + used_prefixes |= PREFIX_LOCK;18.2159 + }18.2160 +18.2161 + if (prefixes & PREFIX_ADDR)18.2162 + {18.2163 + sizeflag ^= AFLAG;18.2164 + if (dp->bytemode3 != loop_jcxz_mode || intel_syntax)18.2165 + {18.2166 + if ((sizeflag & AFLAG) || mode_64bit)18.2167 + oappend ("addr32 ");18.2168 + else18.2169 + oappend ("addr16 ");18.2170 + used_prefixes |= PREFIX_ADDR;18.2171 + }18.2172 + }18.2173 +18.2174 + if (!uses_SSE_prefix && (prefixes & PREFIX_DATA))18.2175 + {18.2176 + sizeflag ^= DFLAG;18.2177 + if (dp->bytemode3 == cond_jump_mode18.2178 + && dp->bytemode1 == v_mode18.2179 + && !intel_syntax)18.2180 + {18.2181 + if (sizeflag & DFLAG)18.2182 + oappend ("data32 ");18.2183 + else18.2184 + oappend ("data16 ");18.2185 + used_prefixes |= PREFIX_DATA;18.2186 + }18.2187 + }18.2188 +18.2189 + if (need_modrm)18.2190 + {18.2191 + FETCH_DATA (info, codep + 1);18.2192 + mod = (*codep >> 6) & 3;18.2193 + reg = (*codep >> 3) & 7;18.2194 + rm = *codep & 7;18.2195 + }18.2196 +18.2197 + if (dp->name == NULL && dp->bytemode1 == FLOATCODE)18.2198 + {18.2199 + dofloat (sizeflag);18.2200 + }18.2201 + else18.2202 + {18.2203 + int index;18.2204 + if (dp->name == NULL)18.2205 + {18.2206 + switch (dp->bytemode1)18.2207 + {18.2208 + case USE_GROUPS:18.2209 + dp = &grps[dp->bytemode2][reg];18.2210 + break;18.2211 +18.2212 + case USE_PREFIX_USER_TABLE:18.2213 + index = 0;18.2214 + used_prefixes |= (prefixes & PREFIX_REPZ);18.2215 + if (prefixes & PREFIX_REPZ)18.2216 + index = 1;18.2217 + else18.2218 + {18.2219 + used_prefixes |= (prefixes & PREFIX_DATA);18.2220 + if (prefixes & PREFIX_DATA)18.2221 + index = 2;18.2222 + else18.2223 + {18.2224 + used_prefixes |= (prefixes & PREFIX_REPNZ);18.2225 + if (prefixes & PREFIX_REPNZ)18.2226 + index = 3;18.2227 + }18.2228 + }18.2229 + dp = &prefix_user_table[dp->bytemode2][index];18.2230 + break;18.2231 +18.2232 + case X86_64_SPECIAL:18.2233 + dp = &x86_64_table[dp->bytemode2][mode_64bit];18.2234 + break;18.2235 +18.2236 + default:18.2237 + oappend (INTERNAL_DISASSEMBLER_ERROR);18.2238 + break;18.2239 + }18.2240 + }18.2241 +18.2242 + if (putop (dp->name, sizeflag) == 0)18.2243 + {18.2244 + obufp = op1out;18.2245 + op_ad = 2;18.2246 + if (dp->op1)18.2247 + (*dp->op1) (dp->bytemode1, sizeflag);18.2248 +18.2249 + obufp = op2out;18.2250 + op_ad = 1;18.2251 + if (dp->op2)18.2252 + (*dp->op2) (dp->bytemode2, sizeflag);18.2253 +18.2254 + obufp = op3out;18.2255 + op_ad = 0;18.2256 + if (dp->op3)18.2257 + (*dp->op3) (dp->bytemode3, sizeflag);18.2258 + }18.2259 + }18.2260 +18.2261 + /* See if any prefixes were not used. If so, print the first one18.2262 + separately. If we don't do this, we'll wind up printing an18.2263 + instruction stream which does not precisely correspond to the18.2264 + bytes we are disassembling. */18.2265 + if ((prefixes & ~used_prefixes) != 0)18.2266 + {18.2267 + const char *name;18.2268 +18.2269 + name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);18.2270 + if (name == NULL)18.2271 + name = INTERNAL_DISASSEMBLER_ERROR;18.2272 + (*info->fprintf_func) (info->stream, "%s", name);18.2273 + return 1;18.2274 + }18.2275 + if (rex & ~rex_used)18.2276 + {18.2277 + const char *name;18.2278 + name = prefix_name (rex | 0x40, priv.orig_sizeflag);18.2279 + if (name == NULL)18.2280 + name = INTERNAL_DISASSEMBLER_ERROR;18.2281 + (*info->fprintf_func) (info->stream, "%s ", name);18.2282 + }18.2283 +18.2284 + obufp = obuf + strlen (obuf);18.2285 + for (i = strlen (obuf); i < 6; i++)18.2286 + oappend (" ");18.2287 + oappend (" ");18.2288 + (*info->fprintf_func) (info->stream, "%s", obuf);18.2289 +18.2290 + /* The enter and bound instructions are printed with operands in the same18.2291 + order as the intel book; everything else is printed in reverse order. */18.2292 + if (intel_syntax || two_source_ops)18.2293 + {18.2294 + first = op1out;18.2295 + second = op2out;18.2296 + third = op3out;18.2297 + op_ad = op_index[0];18.2298 + op_index[0] = op_index[2];18.2299 + op_index[2] = op_ad;18.2300 + }18.2301 + else18.2302 + {18.2303 + first = op3out;18.2304 + second = op2out;18.2305 + third = op1out;18.2306 + }18.2307 + needcomma = 0;18.2308 + if (*first)18.2309 + {18.2310 + if (op_index[0] != -1 && !op_riprel[0])18.2311 + (*info->print_address_func) ((bfd_vma) op_address[op_index[0]], info);18.2312 + else18.2313 + (*info->fprintf_func) (info->stream, "%s", first);18.2314 + needcomma = 1;18.2315 + }18.2316 + if (*second)18.2317 + {18.2318 + if (needcomma)18.2319 + (*info->fprintf_func) (info->stream, ",");18.2320 + if (op_index[1] != -1 && !op_riprel[1])18.2321 + (*info->print_address_func) ((bfd_vma) op_address[op_index[1]], info);18.2322 + else18.2323 + (*info->fprintf_func) (info->stream, "%s", second);18.2324 + needcomma = 1;18.2325 + }18.2326 + if (*third)18.2327 + {18.2328 + if (needcomma)18.2329 + (*info->fprintf_func) (info->stream, ",");18.2330 + if (op_index[2] != -1 && !op_riprel[2])18.2331 + (*info->print_address_func) ((bfd_vma) op_address[op_index[2]], info);18.2332 + else18.2333 + (*info->fprintf_func) (info->stream, "%s", third);18.2334 + }18.2335 + for (i = 0; i < 3; i++)18.2336 + if (op_index[i] != -1 && op_riprel[i])18.2337 + {18.2338 + (*info->fprintf_func) (info->stream, " # ");18.2339 + (*info->print_address_func) ((bfd_vma) (start_pc + codep - start_codep18.2340 + + op_address[op_index[i]]), info);18.2341 + }18.2342 + return codep - priv.the_buffer;18.2343 +}18.2344 +18.2345 +static const char *float_mem[] = {18.2346 + /* d8 */18.2347 + "fadd{s||s|}",18.2348 + "fmul{s||s|}",18.2349 + "fcom{s||s|}",18.2350 + "fcomp{s||s|}",18.2351 + "fsub{s||s|}",18.2352 + "fsubr{s||s|}",18.2353 + "fdiv{s||s|}",18.2354 + "fdivr{s||s|}",18.2355 + /* d9 */18.2356 + "fld{s||s|}",18.2357 + "(bad)",18.2358 + "fst{s||s|}",18.2359 + "fstp{s||s|}",18.2360 + "fldenvIC",18.2361 + "fldcw",18.2362 + "fNstenvIC",18.2363 + "fNstcw",18.2364 + /* da */18.2365 + "fiadd{l||l|}",18.2366 + "fimul{l||l|}",18.2367 + "ficom{l||l|}",18.2368 + "ficomp{l||l|}",18.2369 + "fisub{l||l|}",18.2370 + "fisubr{l||l|}",18.2371 + "fidiv{l||l|}",18.2372 + "fidivr{l||l|}",18.2373 + /* db */18.2374 + "fild{l||l|}",18.2375 + "fisttp{l||l|}",18.2376 + "fist{l||l|}",18.2377 + "fistp{l||l|}",18.2378 + "(bad)",18.2379 + "fld{t||t|}",18.2380 + "(bad)",18.2381 + "fstp{t||t|}",18.2382 + /* dc */18.2383 + "fadd{l||l|}",18.2384 + "fmul{l||l|}",18.2385 + "fcom{l||l|}",18.2386 + "fcomp{l||l|}",18.2387 + "fsub{l||l|}",18.2388 + "fsubr{l||l|}",18.2389 + "fdiv{l||l|}",18.2390 + "fdivr{l||l|}",18.2391 + /* dd */18.2392 + "fld{l||l|}",18.2393 + "fisttp{ll||ll|}",18.2394 + "fst{l||l|}",18.2395 + "fstp{l||l|}",18.2396 + "frstorIC",18.2397 + "(bad)",18.2398 + "fNsaveIC",18.2399 + "fNstsw",18.2400 + /* de */18.2401 + "fiadd",18.2402 + "fimul",18.2403 + "ficom",18.2404 + "ficomp",18.2405 + "fisub",18.2406 + "fisubr",18.2407 + "fidiv",18.2408 + "fidivr",18.2409 + /* df */18.2410 + "fild",18.2411 + "fisttp",18.2412 + "fist",18.2413 + "fistp",18.2414 + "fbld",18.2415 + "fild{ll||ll|}",18.2416 + "fbstp",18.2417 + "fistp{ll||ll|}",18.2418 +};18.2419 +18.2420 +static const unsigned char float_mem_mode[] = {18.2421 + /* d8 */18.2422 + d_mode,18.2423 + d_mode,18.2424 + d_mode,18.2425 + d_mode,18.2426 + d_mode,18.2427 + d_mode,18.2428 + d_mode,18.2429 + d_mode,18.2430 + /* d9 */18.2431 + d_mode,18.2432 + 0,18.2433 + d_mode,18.2434 + d_mode,18.2435 + 0,18.2436 + w_mode,18.2437 + 0,18.2438 + w_mode,18.2439 + /* da */18.2440 + d_mode,18.2441 + d_mode,18.2442 + d_mode,18.2443 + d_mode,18.2444 + d_mode,18.2445 + d_mode,18.2446 + d_mode,18.2447 + d_mode,18.2448 + /* db */18.2449 + d_mode,18.2450 + d_mode,18.2451 + d_mode,18.2452 + d_mode,18.2453 + 0,18.2454 + t_mode,18.2455 + 0,18.2456 + t_mode,18.2457 + /* dc */18.2458 + q_mode,18.2459 + q_mode,18.2460 + q_mode,18.2461 + q_mode,18.2462 + q_mode,18.2463 + q_mode,18.2464 + q_mode,18.2465 + q_mode,18.2466 + /* dd */18.2467 + q_mode,18.2468 + q_mode,18.2469 + q_mode,18.2470 + q_mode,18.2471 + 0,18.2472 + 0,18.2473 + 0,18.2474 + w_mode,18.2475 + /* de */18.2476 + w_mode,18.2477 + w_mode,18.2478 + w_mode,18.2479 + w_mode,18.2480 + w_mode,18.2481 + w_mode,18.2482 + w_mode,18.2483 + w_mode,18.2484 + /* df */18.2485 + w_mode,18.2486 + w_mode,18.2487 + w_mode,18.2488 + w_mode,18.2489 + t_mode,18.2490 + q_mode,18.2491 + t_mode,18.2492 + q_mode18.2493 +};18.2494 +18.2495 +#define ST OP_ST, 018.2496 +#define STi OP_STi, 018.2497 +18.2498 +#define FGRPd9_2 NULL, NULL, 0, NULL, 0, NULL, 018.2499 +#define FGRPd9_4 NULL, NULL, 1, NULL, 0, NULL, 018.2500 +#define FGRPd9_5 NULL, NULL, 2, NULL, 0, NULL, 018.2501 +#define FGRPd9_6 NULL, NULL, 3, NULL, 0, NULL, 018.2502 +#define FGRPd9_7 NULL, NULL, 4, NULL, 0, NULL, 018.2503 +#define FGRPda_5 NULL, NULL, 5, NULL, 0, NULL, 018.2504 +#define FGRPdb_4 NULL, NULL, 6, NULL, 0, NULL, 018.2505 +#define FGRPde_3 NULL, NULL, 7, NULL, 0, NULL, 018.2506 +#define FGRPdf_4 NULL, NULL, 8, NULL, 0, NULL, 018.2507 +18.2508 +static const struct dis386 float_reg[][8] = {18.2509 + /* d8 */18.2510 + {18.2511 + { "fadd", ST, STi, XX },18.2512 + { "fmul", ST, STi, XX },18.2513 + { "fcom", STi, XX, XX },18.2514 + { "fcomp", STi, XX, XX },18.2515 + { "fsub", ST, STi, XX },18.2516 + { "fsubr", ST, STi, XX },18.2517 + { "fdiv", ST, STi, XX },18.2518 + { "fdivr", ST, STi, XX },18.2519 + },18.2520 + /* d9 */18.2521 + {18.2522 + { "fld", STi, XX, XX },18.2523 + { "fxch", STi, XX, XX },18.2524 + { FGRPd9_2 },18.2525 + { "(bad)", XX, XX, XX },18.2526 + { FGRPd9_4 },18.2527 + { FGRPd9_5 },18.2528 + { FGRPd9_6 },18.2529 + { FGRPd9_7 },18.2530 + },18.2531 + /* da */18.2532 + {18.2533 + { "fcmovb", ST, STi, XX },18.2534 + { "fcmove", ST, STi, XX },18.2535 + { "fcmovbe",ST, STi, XX },18.2536 + { "fcmovu", ST, STi, XX },18.2537 + { "(bad)", XX, XX, XX },18.2538 + { FGRPda_5 },18.2539 + { "(bad)", XX, XX, XX },18.2540 + { "(bad)", XX, XX, XX },18.2541 + },18.2542 + /* db */18.2543 + {18.2544 + { "fcmovnb",ST, STi, XX },18.2545 + { "fcmovne",ST, STi, XX },18.2546 + { "fcmovnbe",ST, STi, XX },18.2547 + { "fcmovnu",ST, STi, XX },18.2548 + { FGRPdb_4 },18.2549 + { "fucomi", ST, STi, XX },18.2550 + { "fcomi", ST, STi, XX },18.2551 + { "(bad)", XX, XX, XX },18.2552 + },18.2553 + /* dc */18.2554 + {18.2555 + { "fadd", STi, ST, XX },18.2556 + { "fmul", STi, ST, XX },18.2557 + { "(bad)", XX, XX, XX },18.2558 + { "(bad)", XX, XX, XX },18.2559 +#if UNIXWARE_COMPAT18.2560 + { "fsub", STi, ST, XX },18.2561 + { "fsubr", STi, ST, XX },18.2562 + { "fdiv", STi, ST, XX },18.2563 + { "fdivr", STi, ST, XX },18.2564 +#else18.2565 + { "fsubr", STi, ST, XX },18.2566 + { "fsub", STi, ST, XX },18.2567 + { "fdivr", STi, ST, XX },18.2568 + { "fdiv", STi, ST, XX },18.2569 +#endif18.2570 + },18.2571 + /* dd */18.2572 + {18.2573 + { "ffree", STi, XX, XX },18.2574 + { "(bad)", XX, XX, XX },18.2575 + { "fst", STi, XX, XX },18.2576 + { "fstp", STi, XX, XX },18.2577 + { "fucom", STi, XX, XX },18.2578 + { "fucomp", STi, XX, XX },18.2579 + { "(bad)", XX, XX, XX },18.2580 + { "(bad)", XX, XX, XX },18.2581 + },18.2582 + /* de */18.2583 + {18.2584 + { "faddp", STi, ST, XX },18.2585 + { "fmulp", STi, ST, XX },18.2586 + { "(bad)", XX, XX, XX },18.2587 + { FGRPde_3 },18.2588 +#if UNIXWARE_COMPAT18.2589 + { "fsubp", STi, ST, XX },18.2590 + { "fsubrp", STi, ST, XX },18.2591 + { "fdivp", STi, ST, XX },18.2592 + { "fdivrp", STi, ST, XX },18.2593 +#else18.2594 + { "fsubrp", STi, ST, XX },18.2595 + { "fsubp", STi, ST, XX },18.2596 + { "fdivrp", STi, ST, XX },18.2597 + { "fdivp", STi, ST, XX },18.2598 +#endif18.2599 + },18.2600 + /* df */18.2601 + {18.2602 + { "ffreep", STi, XX, XX },18.2603 + { "(bad)", XX, XX, XX },18.2604 + { "(bad)", XX, XX, XX },18.2605 + { "(bad)", XX, XX, XX },18.2606 + { FGRPdf_4 },18.2607 + { "fucomip",ST, STi, XX },18.2608 + { "fcomip", ST, STi, XX },18.2609 + { "(bad)", XX, XX, XX },18.2610 + },18.2611 +};18.2612 +18.2613 +static char *fgrps[][8] = {18.2614 + /* d9_2 0 */18.2615 + {18.2616 + "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",18.2617 + },18.2618 +18.2619 + /* d9_4 1 */18.2620 + {18.2621 + "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",18.2622 + },18.2623 +18.2624 + /* d9_5 2 */18.2625 + {18.2626 + "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",18.2627 + },18.2628 +18.2629 + /* d9_6 3 */18.2630 + {18.2631 + "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",18.2632 + },18.2633 +18.2634 + /* d9_7 4 */18.2635 + {18.2636 + "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",18.2637 + },18.2638 +18.2639 + /* da_5 5 */18.2640 + {18.2641 + "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",18.2642 + },18.2643 +18.2644 + /* db_4 6 */18.2645 + {18.2646 + "feni(287 only)","fdisi(287 only)","fNclex","fNinit",18.2647 + "fNsetpm(287 only)","(bad)","(bad)","(bad)",18.2648 + },18.2649 +18.2650 + /* de_3 7 */18.2651 + {18.2652 + "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",18.2653 + },18.2654 +18.2655 + /* df_4 8 */18.2656 + {18.2657 + "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",18.2658 + },18.2659 +};18.2660 +18.2661 +static void18.2662 +dofloat (int sizeflag)18.2663 +{18.2664 + const struct dis386 *dp;18.2665 + unsigned char floatop;18.2666 +18.2667 + floatop = codep[-1];18.2668 +18.2669 + if (mod != 3)18.2670 + {18.2671 + int fp_indx = (floatop - 0xd8) * 8 + reg;18.2672 +18.2673 + putop (float_mem[fp_indx], sizeflag);18.2674 + obufp = op1out;18.2675 + OP_E (float_mem_mode[fp_indx], sizeflag);18.2676 + return;18.2677 + }18.2678 + /* Skip mod/rm byte. */18.2679 + MODRM_CHECK;18.2680 + codep++;18.2681 +18.2682 + dp = &float_reg[floatop - 0xd8][reg];18.2683 + if (dp->name == NULL)18.2684 + {18.2685 + putop (fgrps[dp->bytemode1][rm], sizeflag);18.2686 +18.2687 + /* Instruction fnstsw is only one with strange arg. */18.2688 + if (floatop == 0xdf && codep[-1] == 0xe0)18.2689 + strcpy (op1out, names16[0]);18.2690 + }18.2691 + else18.2692 + {18.2693 + putop (dp->name, sizeflag);18.2694 +18.2695 + obufp = op1out;18.2696 + if (dp->op1)18.2697 + (*dp->op1) (dp->bytemode1, sizeflag);18.2698 + obufp = op2out;18.2699 + if (dp->op2)18.2700 + (*dp->op2) (dp->bytemode2, sizeflag);18.2701 + }18.2702 +}18.2703 +18.2704 +static void18.2705 +OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.2706 +{18.2707 + oappend ("%st");18.2708 +}18.2709 +18.2710 +static void18.2711 +OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.2712 +{18.2713 + sprintf (scratchbuf, "%%st(%d)", rm);18.2714 + oappend (scratchbuf + intel_syntax);18.2715 +}18.2716 +18.2717 +/* Capital letters in template are macros. */18.2718 +static int18.2719 +putop (const char *template, int sizeflag)18.2720 +{18.2721 + const char *p;18.2722 + int alt = 0;18.2723 +18.2724 + for (p = template; *p; p++)18.2725 + {18.2726 + switch (*p)18.2727 + {18.2728 + default:18.2729 + *obufp++ = *p;18.2730 + break;18.2731 + case '{':18.2732 + alt = 0;18.2733 + if (intel_syntax)18.2734 + alt += 1;18.2735 + if (mode_64bit)18.2736 + alt += 2;18.2737 + while (alt != 0)18.2738 + {18.2739 + while (*++p != '|')18.2740 + {18.2741 + if (*p == '}')18.2742 + {18.2743 + /* Alternative not valid. */18.2744 + strcpy (obuf, "(bad)");18.2745 + obufp = obuf + 5;18.2746 + return 1;18.2747 + }18.2748 + else if (*p == '\0')18.2749 + abort ();18.2750 + }18.2751 + alt--;18.2752 + }18.2753 + /* Fall through. */18.2754 + case 'I':18.2755 + alt = 1;18.2756 + continue;18.2757 + case '|':18.2758 + while (*++p != '}')18.2759 + {18.2760 + if (*p == '\0')18.2761 + abort ();18.2762 + }18.2763 + break;18.2764 + case '}':18.2765 + break;18.2766 + case 'A':18.2767 + if (intel_syntax)18.2768 + break;18.2769 + if (mod != 3 || (sizeflag & SUFFIX_ALWAYS))18.2770 + *obufp++ = 'b';18.2771 + break;18.2772 + case 'B':18.2773 + if (intel_syntax)18.2774 + break;18.2775 + if (sizeflag & SUFFIX_ALWAYS)18.2776 + *obufp++ = 'b';18.2777 + break;18.2778 + case 'C':18.2779 + if (intel_syntax && !alt)18.2780 + break;18.2781 + if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))18.2782 + {18.2783 + if (sizeflag & DFLAG)18.2784 + *obufp++ = intel_syntax ? 'd' : 'l';18.2785 + else18.2786 + *obufp++ = intel_syntax ? 'w' : 's';18.2787 + used_prefixes |= (prefixes & PREFIX_DATA);18.2788 + }18.2789 + break;18.2790 + case 'E': /* For jcxz/jecxz */18.2791 + if (mode_64bit)18.2792 + {18.2793 + if (sizeflag & AFLAG)18.2794 + *obufp++ = 'r';18.2795 + else18.2796 + *obufp++ = 'e';18.2797 + }18.2798 + else18.2799 + if (sizeflag & AFLAG)18.2800 + *obufp++ = 'e';18.2801 + used_prefixes |= (prefixes & PREFIX_ADDR);18.2802 + break;18.2803 + case 'F':18.2804 + if (intel_syntax)18.2805 + break;18.2806 + if ((prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS))18.2807 + {18.2808 + if (sizeflag & AFLAG)18.2809 + *obufp++ = mode_64bit ? 'q' : 'l';18.2810 + else18.2811 + *obufp++ = mode_64bit ? 'l' : 'w';18.2812 + used_prefixes |= (prefixes & PREFIX_ADDR);18.2813 + }18.2814 + break;18.2815 + case 'H':18.2816 + if (intel_syntax)18.2817 + break;18.2818 + if ((prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_CS18.2819 + || (prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_DS)18.2820 + {18.2821 + used_prefixes |= prefixes & (PREFIX_CS | PREFIX_DS);18.2822 + *obufp++ = ',';18.2823 + *obufp++ = 'p';18.2824 + if (prefixes & PREFIX_DS)18.2825 + *obufp++ = 't';18.2826 + else18.2827 + *obufp++ = 'n';18.2828 + }18.2829 + break;18.2830 + case 'J':18.2831 + if (intel_syntax)18.2832 + break;18.2833 + *obufp++ = 'l';18.2834 + break;18.2835 + case 'L':18.2836 + if (intel_syntax)18.2837 + break;18.2838 + if (sizeflag & SUFFIX_ALWAYS)18.2839 + *obufp++ = 'l';18.2840 + break;18.2841 + case 'N':18.2842 + if ((prefixes & PREFIX_FWAIT) == 0)18.2843 + *obufp++ = 'n';18.2844 + else18.2845 + used_prefixes |= PREFIX_FWAIT;18.2846 + break;18.2847 + case 'O':18.2848 + USED_REX (REX_MODE64);18.2849 + if (rex & REX_MODE64)18.2850 + *obufp++ = 'o';18.2851 + else18.2852 + *obufp++ = 'd';18.2853 + break;18.2854 + case 'T':18.2855 + if (intel_syntax)18.2856 + break;18.2857 + if (mode_64bit)18.2858 + {18.2859 + *obufp++ = 'q';18.2860 + break;18.2861 + }18.2862 + /* Fall through. */18.2863 + case 'P':18.2864 + if (intel_syntax)18.2865 + break;18.2866 + if ((prefixes & PREFIX_DATA)18.2867 + || (rex & REX_MODE64)18.2868 + || (sizeflag & SUFFIX_ALWAYS))18.2869 + {18.2870 + USED_REX (REX_MODE64);18.2871 + if (rex & REX_MODE64)18.2872 + *obufp++ = 'q';18.2873 + else18.2874 + {18.2875 + if (sizeflag & DFLAG)18.2876 + *obufp++ = 'l';18.2877 + else18.2878 + *obufp++ = 'w';18.2879 + used_prefixes |= (prefixes & PREFIX_DATA);18.2880 + }18.2881 + }18.2882 + break;18.2883 + case 'U':18.2884 + if (intel_syntax)18.2885 + break;18.2886 + if (mode_64bit)18.2887 + {18.2888 + *obufp++ = 'q';18.2889 + break;18.2890 + }18.2891 + /* Fall through. */18.2892 + case 'Q':18.2893 + if (intel_syntax && !alt)18.2894 + break;18.2895 + USED_REX (REX_MODE64);18.2896 + if (mod != 3 || (sizeflag & SUFFIX_ALWAYS))18.2897 + {18.2898 + if (rex & REX_MODE64)18.2899 + *obufp++ = 'q';18.2900 + else18.2901 + {18.2902 + if (sizeflag & DFLAG)18.2903 + *obufp++ = intel_syntax ? 'd' : 'l';18.2904 + else18.2905 + *obufp++ = 'w';18.2906 + used_prefixes |= (prefixes & PREFIX_DATA);18.2907 + }18.2908 + }18.2909 + break;18.2910 + case 'R':18.2911 + USED_REX (REX_MODE64);18.2912 + if (intel_syntax)18.2913 + {18.2914 + if (rex & REX_MODE64)18.2915 + {18.2916 + *obufp++ = 'q';18.2917 + *obufp++ = 't';18.2918 + }18.2919 + else if (sizeflag & DFLAG)18.2920 + {18.2921 + *obufp++ = 'd';18.2922 + *obufp++ = 'q';18.2923 + }18.2924 + else18.2925 + {18.2926 + *obufp++ = 'w';18.2927 + *obufp++ = 'd';18.2928 + }18.2929 + }18.2930 + else18.2931 + {18.2932 + if (rex & REX_MODE64)18.2933 + *obufp++ = 'q';18.2934 + else if (sizeflag & DFLAG)18.2935 + *obufp++ = 'l';18.2936 + else18.2937 + *obufp++ = 'w';18.2938 + }18.2939 + if (!(rex & REX_MODE64))18.2940 + used_prefixes |= (prefixes & PREFIX_DATA);18.2941 + break;18.2942 + case 'S':18.2943 + if (intel_syntax)18.2944 + break;18.2945 + if (sizeflag & SUFFIX_ALWAYS)18.2946 + {18.2947 + if (rex & REX_MODE64)18.2948 + *obufp++ = 'q';18.2949 + else18.2950 + {18.2951 + if (sizeflag & DFLAG)18.2952 + *obufp++ = 'l';18.2953 + else18.2954 + *obufp++ = 'w';18.2955 + used_prefixes |= (prefixes & PREFIX_DATA);18.2956 + }18.2957 + }18.2958 + break;18.2959 + case 'X':18.2960 + if (prefixes & PREFIX_DATA)18.2961 + *obufp++ = 'd';18.2962 + else18.2963 + *obufp++ = 's';18.2964 + used_prefixes |= (prefixes & PREFIX_DATA);18.2965 + break;18.2966 + case 'Y':18.2967 + if (intel_syntax)18.2968 + break;18.2969 + if (rex & REX_MODE64)18.2970 + {18.2971 + USED_REX (REX_MODE64);18.2972 + *obufp++ = 'q';18.2973 + }18.2974 + break;18.2975 + /* implicit operand size 'l' for i386 or 'q' for x86-64 */18.2976 + case 'W':18.2977 + /* operand size flag for cwtl, cbtw */18.2978 + USED_REX (0);18.2979 + if (rex)18.2980 + *obufp++ = 'l';18.2981 + else if (sizeflag & DFLAG)18.2982 + *obufp++ = 'w';18.2983 + else18.2984 + *obufp++ = 'b';18.2985 + if (intel_syntax)18.2986 + {18.2987 + if (rex)18.2988 + {18.2989 + *obufp++ = 'q';18.2990 + *obufp++ = 'e';18.2991 + }18.2992 + if (sizeflag & DFLAG)18.2993 + {18.2994 + *obufp++ = 'd';18.2995 + *obufp++ = 'e';18.2996 + }18.2997 + else18.2998 + {18.2999 + *obufp++ = 'w';18.3000 + }18.3001 + }18.3002 + if (!rex)18.3003 + used_prefixes |= (prefixes & PREFIX_DATA);18.3004 + break;18.3005 + }18.3006 + alt = 0;18.3007 + }18.3008 + *obufp = 0;18.3009 + return 0;18.3010 +}18.3011 +18.3012 +static void18.3013 +oappend (const char *s)18.3014 +{18.3015 + strcpy (obufp, s);18.3016 + obufp += strlen (s);18.3017 +}18.3018 +18.3019 +static void18.3020 +append_seg (void)18.3021 +{18.3022 + if (prefixes & PREFIX_CS)18.3023 + {18.3024 + used_prefixes |= PREFIX_CS;18.3025 + oappend ("%cs:" + intel_syntax);18.3026 + }18.3027 + if (prefixes & PREFIX_DS)18.3028 + {18.3029 + used_prefixes |= PREFIX_DS;18.3030 + oappend ("%ds:" + intel_syntax);18.3031 + }18.3032 + if (prefixes & PREFIX_SS)18.3033 + {18.3034 + used_prefixes |= PREFIX_SS;18.3035 + oappend ("%ss:" + intel_syntax);18.3036 + }18.3037 + if (prefixes & PREFIX_ES)18.3038 + {18.3039 + used_prefixes |= PREFIX_ES;18.3040 + oappend ("%es:" + intel_syntax);18.3041 + }18.3042 + if (prefixes & PREFIX_FS)18.3043 + {18.3044 + used_prefixes |= PREFIX_FS;18.3045 + oappend ("%fs:" + intel_syntax);18.3046 + }18.3047 + if (prefixes & PREFIX_GS)18.3048 + {18.3049 + used_prefixes |= PREFIX_GS;18.3050 + oappend ("%gs:" + intel_syntax);18.3051 + }18.3052 +}18.3053 +18.3054 +static void18.3055 +OP_indirE (int bytemode, int sizeflag)18.3056 +{18.3057 + if (!intel_syntax)18.3058 + oappend ("*");18.3059 + OP_E (bytemode, sizeflag);18.3060 +}18.3061 +18.3062 +static void18.3063 +OP_E (int bytemode, int sizeflag)18.3064 +{18.3065 + bfd_vma disp;18.3066 + int add = 0;18.3067 + int riprel = 0;18.3068 + USED_REX (REX_EXTZ);18.3069 + if (rex & REX_EXTZ)18.3070 + add += 8;18.3071 +18.3072 + /* Skip mod/rm byte. */18.3073 + MODRM_CHECK;18.3074 + codep++;18.3075 +18.3076 + if (mod == 3)18.3077 + {18.3078 + switch (bytemode)18.3079 + {18.3080 + case b_mode:18.3081 + USED_REX (0);18.3082 + if (rex)18.3083 + oappend (names8rex[rm + add]);18.3084 + else18.3085 + oappend (names8[rm + add]);18.3086 + break;18.3087 + case w_mode:18.3088 + oappend (names16[rm + add]);18.3089 + break;18.3090 + case d_mode:18.3091 + oappend (names32[rm + add]);18.3092 + break;18.3093 + case q_mode:18.3094 + oappend (names64[rm + add]);18.3095 + break;18.3096 + case m_mode:18.3097 + if (mode_64bit)18.3098 + oappend (names64[rm + add]);18.3099 + else18.3100 + oappend (names32[rm + add]);18.3101 + break;18.3102 + case v_mode:18.3103 + case dq_mode:18.3104 + case dqw_mode:18.3105 + USED_REX (REX_MODE64);18.3106 + if (rex & REX_MODE64)18.3107 + oappend (names64[rm + add]);18.3108 + else if ((sizeflag & DFLAG) || bytemode != v_mode)18.3109 + oappend (names32[rm + add]);18.3110 + else18.3111 + oappend (names16[rm + add]);18.3112 + used_prefixes |= (prefixes & PREFIX_DATA);18.3113 + break;18.3114 + case 0:18.3115 + break;18.3116 + default:18.3117 + oappend (INTERNAL_DISASSEMBLER_ERROR);18.3118 + break;18.3119 + }18.3120 + return;18.3121 + }18.3122 +18.3123 + disp = 0;18.3124 + append_seg ();18.3125 +18.3126 + if ((sizeflag & AFLAG) || mode_64bit) /* 32 bit address mode */18.3127 + {18.3128 + int havesib;18.3129 + int havebase;18.3130 + int base;18.3131 + int index = 0;18.3132 + int scale = 0;18.3133 +18.3134 + havesib = 0;18.3135 + havebase = 1;18.3136 + base = rm;18.3137 +18.3138 + if (base == 4)18.3139 + {18.3140 + havesib = 1;18.3141 + FETCH_DATA (the_info, codep + 1);18.3142 + index = (*codep >> 3) & 7;18.3143 + if (mode_64bit || index != 0x4)18.3144 + /* When INDEX == 0x4 in 32 bit mode, SCALE is ignored. */18.3145 + scale = (*codep >> 6) & 3;18.3146 + base = *codep & 7;18.3147 + USED_REX (REX_EXTY);18.3148 + USED_REX (REX_EXTZ);18.3149 + if (rex & REX_EXTY)18.3150 + index += 8;18.3151 + if (rex & REX_EXTZ)18.3152 + base += 8;18.3153 + codep++;18.3154 + }18.3155 +18.3156 + switch (mod)18.3157 + {18.3158 + case 0:18.3159 + if ((base & 7) == 5)18.3160 + {18.3161 + havebase = 0;18.3162 + if (mode_64bit && !havesib)18.3163 + riprel = 1;18.3164 + disp = get32s ();18.3165 + }18.3166 + break;18.3167 + case 1:18.3168 + FETCH_DATA (the_info, codep + 1);18.3169 + disp = *codep++;18.3170 + if ((disp & 0x80) != 0)18.3171 + disp -= 0x100;18.3172 + break;18.3173 + case 2:18.3174 + disp = get32s ();18.3175 + break;18.3176 + }18.3177 +18.3178 + if (!intel_syntax)18.3179 + if (mod != 0 || (base & 7) == 5)18.3180 + {18.3181 + xlat_print_symbolic_operand (scratchbuf, !riprel, disp);18.3182 + oappend (scratchbuf);18.3183 + if (riprel)18.3184 + {18.3185 + set_op (disp, 1);18.3186 + oappend ("(%rip)");18.3187 + }18.3188 + }18.3189 +18.3190 + if (havebase || (havesib && (index != 4 || scale != 0)))18.3191 + {18.3192 + if (intel_syntax)18.3193 + {18.3194 + switch (bytemode)18.3195 + {18.3196 + case b_mode:18.3197 + oappend ("BYTE PTR ");18.3198 + break;18.3199 + case w_mode:18.3200 + case dqw_mode:18.3201 + oappend ("WORD PTR ");18.3202 + break;18.3203 + case v_mode:18.3204 + case dq_mode:18.3205 + USED_REX (REX_MODE64);18.3206 + if (rex & REX_MODE64)18.3207 + oappend ("QWORD PTR ");18.3208 + else if ((sizeflag & DFLAG) || bytemode == dq_mode)18.3209 + oappend ("DWORD PTR ");18.3210 + else18.3211 + oappend ("WORD PTR ");18.3212 + used_prefixes |= (prefixes & PREFIX_DATA);18.3213 + break;18.3214 + case d_mode:18.3215 + oappend ("DWORD PTR ");18.3216 + break;18.3217 + case q_mode:18.3218 + oappend ("QWORD PTR ");18.3219 + break;18.3220 + case m_mode:18.3221 + if (mode_64bit)18.3222 + oappend ("QWORD PTR ");18.3223 + else18.3224 + oappend ("DWORD PTR ");18.3225 + break;18.3226 + case f_mode:18.3227 + if (sizeflag & DFLAG)18.3228 + {18.3229 + used_prefixes |= (prefixes & PREFIX_DATA);18.3230 + oappend ("FWORD PTR ");18.3231 + }18.3232 + else18.3233 + oappend ("DWORD PTR ");18.3234 + break;18.3235 + case t_mode:18.3236 + oappend ("TBYTE PTR ");18.3237 + break;18.3238 + case x_mode:18.3239 + oappend ("XMMWORD PTR ");18.3240 + break;18.3241 + default:18.3242 + break;18.3243 + }18.3244 + }18.3245 + *obufp++ = open_char;18.3246 + if (intel_syntax && riprel)18.3247 + oappend ("rip + ");18.3248 + *obufp = '\0';18.3249 + USED_REX (REX_EXTZ);18.3250 + if (!havesib && (rex & REX_EXTZ))18.3251 + base += 8;18.3252 + if (havebase)18.3253 + oappend (mode_64bit && (sizeflag & AFLAG)18.3254 + ? names64[base] : names32[base]);18.3255 + if (havesib)18.3256 + {18.3257 + if (index != 4)18.3258 + {18.3259 + if (!intel_syntax || havebase)18.3260 + {18.3261 + *obufp++ = separator_char;18.3262 + *obufp = '\0';18.3263 + }18.3264 + oappend (mode_64bit && (sizeflag & AFLAG)18.3265 + ? names64[index] : names32[index]);18.3266 + }18.3267 + if (scale != 0 || (!intel_syntax && index != 4))18.3268 + {18.3269 + *obufp++ = scale_char;18.3270 + *obufp = '\0';18.3271 + sprintf (scratchbuf, "%d", 1 << scale);18.3272 + oappend (scratchbuf);18.3273 + }18.3274 + }18.3275 + if (intel_syntax)18.3276 + if (mod != 0 || (base & 7) == 5)18.3277 + {18.3278 + /* Don't print zero displacements. */18.3279 + if (disp != 0)18.3280 + {18.3281 + if ((bfd_signed_vma) disp > 0)18.3282 + {18.3283 + *obufp++ = '+';18.3284 + *obufp = '\0';18.3285 + }18.3286 +18.3287 + xlat_print_symbolic_operand (scratchbuf, 0, disp);18.3288 + oappend (scratchbuf);18.3289 + }18.3290 + }18.3291 +18.3292 + *obufp++ = close_char;18.3293 + *obufp = '\0';18.3294 + }18.3295 + else if (intel_syntax)18.3296 + {18.3297 + if (mod != 0 || (base & 7) == 5)18.3298 + {18.3299 + if (prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS18.3300 + | PREFIX_ES | PREFIX_FS | PREFIX_GS))18.3301 + ;18.3302 + else18.3303 + {18.3304 + oappend (names_seg[ds_reg - es_reg]);18.3305 + oappend (":");18.3306 + }18.3307 + xlat_print_symbolic_operand (scratchbuf, 1, disp);18.3308 + oappend (scratchbuf);18.3309 + }18.3310 + }18.3311 + }18.3312 + else18.3313 + { /* 16 bit address mode */18.3314 + switch (mod)18.3315 + {18.3316 + case 0:18.3317 + if ((rm & 7) == 6)18.3318 + {18.3319 + disp = get16 ();18.3320 + if ((disp & 0x8000) != 0)18.3321 + disp -= 0x10000;18.3322 + }18.3323 + break;18.3324 + case 1:18.3325 + FETCH_DATA (the_info, codep + 1);18.3326 + disp = *codep++;18.3327 + if ((disp & 0x80) != 0)18.3328 + disp -= 0x100;18.3329 + break;18.3330 + case 2:18.3331 + disp = get16 ();18.3332 + if ((disp & 0x8000) != 0)18.3333 + disp -= 0x10000;18.3334 + break;18.3335 + }18.3336 +18.3337 + if (!intel_syntax)18.3338 + if (mod != 0 || (rm & 7) == 6)18.3339 + {18.3340 + xlat_print_symbolic_operand (scratchbuf, 0, disp);18.3341 + oappend (scratchbuf);18.3342 + }18.3343 +18.3344 + if (mod != 0 || (rm & 7) != 6)18.3345 + {18.3346 + *obufp++ = open_char;18.3347 + *obufp = '\0';18.3348 + oappend (index16[rm + add]);18.3349 + *obufp++ = close_char;18.3350 + *obufp = '\0';18.3351 + }18.3352 + }18.3353 +}18.3354 +18.3355 +static void18.3356 +OP_G (int bytemode, int sizeflag)18.3357 +{18.3358 + int add = 0;18.3359 + USED_REX (REX_EXTX);18.3360 + if (rex & REX_EXTX)18.3361 + add += 8;18.3362 + switch (bytemode)18.3363 + {18.3364 + case b_mode:18.3365 + USED_REX (0);18.3366 + if (rex)18.3367 + oappend (names8rex[reg + add]);18.3368 + else18.3369 + oappend (names8[reg + add]);18.3370 + break;18.3371 + case w_mode:18.3372 + oappend (names16[reg + add]);18.3373 + break;18.3374 + case d_mode:18.3375 + oappend (names32[reg + add]);18.3376 + break;18.3377 + case q_mode:18.3378 + oappend (names64[reg + add]);18.3379 + break;18.3380 + case v_mode:18.3381 + case dq_mode:18.3382 + case dqw_mode:18.3383 + USED_REX (REX_MODE64);18.3384 + if (rex & REX_MODE64)18.3385 + oappend (names64[reg + add]);18.3386 + else if ((sizeflag & DFLAG) || bytemode != v_mode)18.3387 + oappend (names32[reg + add]);18.3388 + else18.3389 + oappend (names16[reg + add]);18.3390 + used_prefixes |= (prefixes & PREFIX_DATA);18.3391 + break;18.3392 + default:18.3393 + oappend (INTERNAL_DISASSEMBLER_ERROR);18.3394 + break;18.3395 + }18.3396 +}18.3397 +18.3398 +static bfd_vma18.3399 +get64 (void)18.3400 +{18.3401 + bfd_vma x;18.3402 +#ifdef BFD6418.3403 + unsigned int a;18.3404 + unsigned int b;18.3405 +18.3406 + FETCH_DATA (the_info, codep + 8);18.3407 + a = *codep++ & 0xff;18.3408 + a |= (*codep++ & 0xff) << 8;18.3409 + a |= (*codep++ & 0xff) << 16;18.3410 + a |= (*codep++ & 0xff) << 24;18.3411 + b = *codep++ & 0xff;18.3412 + b |= (*codep++ & 0xff) << 8;18.3413 + b |= (*codep++ & 0xff) << 16;18.3414 + b |= (*codep++ & 0xff) << 24;18.3415 + x = a + ((bfd_vma) b << 32);18.3416 +#else18.3417 + abort ();18.3418 + x = 0;18.3419 +#endif18.3420 + return x;18.3421 +}18.3422 +18.3423 +static bfd_signed_vma18.3424 +get32 (void)18.3425 +{18.3426 + bfd_signed_vma x = 0;18.3427 +18.3428 + FETCH_DATA (the_info, codep + 4);18.3429 + x = *codep++ & (bfd_signed_vma) 0xff;18.3430 + x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;18.3431 + x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;18.3432 + x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;18.3433 + return x;18.3434 +}18.3435 +18.3436 +static bfd_signed_vma18.3437 +get32s (void)18.3438 +{18.3439 + bfd_signed_vma x = 0;18.3440 +18.3441 + FETCH_DATA (the_info, codep + 4);18.3442 + x = *codep++ & (bfd_signed_vma) 0xff;18.3443 + x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;18.3444 + x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;18.3445 + x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;18.3446 +18.3447 + x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);18.3448 +18.3449 + return x;18.3450 +}18.3451 +18.3452 +static int18.3453 +get16 (void)18.3454 +{18.3455 + int x = 0;18.3456 +18.3457 + FETCH_DATA (the_info, codep + 2);18.3458 + x = *codep++ & 0xff;18.3459 + x |= (*codep++ & 0xff) << 8;18.3460 + return x;18.3461 +}18.3462 +18.3463 +static void18.3464 +set_op (bfd_vma op, int riprel)18.3465 +{18.3466 + op_index[op_ad] = op_ad;18.3467 + if (mode_64bit)18.3468 + {18.3469 + op_address[op_ad] = op;18.3470 + op_riprel[op_ad] = riprel;18.3471 + }18.3472 + else18.3473 + {18.3474 + /* Mask to get a 32-bit address. */18.3475 + op_address[op_ad] = op & 0xffffffff;18.3476 + op_riprel[op_ad] = riprel & 0xffffffff;18.3477 + }18.3478 +}18.3479 +18.3480 +static void18.3481 +OP_REG (int code, int sizeflag)18.3482 +{18.3483 + const char *s;18.3484 + int add = 0;18.3485 + USED_REX (REX_EXTZ);18.3486 + if (rex & REX_EXTZ)18.3487 + add = 8;18.3488 +18.3489 + switch (code)18.3490 + {18.3491 + case indir_dx_reg:18.3492 + if (intel_syntax)18.3493 + s = "[dx]";18.3494 + else18.3495 + s = "(%dx)";18.3496 + break;18.3497 + case ax_reg: case cx_reg: case dx_reg: case bx_reg:18.3498 + case sp_reg: case bp_reg: case si_reg: case di_reg:18.3499 + s = names16[code - ax_reg + add];18.3500 + break;18.3501 + case es_reg: case ss_reg: case cs_reg:18.3502 + case ds_reg: case fs_reg: case gs_reg:18.3503 + s = names_seg[code - es_reg + add];18.3504 + break;18.3505 + case al_reg: case ah_reg: case cl_reg: case ch_reg:18.3506 + case dl_reg: case dh_reg: case bl_reg: case bh_reg:18.3507 + USED_REX (0);18.3508 + if (rex)18.3509 + s = names8rex[code - al_reg + add];18.3510 + else18.3511 + s = names8[code - al_reg];18.3512 + break;18.3513 + case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:18.3514 + case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:18.3515 + if (mode_64bit)18.3516 + {18.3517 + s = names64[code - rAX_reg + add];18.3518 + break;18.3519 + }18.3520 + code += eAX_reg - rAX_reg;18.3521 + /* Fall through. */18.3522 + case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:18.3523 + case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:18.3524 + USED_REX (REX_MODE64);18.3525 + if (rex & REX_MODE64)18.3526 + s = names64[code - eAX_reg + add];18.3527 + else if (sizeflag & DFLAG)18.3528 + s = names32[code - eAX_reg + add];18.3529 + else18.3530 + s = names16[code - eAX_reg + add];18.3531 + used_prefixes |= (prefixes & PREFIX_DATA);18.3532 + break;18.3533 + default:18.3534 + s = INTERNAL_DISASSEMBLER_ERROR;18.3535 + break;18.3536 + }18.3537 + oappend (s);18.3538 +}18.3539 +18.3540 +static void18.3541 +OP_IMREG (int code, int sizeflag)18.3542 +{18.3543 + const char *s;18.3544 +18.3545 + switch (code)18.3546 + {18.3547 + case indir_dx_reg:18.3548 + if (intel_syntax)18.3549 + s = "[dx]";18.3550 + else18.3551 + s = "(%dx)";18.3552 + break;18.3553 + case ax_reg: case cx_reg: case dx_reg: case bx_reg:18.3554 + case sp_reg: case bp_reg: case si_reg: case di_reg:18.3555 + s = names16[code - ax_reg];18.3556 + break;18.3557 + case es_reg: case ss_reg: case cs_reg:18.3558 + case ds_reg: case fs_reg: case gs_reg:18.3559 + s = names_seg[code - es_reg];18.3560 + break;18.3561 + case al_reg: case ah_reg: case cl_reg: case ch_reg:18.3562 + case dl_reg: case dh_reg: case bl_reg: case bh_reg:18.3563 + USED_REX (0);18.3564 + if (rex)18.3565 + s = names8rex[code - al_reg];18.3566 + else18.3567 + s = names8[code - al_reg];18.3568 + break;18.3569 + case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:18.3570 + case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:18.3571 + USED_REX (REX_MODE64);18.3572 + if (rex & REX_MODE64)18.3573 + s = names64[code - eAX_reg];18.3574 + else if (sizeflag & DFLAG)18.3575 + s = names32[code - eAX_reg];18.3576 + else18.3577 + s = names16[code - eAX_reg];18.3578 + used_prefixes |= (prefixes & PREFIX_DATA);18.3579 + break;18.3580 + default:18.3581 + s = INTERNAL_DISASSEMBLER_ERROR;18.3582 + break;18.3583 + }18.3584 + oappend (s);18.3585 +}18.3586 +18.3587 +static void18.3588 +OP_I (int bytemode, int sizeflag)18.3589 +{18.3590 + bfd_signed_vma op;18.3591 + bfd_signed_vma mask = -1;18.3592 +18.3593 + switch (bytemode)18.3594 + {18.3595 + case b_mode:18.3596 + FETCH_DATA (the_info, codep + 1);18.3597 + op = *codep++;18.3598 + mask = 0xff;18.3599 + break;18.3600 + case q_mode:18.3601 + if (mode_64bit)18.3602 + {18.3603 + op = get32s ();18.3604 + break;18.3605 + }18.3606 + /* Fall through. */18.3607 + case v_mode:18.3608 + USED_REX (REX_MODE64);18.3609 + if (rex & REX_MODE64)18.3610 + op = get32s ();18.3611 + else if (sizeflag & DFLAG)18.3612 + {18.3613 + op = get32 ();18.3614 + mask = 0xffffffff;18.3615 + }18.3616 + else18.3617 + {18.3618 + op = get16 ();18.3619 + mask = 0xfffff;18.3620 + }18.3621 + used_prefixes |= (prefixes & PREFIX_DATA);18.3622 + break;18.3623 + case w_mode:18.3624 + mask = 0xfffff;18.3625 + op = get16 ();18.3626 + break;18.3627 + case const_1_mode:18.3628 + if (intel_syntax)18.3629 + oappend ("1");18.3630 + return;18.3631 + default:18.3632 + oappend (INTERNAL_DISASSEMBLER_ERROR);18.3633 + return;18.3634 + }18.3635 +18.3636 + op &= mask;18.3637 + scratchbuf[0] = '$';18.3638 + xlat_print_symbolic_operand (scratchbuf + 1, 1, op);18.3639 + oappend (scratchbuf + intel_syntax);18.3640 + scratchbuf[0] = '\0';18.3641 +}18.3642 +18.3643 +static void18.3644 +OP_I64 (int bytemode, int sizeflag)18.3645 +{18.3646 + bfd_signed_vma op;18.3647 + bfd_signed_vma mask = -1;18.3648 +18.3649 + if (!mode_64bit)18.3650 + {18.3651 + OP_I (bytemode, sizeflag);18.3652 + return;18.3653 + }18.3654 +18.3655 + switch (bytemode)18.3656 + {18.3657 + case b_mode:18.3658 + FETCH_DATA (the_info, codep + 1);18.3659 + op = *codep++;18.3660 + mask = 0xff;18.3661 + break;18.3662 + case v_mode:18.3663 + USED_REX (REX_MODE64);18.3664 + if (rex & REX_MODE64)18.3665 + op = get64 ();18.3666 + else if (sizeflag & DFLAG)18.3667 + {18.3668 + op = get32 ();18.3669 + mask = 0xffffffff;18.3670 + }18.3671 + else18.3672 + {18.3673 + op = get16 ();18.3674 + mask = 0xfffff;18.3675 + }18.3676 + used_prefixes |= (prefixes & PREFIX_DATA);18.3677 + break;18.3678 + case w_mode:18.3679 + mask = 0xfffff;18.3680 + op = get16 ();18.3681 + break;18.3682 + default:18.3683 + oappend (INTERNAL_DISASSEMBLER_ERROR);18.3684 + return;18.3685 + }18.3686 +18.3687 + op &= mask;18.3688 + scratchbuf[0] = '$';18.3689 + xlat_print_symbolic_operand (scratchbuf + 1, 1, op);18.3690 + oappend (scratchbuf + intel_syntax);18.3691 + scratchbuf[0] = '\0';18.3692 +}18.3693 +18.3694 +static void18.3695 +OP_sI (int bytemode, int sizeflag)18.3696 +{18.3697 + bfd_signed_vma op;18.3698 + bfd_signed_vma mask = -1;18.3699 +18.3700 + switch (bytemode)18.3701 + {18.3702 + case b_mode:18.3703 + FETCH_DATA (the_info, codep + 1);18.3704 + op = *codep++;18.3705 + if ((op & 0x80) != 0)18.3706 + op -= 0x100;18.3707 + mask = 0xffffffff;18.3708 + break;18.3709 + case v_mode:18.3710 + USED_REX (REX_MODE64);18.3711 + if (rex & REX_MODE64)18.3712 + op = get32s ();18.3713 + else if (sizeflag & DFLAG)18.3714 + {18.3715 + op = get32s ();18.3716 + mask = 0xffffffff;18.3717 + }18.3718 + else18.3719 + {18.3720 + mask = 0xffffffff;18.3721 + op = get16 ();18.3722 + if ((op & 0x8000) != 0)18.3723 + op -= 0x10000;18.3724 + }18.3725 + used_prefixes |= (prefixes & PREFIX_DATA);18.3726 + break;18.3727 + case w_mode:18.3728 + op = get16 ();18.3729 + mask = 0xffffffff;18.3730 + if ((op & 0x8000) != 0)18.3731 + op -= 0x10000;18.3732 + break;18.3733 + default:18.3734 + oappend (INTERNAL_DISASSEMBLER_ERROR);18.3735 + return;18.3736 + }18.3737 +18.3738 + scratchbuf[0] = '$';18.3739 + xlat_print_symbolic_operand (scratchbuf + 1, 1, op);18.3740 + oappend (scratchbuf + intel_syntax);18.3741 +}18.3742 +18.3743 +static void18.3744 +OP_J (int bytemode, int sizeflag)18.3745 +{18.3746 + bfd_vma disp;18.3747 + bfd_vma mask = -1;18.3748 +18.3749 + switch (bytemode)18.3750 + {18.3751 + case b_mode:18.3752 + FETCH_DATA (the_info, codep + 1);18.3753 + disp = *codep++;18.3754 + if ((disp & 0x80) != 0)18.3755 + disp -= 0x100;18.3756 + break;18.3757 + case v_mode:18.3758 + if (sizeflag & DFLAG)18.3759 + disp = get32s ();18.3760 + else18.3761 + {18.3762 + disp = get16 ();18.3763 + /* For some reason, a data16 prefix on a jump instruction18.3764 + means that the pc is masked to 16 bits after the18.3765 + displacement is added! */18.3766 + mask = 0xffff;18.3767 + }18.3768 + break;18.3769 + default:18.3770 + oappend (INTERNAL_DISASSEMBLER_ERROR);18.3771 + return;18.3772 + }18.3773 + disp = (start_pc + codep - start_codep + disp) & mask;18.3774 + set_op (disp, 0);18.3775 + xlat_print_symbolic_operand (scratchbuf, 1, disp);18.3776 + oappend (scratchbuf);18.3777 +}18.3778 +18.3779 +static void18.3780 +OP_SEG (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.3781 +{18.3782 + oappend (names_seg[reg]);18.3783 +}18.3784 +18.3785 +static void18.3786 +OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)18.3787 +{18.3788 + int seg, offset;18.3789 +18.3790 + if (sizeflag & DFLAG)18.3791 + {18.3792 + offset = get32 ();18.3793 + seg = get16 ();18.3794 + }18.3795 + else18.3796 + {18.3797 + offset = get16 ();18.3798 + seg = get16 ();18.3799 + }18.3800 + used_prefixes |= (prefixes & PREFIX_DATA);18.3801 + if (intel_syntax)18.3802 + sprintf (scratchbuf, "0x%x,0x%x", seg, offset);18.3803 + else18.3804 + sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);18.3805 + oappend (scratchbuf);18.3806 +}18.3807 +18.3808 +static void18.3809 +OP_OFF (int bytemode ATTRIBUTE_UNUSED, int sizeflag)18.3810 +{18.3811 + bfd_vma off;18.3812 +18.3813 + append_seg ();18.3814 +18.3815 + if ((sizeflag & AFLAG) || mode_64bit)18.3816 + off = get32 ();18.3817 + else18.3818 + off = get16 ();18.3819 +18.3820 + if (intel_syntax)18.3821 + {18.3822 + if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS18.3823 + | PREFIX_ES | PREFIX_FS | PREFIX_GS)))18.3824 + {18.3825 + oappend (names_seg[ds_reg - es_reg]);18.3826 + oappend (":");18.3827 + }18.3828 + }18.3829 + xlat_print_symbolic_operand (scratchbuf, 1, off);18.3830 + oappend (scratchbuf);18.3831 +}18.3832 +18.3833 +static void18.3834 +OP_OFF64 (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.3835 +{18.3836 + bfd_vma off;18.3837 +18.3838 + if (!mode_64bit)18.3839 + {18.3840 + OP_OFF (bytemode, sizeflag);18.3841 + return;18.3842 + }18.3843 +18.3844 + append_seg ();18.3845 +18.3846 + off = get64 ();18.3847 +18.3848 + if (intel_syntax)18.3849 + {18.3850 + if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS18.3851 + | PREFIX_ES | PREFIX_FS | PREFIX_GS)))18.3852 + {18.3853 + oappend (names_seg[ds_reg - es_reg]);18.3854 + oappend (":");18.3855 + }18.3856 + }18.3857 + xlat_print_symbolic_operand (scratchbuf, 1, off);18.3858 + oappend (scratchbuf);18.3859 +}18.3860 +18.3861 +static void18.3862 +ptr_reg (int code, int sizeflag)18.3863 +{18.3864 + const char *s;18.3865 +18.3866 + *obufp++ = open_char;18.3867 + used_prefixes |= (prefixes & PREFIX_ADDR);18.3868 + if (mode_64bit)18.3869 + {18.3870 + if (!(sizeflag & AFLAG))18.3871 + s = names32[code - eAX_reg];18.3872 + else18.3873 + s = names64[code - eAX_reg];18.3874 + }18.3875 + else if (sizeflag & AFLAG)18.3876 + s = names32[code - eAX_reg];18.3877 + else18.3878 + s = names16[code - eAX_reg];18.3879 + oappend (s);18.3880 + *obufp++ = close_char;18.3881 + *obufp = 0;18.3882 +}18.3883 +18.3884 +static void18.3885 +OP_ESreg (int code, int sizeflag)18.3886 +{18.3887 + if (intel_syntax)18.3888 + {18.3889 + if (codep[-1] & 1)18.3890 + {18.3891 + USED_REX (REX_MODE64);18.3892 + used_prefixes |= (prefixes & PREFIX_DATA);18.3893 + if (rex & REX_MODE64)18.3894 + oappend ("QWORD PTR ");18.3895 + else if ((sizeflag & DFLAG))18.3896 + oappend ("DWORD PTR ");18.3897 + else18.3898 + oappend ("WORD PTR ");18.3899 + }18.3900 + else18.3901 + oappend ("BYTE PTR ");18.3902 + }18.3903 +18.3904 + oappend ("%es:" + intel_syntax);18.3905 + ptr_reg (code, sizeflag);18.3906 +}18.3907 +18.3908 +static void18.3909 +OP_DSreg (int code, int sizeflag)18.3910 +{18.3911 + if (intel_syntax)18.3912 + {18.3913 + if (codep[-1] != 0xd7 && (codep[-1] & 1))18.3914 + {18.3915 + USED_REX (REX_MODE64);18.3916 + used_prefixes |= (prefixes & PREFIX_DATA);18.3917 + if (rex & REX_MODE64)18.3918 + oappend ("QWORD PTR ");18.3919 + else if ((sizeflag & DFLAG))18.3920 + oappend ("DWORD PTR ");18.3921 + else18.3922 + oappend ("WORD PTR ");18.3923 + }18.3924 + else18.3925 + oappend ("BYTE PTR ");18.3926 + }18.3927 +18.3928 + if ((prefixes18.3929 + & (PREFIX_CS18.3930 + | PREFIX_DS18.3931 + | PREFIX_SS18.3932 + | PREFIX_ES18.3933 + | PREFIX_FS18.3934 + | PREFIX_GS)) == 0)18.3935 + prefixes |= PREFIX_DS;18.3936 + append_seg ();18.3937 + ptr_reg (code, sizeflag);18.3938 +}18.3939 +18.3940 +static void18.3941 +OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.3942 +{18.3943 + int add = 0;18.3944 + if (rex & REX_EXTX)18.3945 + {18.3946 + USED_REX (REX_EXTX);18.3947 + add = 8;18.3948 + }18.3949 + else if (!mode_64bit && (prefixes & PREFIX_LOCK))18.3950 + {18.3951 + used_prefixes |= PREFIX_LOCK;18.3952 + add = 8;18.3953 + }18.3954 + sprintf (scratchbuf, "%%cr%d", reg + add);18.3955 + oappend (scratchbuf + intel_syntax);18.3956 +}18.3957 +18.3958 +static void18.3959 +OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.3960 +{18.3961 + int add = 0;18.3962 + USED_REX (REX_EXTX);18.3963 + if (rex & REX_EXTX)18.3964 + add = 8;18.3965 + if (intel_syntax)18.3966 + sprintf (scratchbuf, "db%d", reg + add);18.3967 + else18.3968 + sprintf (scratchbuf, "%%db%d", reg + add);18.3969 + oappend (scratchbuf);18.3970 +}18.3971 +18.3972 +static void18.3973 +OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.3974 +{18.3975 + sprintf (scratchbuf, "%%tr%d", reg);18.3976 + oappend (scratchbuf + intel_syntax);18.3977 +}18.3978 +18.3979 +static void18.3980 +OP_Rd (int bytemode, int sizeflag)18.3981 +{18.3982 + if (mod == 3)18.3983 + OP_E (bytemode, sizeflag);18.3984 + else18.3985 + BadOp ();18.3986 +}18.3987 +18.3988 +static void18.3989 +OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.3990 +{18.3991 + used_prefixes |= (prefixes & PREFIX_DATA);18.3992 + if (prefixes & PREFIX_DATA)18.3993 + {18.3994 + int add = 0;18.3995 + USED_REX (REX_EXTX);18.3996 + if (rex & REX_EXTX)18.3997 + add = 8;18.3998 + sprintf (scratchbuf, "%%xmm%d", reg + add);18.3999 + }18.4000 + else18.4001 + sprintf (scratchbuf, "%%mm%d", reg);18.4002 + oappend (scratchbuf + intel_syntax);18.4003 +}18.4004 +18.4005 +static void18.4006 +OP_XMM (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.4007 +{18.4008 + int add = 0;18.4009 + USED_REX (REX_EXTX);18.4010 + if (rex & REX_EXTX)18.4011 + add = 8;18.4012 + sprintf (scratchbuf, "%%xmm%d", reg + add);18.4013 + oappend (scratchbuf + intel_syntax);18.4014 +}18.4015 +18.4016 +static void18.4017 +OP_EM (int bytemode, int sizeflag)18.4018 +{18.4019 + if (mod != 3)18.4020 + {18.4021 + if (intel_syntax && bytemode == v_mode)18.4022 + {18.4023 + bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;18.4024 + used_prefixes |= (prefixes & PREFIX_DATA);18.4025 + }18.4026 + OP_E (bytemode, sizeflag);18.4027 + return;18.4028 + }18.4029 +18.4030 + /* Skip mod/rm byte. */18.4031 + MODRM_CHECK;18.4032 + codep++;18.4033 + used_prefixes |= (prefixes & PREFIX_DATA);18.4034 + if (prefixes & PREFIX_DATA)18.4035 + {18.4036 + int add = 0;18.4037 +18.4038 + USED_REX (REX_EXTZ);18.4039 + if (rex & REX_EXTZ)18.4040 + add = 8;18.4041 + sprintf (scratchbuf, "%%xmm%d", rm + add);18.4042 + }18.4043 + else18.4044 + sprintf (scratchbuf, "%%mm%d", rm);18.4045 + oappend (scratchbuf + intel_syntax);18.4046 +}18.4047 +18.4048 +static void18.4049 +OP_EX (int bytemode, int sizeflag)18.4050 +{18.4051 + int add = 0;18.4052 + if (mod != 3)18.4053 + {18.4054 + if (intel_syntax && bytemode == v_mode)18.4055 + {18.4056 + switch (prefixes & (PREFIX_DATA|PREFIX_REPZ|PREFIX_REPNZ))18.4057 + {18.4058 + case 0: bytemode = x_mode; break;18.4059 + case PREFIX_REPZ: bytemode = d_mode; used_prefixes |= PREFIX_REPZ; break;18.4060 + case PREFIX_DATA: bytemode = x_mode; used_prefixes |= PREFIX_DATA; break;18.4061 + case PREFIX_REPNZ: bytemode = q_mode; used_prefixes |= PREFIX_REPNZ; break;18.4062 + default: bytemode = 0; break;18.4063 + }18.4064 + }18.4065 + OP_E (bytemode, sizeflag);18.4066 + return;18.4067 + }18.4068 + USED_REX (REX_EXTZ);18.4069 + if (rex & REX_EXTZ)18.4070 + add = 8;18.4071 +18.4072 + /* Skip mod/rm byte. */18.4073 + MODRM_CHECK;18.4074 + codep++;18.4075 + sprintf (scratchbuf, "%%xmm%d", rm + add);18.4076 + oappend (scratchbuf + intel_syntax);18.4077 +}18.4078 +18.4079 +static void18.4080 +OP_MS (int bytemode, int sizeflag)18.4081 +{18.4082 + if (mod == 3)18.4083 + OP_EM (bytemode, sizeflag);18.4084 + else18.4085 + BadOp ();18.4086 +}18.4087 +18.4088 +static void18.4089 +OP_XS (int bytemode, int sizeflag)18.4090 +{18.4091 + if (mod == 3)18.4092 + OP_EX (bytemode, sizeflag);18.4093 + else18.4094 + BadOp ();18.4095 +}18.4096 +18.4097 +static void18.4098 +OP_M (int bytemode, int sizeflag)18.4099 +{18.4100 + if (mod == 3)18.4101 + BadOp (); /* bad lea,lds,les,lfs,lgs,lss modrm */18.4102 + else18.4103 + OP_E (bytemode, sizeflag);18.4104 +}18.4105 +18.4106 +static void18.4107 +OP_0f07 (int bytemode, int sizeflag)18.4108 +{18.4109 + if (mod != 3 || rm != 0)18.4110 + BadOp ();18.4111 + else18.4112 + OP_E (bytemode, sizeflag);18.4113 +}18.4114 +18.4115 +static void18.4116 +OP_0fae (int bytemode, int sizeflag)18.4117 +{18.4118 + if (mod == 3)18.4119 + {18.4120 + if (reg == 7)18.4121 + strcpy (obuf + strlen (obuf) - sizeof ("clflush") + 1, "sfence");18.4122 +18.4123 + if (reg < 5 || rm != 0)18.4124 + {18.4125 + BadOp (); /* bad sfence, mfence, or lfence */18.4126 + return;18.4127 + }18.4128 + }18.4129 + else if (reg != 7)18.4130 + {18.4131 + BadOp (); /* bad clflush */18.4132 + return;18.4133 + }18.4134 +18.4135 + OP_E (bytemode, sizeflag);18.4136 +}18.4137 +18.4138 +static void18.4139 +NOP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.4140 +{18.4141 + /* NOP with REPZ prefix is called PAUSE. */18.4142 + if (prefixes == PREFIX_REPZ)18.4143 + strcpy (obuf, "pause");18.4144 +}18.4145 +18.4146 +static const char *const Suffix3DNow[] = {18.4147 +/* 00 */ NULL, NULL, NULL, NULL,18.4148 +/* 04 */ NULL, NULL, NULL, NULL,18.4149 +/* 08 */ NULL, NULL, NULL, NULL,18.4150 +/* 0C */ "pi2fw", "pi2fd", NULL, NULL,18.4151 +/* 10 */ NULL, NULL, NULL, NULL,18.4152 +/* 14 */ NULL, NULL, NULL, NULL,18.4153 +/* 18 */ NULL, NULL, NULL, NULL,18.4154 +/* 1C */ "pf2iw", "pf2id", NULL, NULL,18.4155 +/* 20 */ NULL, NULL, NULL, NULL,18.4156 +/* 24 */ NULL, NULL, NULL, NULL,18.4157 +/* 28 */ NULL, NULL, NULL, NULL,18.4158 +/* 2C */ NULL, NULL, NULL, NULL,18.4159 +/* 30 */ NULL, NULL, NULL, NULL,18.4160 +/* 34 */ NULL, NULL, NULL, NULL,18.4161 +/* 38 */ NULL, NULL, NULL, NULL,18.4162 +/* 3C */ NULL, NULL, NULL, NULL,18.4163 +/* 40 */ NULL, NULL, NULL, NULL,18.4164 +/* 44 */ NULL, NULL, NULL, NULL,18.4165 +/* 48 */ NULL, NULL, NULL, NULL,18.4166 +/* 4C */ NULL, NULL, NULL, NULL,18.4167 +/* 50 */ NULL, NULL, NULL, NULL,18.4168 +/* 54 */ NULL, NULL, NULL, NULL,18.4169 +/* 58 */ NULL, NULL, NULL, NULL,18.4170 +/* 5C */ NULL, NULL, NULL, NULL,18.4171 +/* 60 */ NULL, NULL, NULL, NULL,18.4172 +/* 64 */ NULL, NULL, NULL, NULL,18.4173 +/* 68 */ NULL, NULL, NULL, NULL,18.4174 +/* 6C */ NULL, NULL, NULL, NULL,18.4175 +/* 70 */ NULL, NULL, NULL, NULL,18.4176 +/* 74 */ NULL, NULL, NULL, NULL,18.4177 +/* 78 */ NULL, NULL, NULL, NULL,18.4178 +/* 7C */ NULL, NULL, NULL, NULL,18.4179 +/* 80 */ NULL, NULL, NULL, NULL,18.4180 +/* 84 */ NULL, NULL, NULL, NULL,18.4181 +/* 88 */ NULL, NULL, "pfnacc", NULL,18.4182 +/* 8C */ NULL, NULL, "pfpnacc", NULL,18.4183 +/* 90 */ "pfcmpge", NULL, NULL, NULL,18.4184 +/* 94 */ "pfmin", NULL, "pfrcp", "pfrsqrt",18.4185 +/* 98 */ NULL, NULL, "pfsub", NULL,18.4186 +/* 9C */ NULL, NULL, "pfadd", NULL,18.4187 +/* A0 */ "pfcmpgt", NULL, NULL, NULL,18.4188 +/* A4 */ "pfmax", NULL, "pfrcpit1", "pfrsqit1",18.4189 +/* A8 */ NULL, NULL, "pfsubr", NULL,18.4190 +/* AC */ NULL, NULL, "pfacc", NULL,18.4191 +/* B0 */ "pfcmpeq", NULL, NULL, NULL,18.4192 +/* B4 */ "pfmul", NULL, "pfrcpit2", "pfmulhrw",18.4193 +/* B8 */ NULL, NULL, NULL, "pswapd",18.4194 +/* BC */ NULL, NULL, NULL, "pavgusb",18.4195 +/* C0 */ NULL, NULL, NULL, NULL,18.4196 +/* C4 */ NULL, NULL, NULL, NULL,18.4197 +/* C8 */ NULL, NULL, NULL, NULL,18.4198 +/* CC */ NULL, NULL, NULL, NULL,18.4199 +/* D0 */ NULL, NULL, NULL, NULL,18.4200 +/* D4 */ NULL, NULL, NULL, NULL,18.4201 +/* D8 */ NULL, NULL, NULL, NULL,18.4202 +/* DC */ NULL, NULL, NULL, NULL,18.4203 +/* E0 */ NULL, NULL, NULL, NULL,18.4204 +/* E4 */ NULL, NULL, NULL, NULL,18.4205 +/* E8 */ NULL, NULL, NULL, NULL,18.4206 +/* EC */ NULL, NULL, NULL, NULL,18.4207 +/* F0 */ NULL, NULL, NULL, NULL,18.4208 +/* F4 */ NULL, NULL, NULL, NULL,18.4209 +/* F8 */ NULL, NULL, NULL, NULL,18.4210 +/* FC */ NULL, NULL, NULL, NULL,18.4211 +};18.4212 +18.4213 +static void18.4214 +OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.4215 +{18.4216 + const char *mnemonic;18.4217 +18.4218 + FETCH_DATA (the_info, codep + 1);18.4219 + /* AMD 3DNow! instructions are specified by an opcode suffix in the18.4220 + place where an 8-bit immediate would normally go. ie. the last18.4221 + byte of the instruction. */18.4222 + obufp = obuf + strlen (obuf);18.4223 + mnemonic = Suffix3DNow[*codep++ & 0xff];18.4224 + if (mnemonic)18.4225 + oappend (mnemonic);18.4226 + else18.4227 + {18.4228 + /* Since a variable sized modrm/sib chunk is between the start18.4229 + of the opcode (0x0f0f) and the opcode suffix, we need to do18.4230 + all the modrm processing first, and don't know until now that18.4231 + we have a bad opcode. This necessitates some cleaning up. */18.4232 + op1out[0] = '\0';18.4233 + op2out[0] = '\0';18.4234 + BadOp ();18.4235 + }18.4236 +}18.4237 +18.4238 +static const char *simd_cmp_op[] = {18.4239 + "eq",18.4240 + "lt",18.4241 + "le",18.4242 + "unord",18.4243 + "neq",18.4244 + "nlt",18.4245 + "nle",18.4246 + "ord"18.4247 +};18.4248 +18.4249 +static void18.4250 +OP_SIMD_Suffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)18.4251 +{18.4252 + unsigned int cmp_type;18.4253 +18.4254 + FETCH_DATA (the_info, codep + 1);18.4255 + obufp = obuf + strlen (obuf);18.4256 + cmp_type = *codep++ & 0xff;18.4257 + if (cmp_type < 8)18.4258 + {18.4259 + char suffix1 = 'p', suffix2 = 's';18.4260 + used_prefixes |= (prefixes & PREFIX_REPZ);18.4261 + if (prefixes & PREFIX_REPZ)18.4262 + suffix1 = 's';18.4263 + else18.4264 + {18.4265 + used_prefixes |= (prefixes & PREFIX_DATA);18.4266 + if (prefixes & PREFIX_DATA)18.4267 + suffix2 = 'd';18.4268 + else18.4269 + {18.4270 + used_prefixes |= (prefixes & PREFIX_REPNZ);18.4271 + if (prefixes & PREFIX_REPNZ)18.4272 + suffix1 = 's', suffix2 = 'd';18.4273 + }18.4274 + }18.4275 + sprintf (scratchbuf, "cmp%s%c%c",18.4276 + simd_cmp_op[cmp_type], suffix1, suffix2);18.4277 + used_prefixes |= (prefixes & PREFIX_REPZ);18.4278 + oappend (scratchbuf);18.4279 + }18.4280 + else18.4281 + {18.4282 + /* We have a bad extension byte. Clean up. */18.4283 + op1out[0] = '\0';18.4284 + op2out[0] = '\0';18.4285 + BadOp ();18.4286 + }18.4287 +}18.4288 +18.4289 +static void18.4290 +SIMD_Fixup (int extrachar, int sizeflag ATTRIBUTE_UNUSED)18.4291 +{18.4292 + /* Change movlps/movhps to movhlps/movlhps for 2 register operand18.4293 + forms of these instructions. */18.4294 + if (mod == 3)18.4295 + {18.4296 + char *p = obuf + strlen (obuf);18.4297 + *(p + 1) = '\0';18.4298 + *p = *(p - 1);18.4299 + *(p - 1) = *(p - 2);18.4300 + *(p - 2) = *(p - 3);18.4301 + *(p - 3) = extrachar;18.4302 + }18.4303 +}18.4304 +18.4305 +static void18.4306 +PNI_Fixup (int extrachar ATTRIBUTE_UNUSED, int sizeflag)18.4307 +{18.4308 + if (mod == 3 && reg == 1 && rm <= 1)18.4309 + {18.4310 + /* Override "sidt". */18.4311 + char *p = obuf + strlen (obuf) - 4;18.4312 +18.4313 + /* We might have a suffix. */18.4314 + if (*p == 'i')18.4315 + --p;18.4316 +18.4317 + if (rm)18.4318 + {18.4319 + /* mwait %eax,%ecx */18.4320 + strcpy (p, "mwait");18.4321 + if (!intel_syntax)18.4322 + strcpy (op1out, names32[0]);18.4323 + }18.4324 + else18.4325 + {18.4326 + /* monitor %eax,%ecx,%edx" */18.4327 + strcpy (p, "monitor");18.4328 + if (!intel_syntax)18.4329 + {18.4330 + if (!mode_64bit)18.4331 + strcpy (op1out, names32[0]);18.4332 + else if (!(prefixes & PREFIX_ADDR))18.4333 + strcpy (op1out, names64[0]);18.4334 + else18.4335 + {18.4336 + strcpy (op1out, names32[0]);18.4337 + used_prefixes |= PREFIX_ADDR;18.4338 + }18.4339 + strcpy (op3out, names32[2]);18.4340 + }18.4341 + }18.4342 + if (!intel_syntax)18.4343 + {18.4344 + strcpy (op2out, names32[1]);18.4345 + two_source_ops = 1;18.4346 + }18.4347 +18.4348 + codep++;18.4349 + }18.4350 + else18.4351 + OP_E (0, sizeflag);18.4352 +}18.4353 +18.4354 +static void18.4355 +INVLPG_Fixup (int bytemode, int sizeflag)18.4356 +{18.4357 + const char *alt;18.4358 +18.4359 + switch (*codep)18.4360 + {18.4361 + case 0xf8:18.4362 + alt = "swapgs";18.4363 + break;18.4364 + case 0xf9:18.4365 + alt = "rdtscp";18.4366 + break;18.4367 + default:18.4368 + OP_E (bytemode, sizeflag);18.4369 + return;18.4370 + }18.4371 + /* Override "invlpg". */18.4372 + strcpy (obuf + strlen (obuf) - 6, alt);18.4373 + codep++;18.4374 +}18.4375 +18.4376 +static void18.4377 +BadOp (void)18.4378 +{18.4379 + /* Throw away prefixes and 1st. opcode byte. */18.4380 + codep = insn_codep + 1;18.4381 + oappend ("(bad)");18.4382 +}
19.1 --- /dev/null Thu Jan 01 00:00:00 1970 +000019.2 +++ b/src/xlat/disasm/symcat.h Tue Mar 06 12:19:08 2012 +100019.3 @@ -0,0 +1,49 @@19.4 +/* Symbol concatenation utilities.19.5 +19.6 + Copyright (C) 1998, 2000 Free Software Foundation, Inc.19.7 +19.8 + This program is free software; you can redistribute it and/or modify19.9 + it under the terms of the GNU General Public License as published by19.10 + the Free Software Foundation; either version 2 of the License, or19.11 + (at your option) any later version.19.12 +19.13 + This program is distributed in the hope that it will be useful,19.14 + but WITHOUT ANY WARRANTY; without even the implied warranty of19.15 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the19.16 + GNU General Public License for more details.19.17 +19.18 + You should have received a copy of the GNU General Public License along19.19 + with this program; if not, write to the Free Software Foundation, Inc.,19.20 + 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */19.21 +19.22 +#ifndef SYM_CAT_H19.23 +#define SYM_CAT_H19.24 +19.25 +#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)19.26 +#define CONCAT2(a,b) a##b19.27 +#define CONCAT3(a,b,c) a##b##c19.28 +#define CONCAT4(a,b,c,d) a##b##c##d19.29 +#define STRINGX(s) #s19.30 +#else19.31 +/* Note one should never pass extra whitespace to the CONCATn macros,19.32 + e.g. CONCAT2(foo, bar) because traditonal C will keep the space between19.33 + the two labels instead of concatenating them. Instead, make sure to19.34 + write CONCAT2(foo,bar). */19.35 +#define CONCAT2(a,b) a/**/b19.36 +#define CONCAT3(a,b,c) a/**/b/**/c19.37 +#define CONCAT4(a,b,c,d) a/**/b/**/c/**/d19.38 +#define STRINGX(s) "s"19.39 +#endif19.40 +19.41 +#define XCONCAT2(a,b) CONCAT2(a,b)19.42 +#define XCONCAT3(a,b,c) CONCAT3(a,b,c)19.43 +#define XCONCAT4(a,b,c,d) CONCAT4(a,b,c,d)19.44 +19.45 +/* Note the layer of indirection here is typically used to allow19.46 + stringification of the expansion of macros. I.e. "#define foo19.47 + bar", "XSTRING(foo)", to yield "bar". Be aware that this only19.48 + works for __STDC__, not for traditional C which will still resolve19.49 + to "foo". */19.50 +#define XSTRING(s) STRINGX(s)19.51 +19.52 +#endif /* SYM_CAT_H */
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +000020.2 +++ b/src/xlat/disasm/sysdep.h Tue Mar 06 12:19:08 2012 +100020.3 @@ -0,0 +1,42 @@20.4 +/* Random host-dependent support code.20.5 + Copyright 1995, 1997, 2000 Free Software Foundation, Inc.20.6 + Written by Ken Raeburn.20.7 +20.8 +This file is part of libopcodes, the opcodes library.20.9 +20.10 +This program is free software; you can redistribute it and/or modify20.11 +it under the terms of the GNU General Public License as published by20.12 +the Free Software Foundation; either version 2 of the License, or20.13 +(at your option) any later version.20.14 +20.15 +This program is distributed in the hope that it will be useful,20.16 +but WITHOUT ANY WARRANTY; without even the implied warranty of20.17 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the20.18 +GNU General Public License for more details.20.19 +20.20 +You should have received a copy of the GNU General Public License20.21 +along with this program; if not, write to the Free Software20.22 +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */20.23 +20.24 +/* Do system-dependent stuff, mainly driven by autoconf-detected info.20.25 +20.26 + Well, some generic common stuff is done here too, like including20.27 + ansidecl.h. That's because the .h files in bfd/hosts files I'm20.28 + trying to replace often did that. If it can be dropped from this20.29 + file (check in a non-ANSI environment!), it should be. */20.30 +20.31 +#include "lxdream.h"20.32 +20.33 +#include "xlat/disasm/ansidecl.h"20.34 +20.35 +#ifdef HAVE_STDLIB_H20.36 +#include <stdlib.h>20.37 +#endif20.38 +20.39 +#ifdef HAVE_STRING_H20.40 +#include <string.h>20.41 +#else20.42 +#ifdef HAVE_STRINGS_H20.43 +#include <strings.h>20.44 +#endif20.45 +#endif
21.1 --- a/src/xlat/xlatdasm.c Tue Mar 06 09:04:34 2012 +100021.2 +++ b/src/xlat/xlatdasm.c Tue Mar 06 12:19:08 2012 +100021.3 @@ -21,8 +21,8 @@21.4 #include <string.h>21.5 #include "xlat/xltcache.h"21.6 #include "xlat/xlatdasm.h"21.7 -#include "x86dasm/bfd.h"21.8 -#include "x86dasm/dis-asm.h"21.9 +#include "xlat/disasm/bfd.h"21.10 +#include "xlat/disasm/dis-asm.h"21.11 #include "sh4/sh4.h"21.13 #if defined(__i386__)
.