2011-05-16 Tristan Gingold <gingold@adacore.com>

* od-xcoff.c: New file.
	* objdump.h: New file.
	* objdump.c: Include objdump.h
	(dump_private_options, objdump_private_vectors): New variables.
	(usage): Mention -P/--private.  Display handled options.
	(long_options): Add -P/--private.
	(dump_target_specific): New function.
	(dump_bfd): Handle dump_private_options.
	(main): Handle -P.
	* doc/binutils.texi (objdump): Document -P/--private.
	* configure.in (OBJDUMP_PRIVATE_VECTORS, OBJDUMP_PRIVATE_OFILES):
	New variables, compute them.
	(od_vectors): Add vectors for private dumpers. Make them uniq.
	(OBJDUMP_DEFS): Add OBJDUMP_PRIVATE_VECTORS.
	* Makefile.am (HFILES): Add objdump.h
	(CFILES): Add od-xcoff.c
	(OBJDUMP_PRIVATE_OFILES): New variable.
	(objdump_DEPENDENCIES): Append OBJDUMP_PRIVATE_OFILES.
	(objdump_LDADD): Ditto.
	(EXTRA_objdump_SOURCES): Define.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
This commit is contained in:
Tristan Gingold 2011-05-16 12:22:13 +00:00
parent f37a7048a8
commit 6abcee9042
8 changed files with 1928 additions and 13 deletions

View file

@ -85,7 +85,7 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
HFILES = \ HFILES = \
arsup.h binemul.h bucomm.h budbg.h \ arsup.h binemul.h bucomm.h budbg.h \
coffgrok.h debug.h dlltool.h dwarf.h elfcomm.h nlmconv.h \ coffgrok.h debug.h dlltool.h dwarf.h elfcomm.h nlmconv.h \
sysdep.h unwind-ia64.h windres.h winduni.h windint.h \ objdump.h sysdep.h unwind-ia64.h windres.h winduni.h windint.h \
windmc.h windmc.h
GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h
@ -99,6 +99,7 @@ CFILES = \
ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \ ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \
nlmconv.c nm.c not-ranlib.c not-strip.c \ nlmconv.c nm.c not-ranlib.c not-strip.c \
objcopy.c objdump.c prdbg.c \ objcopy.c objdump.c prdbg.c \
od-xcoff.c \
rclex.c rdcoff.c rddbg.c readelf.c rename.c \ rclex.c rdcoff.c rddbg.c readelf.c rename.c \
resbin.c rescoff.c resrc.c resres.c \ resbin.c rescoff.c resrc.c resres.c \
size.c srconv.c stabs.c strings.c sysdump.c \ size.c srconv.c stabs.c strings.c sysdump.c \
@ -113,6 +114,9 @@ GENERATED_CFILES = \
DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c
# Extra object files for objdump
OBJDUMP_PRIVATE_OFILES = @OBJDUMP_PRIVATE_OFILES@
# Code shared by all the binutils. # Code shared by all the binutils.
BULIBS = bucomm.c version.c filemode.c BULIBS = bucomm.c version.c filemode.c
@ -167,7 +171,7 @@ installcheck-local:
# which depends on libintl, since we don't know whether LIBINTL_DEP will be # which depends on libintl, since we don't know whether LIBINTL_DEP will be
# non-empty until configure time. Ugh! # non-empty until configure time. Ugh!
size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES) objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES) $(OBJDUMP_PRIVATE_OFILES)
nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
@ -206,7 +210,8 @@ strip_new_SOURCES = objcopy.c is-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS)
nm_new_SOURCES = nm.c $(BULIBS) nm_new_SOURCES = nm.c $(BULIBS)
objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) $(ELFLIBS) objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) $(ELFLIBS)
objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) EXTRA_objdump_SOURCES = od-xcoff.c
objdump_LDADD = $(OBJDUMP_PRIVATE_OFILES) $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
objdump.@OBJEXT@:objdump.c objdump.@OBJEXT@:objdump.c
if am__fastdepCC if am__fastdepCC

View file

@ -200,9 +200,10 @@ SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(EXTRA_ar_SOURCES) \
$(coffdump_SOURCES) $(cxxfilt_SOURCES) $(dlltool_SOURCES) \ $(coffdump_SOURCES) $(cxxfilt_SOURCES) $(dlltool_SOURCES) \
$(dllwrap_SOURCES) $(elfedit_SOURCES) $(nlmconv_SOURCES) \ $(dllwrap_SOURCES) $(elfedit_SOURCES) $(nlmconv_SOURCES) \
$(nm_new_SOURCES) $(objcopy_SOURCES) $(objdump_SOURCES) \ $(nm_new_SOURCES) $(objcopy_SOURCES) $(objdump_SOURCES) \
$(ranlib_SOURCES) $(readelf_SOURCES) $(size_SOURCES) \ $(EXTRA_objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) \
$(srconv_SOURCES) $(strings_SOURCES) $(strip_new_SOURCES) \ $(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) \
$(sysdump_SOURCES) $(windmc_SOURCES) $(windres_SOURCES) $(strip_new_SOURCES) $(sysdump_SOURCES) $(windmc_SOURCES) \
$(windres_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \ html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \ install-dvi-recursive install-exec-recursive \
@ -298,6 +299,9 @@ NMEDIT = @NMEDIT@
NO_WERROR = @NO_WERROR@ NO_WERROR = @NO_WERROR@
OBJDUMP = @OBJDUMP@ OBJDUMP = @OBJDUMP@
OBJDUMP_DEFS = @OBJDUMP_DEFS@ OBJDUMP_DEFS = @OBJDUMP_DEFS@
# Extra object files for objdump
OBJDUMP_PRIVATE_OFILES = @OBJDUMP_PRIVATE_OFILES@
OBJEXT = @OBJEXT@ OBJEXT = @OBJEXT@
OTOOL = @OTOOL@ OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@ OTOOL64 = @OTOOL64@
@ -429,7 +433,7 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
HFILES = \ HFILES = \
arsup.h binemul.h bucomm.h budbg.h \ arsup.h binemul.h bucomm.h budbg.h \
coffgrok.h debug.h dlltool.h dwarf.h elfcomm.h nlmconv.h \ coffgrok.h debug.h dlltool.h dwarf.h elfcomm.h nlmconv.h \
sysdep.h unwind-ia64.h windres.h winduni.h windint.h \ objdump.h sysdep.h unwind-ia64.h windres.h winduni.h windint.h \
windmc.h windmc.h
GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h mcparse.h
@ -442,6 +446,7 @@ CFILES = \
ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \ ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c \
nlmconv.c nm.c not-ranlib.c not-strip.c \ nlmconv.c nm.c not-ranlib.c not-strip.c \
objcopy.c objdump.c prdbg.c \ objcopy.c objdump.c prdbg.c \
od-xcoff.c \
rclex.c rdcoff.c rddbg.c readelf.c rename.c \ rclex.c rdcoff.c rddbg.c readelf.c rename.c \
resbin.c rescoff.c resrc.c resres.c \ resbin.c rescoff.c resrc.c resres.c \
size.c srconv.c stabs.c strings.c sysdump.c \ size.c srconv.c stabs.c strings.c sysdump.c \
@ -487,7 +492,7 @@ CC_FOR_TARGET = ` \
# which depends on libintl, since we don't know whether LIBINTL_DEP will be # which depends on libintl, since we don't know whether LIBINTL_DEP will be
# non-empty until configure time. Ugh! # non-empty until configure time. Ugh!
size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) size_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES) objdump_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) $(OPCODES) $(OBJDUMP_PRIVATE_OFILES)
nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) nm_new_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) ar_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB) strings_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
@ -517,7 +522,8 @@ elfedit_LDADD = $(LIBINTL) $(LIBIBERTY)
strip_new_SOURCES = objcopy.c is-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS) strip_new_SOURCES = objcopy.c is-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS)
nm_new_SOURCES = nm.c $(BULIBS) nm_new_SOURCES = nm.c $(BULIBS)
objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) $(ELFLIBS) objdump_SOURCES = objdump.c dwarf.c prdbg.c $(DEBUG_SRCS) $(BULIBS) $(ELFLIBS)
objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL) EXTRA_objdump_SOURCES = od-xcoff.c
objdump_LDADD = $(OBJDUMP_PRIVATE_OFILES) $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
cxxfilt_SOURCES = cxxfilt.c $(BULIBS) cxxfilt_SOURCES = cxxfilt.c $(BULIBS)
ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \
emul_$(EMULATION).c $(BULIBS) emul_$(EMULATION).c $(BULIBS)
@ -796,6 +802,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/not-strip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/not-strip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objcopy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objcopy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objdump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objdump.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/od-xcoff.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prdbg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prdbg.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rclex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rclex.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rcparse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rcparse.Po@am__quote@

51
binutils/configure vendored
View file

@ -604,6 +604,7 @@ LTLIBOBJS
LIBOBJS LIBOBJS
EMULATION_VECTOR EMULATION_VECTOR
EMULATION EMULATION
OBJDUMP_PRIVATE_OFILES
OBJDUMP_DEFS OBJDUMP_DEFS
BUILD_INSTALL_MISC BUILD_INSTALL_MISC
BUILD_MISC BUILD_MISC
@ -11198,7 +11199,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 11201 "configure" #line 11202 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
@ -11304,7 +11305,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 11307 "configure" #line 11308 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
@ -13779,6 +13780,9 @@ BUILD_DLLWRAP=
BUILD_MISC= BUILD_MISC=
BUILD_INSTALL_MISC= BUILD_INSTALL_MISC=
OBJDUMP_DEFS= OBJDUMP_DEFS=
OBJDUMP_PRIVATE_VECTORS=
OBJDUMP_PRIVATE_OFILES=
od_vectors=
for targ in $target $canon_targets for targ in $target $canon_targets
do do
@ -13796,6 +13800,7 @@ do
fi fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
od_vectors="$od_vectors objdump_private_desc_xcoff"
else else
case $targ in case $targ in
i[3-7]86*-*-netware*) i[3-7]86*-*-netware*)
@ -13815,9 +13820,11 @@ do
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC" NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
;; ;;
esac esac
case $targ in case $targ in
*-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;; *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
esac esac
case $targ in case $targ in
arm-epoc-pe*) arm-epoc-pe*)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -13931,9 +13938,46 @@ do
OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0" OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
;; ;;
esac esac
# Add objdump private vectors.
case $targ in
powerpc-*-aix*)
od_vectors="$od_vectors objdump_private_desc_xcoff"
;;
esac
fi fi
done done
# Uniq objdump private vector, build objdump target ofiles.
od_files=
f=""
for i in $od_vectors ; do
case " $f " in
*" $i "*) ;;
*)
f="$f $i"
OBJDUMP_PRIVATE_VECTORS="$OBJDUMP_PRIVATE_VECTORS &$i,"
case $i in
objdump_private_desc_xcoff)
od_files="$od_files od-xcoff" ;;
*) as_fn_error "*** unknown private vector $i" "$LINENO" 5 ;;
esac
;;
esac
done
# Uniq objdump target ofiles
f=""
for i in $od_files ; do
case " $f " in
*" $i "*) ;;
*)
f="$f $i"
OBJDUMP_PRIVATE_OFILES="$OBJDUMP_PRIVATE_OFILES $i.$objext"
;;
esac
done
DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT" DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
if test "${with_windres+set}" = set; then if test "${with_windres+set}" = set; then
@ -13944,6 +13988,9 @@ if test "${with_windmc+set}" = set; then
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
fi fi
OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""

View file

@ -179,6 +179,9 @@ BUILD_DLLWRAP=
BUILD_MISC= BUILD_MISC=
BUILD_INSTALL_MISC= BUILD_INSTALL_MISC=
OBJDUMP_DEFS= OBJDUMP_DEFS=
OBJDUMP_PRIVATE_VECTORS=
OBJDUMP_PRIVATE_OFILES=
od_vectors=
for targ in $target $canon_targets for targ in $target $canon_targets
do do
@ -196,6 +199,7 @@ do
fi fi
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
od_vectors="$od_vectors objdump_private_desc_xcoff"
else else
case $targ in case $targ in
changequote(,)dnl changequote(,)dnl
@ -217,9 +221,11 @@ changequote([,])dnl
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC" NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
;; ;;
esac esac
case $targ in case $targ in
*-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;; *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
esac esac
case $targ in case $targ in
arm-epoc-pe*) arm-epoc-pe*)
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
@ -341,9 +347,46 @@ changequote([,])dnl
OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0" OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
;; ;;
esac esac
# Add objdump private vectors.
case $targ in
powerpc-*-aix*)
od_vectors="$od_vectors objdump_private_desc_xcoff"
;;
esac
fi fi
done done
# Uniq objdump private vector, build objdump target ofiles.
od_files=
f=""
for i in $od_vectors ; do
case " $f " in
*" $i "*) ;;
*)
f="$f $i"
OBJDUMP_PRIVATE_VECTORS="$OBJDUMP_PRIVATE_VECTORS &$i,"
case $i in
objdump_private_desc_xcoff)
od_files="$od_files od-xcoff" ;;
*) AC_MSG_ERROR(*** unknown private vector $i) ;;
esac
;;
esac
done
# Uniq objdump target ofiles
f=""
for i in $od_files ; do
case " $f " in
*" $i "*) ;;
*)
f="$f $i"
OBJDUMP_PRIVATE_OFILES="$OBJDUMP_PRIVATE_OFILES $i.$objext"
;;
esac
done
DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT" DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
if test "${with_windres+set}" = set; then if test "${with_windres+set}" = set; then
@ -354,6 +397,8 @@ if test "${with_windmc+set}" = set; then
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)' BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
fi fi
OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
AC_SUBST(NLMCONV_DEFS) AC_SUBST(NLMCONV_DEFS)
AC_SUBST(BUILD_NLMCONV) AC_SUBST(BUILD_NLMCONV)
AC_SUBST(BUILD_SRCONV) AC_SUBST(BUILD_SRCONV)
@ -365,6 +410,7 @@ AC_SUBST(BUILD_DLLWRAP)
AC_SUBST(BUILD_MISC) AC_SUBST(BUILD_MISC)
AC_SUBST(BUILD_INSTALL_MISC) AC_SUBST(BUILD_INSTALL_MISC)
AC_SUBST(OBJDUMP_DEFS) AC_SUBST(OBJDUMP_DEFS)
AC_SUBST(OBJDUMP_PRIVATE_OFILES)
AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.]) AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])

View file

@ -1744,6 +1744,7 @@ objdump [@option{-a}|@option{--archive-headers}]
[@option{-m} @var{machine}|@option{--architecture=}@var{machine}] [@option{-m} @var{machine}|@option{--architecture=}@var{machine}]
[@option{-M} @var{options}|@option{--disassembler-options=}@var{options}] [@option{-M} @var{options}|@option{--disassembler-options=}@var{options}]
[@option{-p}|@option{--private-headers}] [@option{-p}|@option{--private-headers}]
[@option{-P} @var{options}|@option{--private=}@var{options}]
[@option{-r}|@option{--reloc}] [@option{-r}|@option{--reloc}]
[@option{-R}|@option{--dynamic-reloc}] [@option{-R}|@option{--dynamic-reloc}]
[@option{-s}|@option{--full-contents}] [@option{-s}|@option{--full-contents}]
@ -1787,7 +1788,7 @@ object files.
The long and short forms of options, shown here as alternatives, are The long and short forms of options, shown here as alternatives, are
equivalent. At least one option from the list equivalent. At least one option from the list
@option{-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-s,-S,-t,-T,-V,-x} must be given. @option{-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-P,-r,-R,-s,-S,-t,-T,-V,-x} must be given.
@table @env @table @env
@item -a @item -a
@ -2066,6 +2067,17 @@ Print information that is specific to the object file format. The exact
information printed depends upon the object file format. For some information printed depends upon the object file format. For some
object file formats, no additional information is printed. object file formats, no additional information is printed.
@item -P @var{options}
@itemx --private=@var{options}
Print information that is specific to the object file format. The
argument @var{options} is a comma separated list that depends on the
format (the lists of options is displayed with the help).
For XCOFF, the available options are: @option{header}, @option{aout},
@option{sections}, @option{syms}, @option{relocs}, @option{lineno},
@option{loader}, @option{except}, @option{typchk}, @option{traceback}
and @option{toc}.
@item -r @item -r
@itemx --reloc @itemx --reloc
@cindex relocation entries, in object file @cindex relocation entries, in object file

View file

@ -65,6 +65,7 @@
#include "filenames.h" #include "filenames.h"
#include "debug.h" #include "debug.h"
#include "budbg.h" #include "budbg.h"
#include "objdump.h"
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
#include <sys/mman.h> #include <sys/mman.h>
@ -93,6 +94,7 @@ static int dump_reloc_info; /* -r */
static int dump_dynamic_reloc_info; /* -R */ static int dump_dynamic_reloc_info; /* -R */
static int dump_ar_hdrs; /* -a */ static int dump_ar_hdrs; /* -a */
static int dump_private_headers; /* -p */ static int dump_private_headers; /* -p */
static char *dump_private_options; /* -P */
static int prefix_addresses; /* --prefix-addresses */ static int prefix_addresses; /* --prefix-addresses */
static int with_line_numbers; /* -l */ static int with_line_numbers; /* -l */
static bfd_boolean with_source_code; /* -S */ static bfd_boolean with_source_code; /* -S */
@ -185,6 +187,13 @@ static char *strtab;
static bfd_size_type stabstr_size; static bfd_size_type stabstr_size;
static bfd_boolean is_relocatable = FALSE; static bfd_boolean is_relocatable = FALSE;
/* Handlers for -P/--private. */
static const struct objdump_private_desc * const objdump_private_vectors[] =
{
OBJDUMP_PRIVATE_VECTORS
NULL
};
static void static void
usage (FILE *stream, int status) usage (FILE *stream, int status)
@ -196,6 +205,7 @@ usage (FILE *stream, int status)
-a, --archive-headers Display archive header information\n\ -a, --archive-headers Display archive header information\n\
-f, --file-headers Display the contents of the overall file header\n\ -f, --file-headers Display the contents of the overall file header\n\
-p, --private-headers Display object format specific file header contents\n\ -p, --private-headers Display object format specific file header contents\n\
-P, --private=OPT,OPT... Display object format specific contents\n\
-h, --[section-]headers Display the contents of the section headers\n\ -h, --[section-]headers Display the contents of the section headers\n\
-x, --all-headers Display the contents of all headers\n\ -x, --all-headers Display the contents of all headers\n\
-d, --disassemble Display assembler contents of executable sections\n\ -d, --disassemble Display assembler contents of executable sections\n\
@ -221,6 +231,8 @@ usage (FILE *stream, int status)
")); "));
if (status != 2) if (status != 2)
{ {
const struct objdump_private_desc * const *desc;
fprintf (stream, _("\n The following switches are optional:\n")); fprintf (stream, _("\n The following switches are optional:\n"));
fprintf (stream, _("\ fprintf (stream, _("\
-b, --target=BFDNAME Specify the target object format as BFDNAME\n\ -b, --target=BFDNAME Specify the target object format as BFDNAME\n\
@ -256,6 +268,14 @@ usage (FILE *stream, int status)
list_supported_architectures (program_name, stream); list_supported_architectures (program_name, stream);
disassembler_usage (stream); disassembler_usage (stream);
if (objdump_private_vectors[0] != NULL)
{
fprintf (stream,
_("\nOptions supported for -P/--private switch:\n"));
for (desc = objdump_private_vectors; *desc != NULL; desc++)
(*desc)->help (stream);
}
} }
if (REPORT_BUGS_TO[0] && status == 0) if (REPORT_BUGS_TO[0] && status == 0)
fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO); fprintf (stream, _("Report bugs to %s.\n"), REPORT_BUGS_TO);
@ -282,6 +302,7 @@ static struct option long_options[]=
{"adjust-vma", required_argument, NULL, OPTION_ADJUST_VMA}, {"adjust-vma", required_argument, NULL, OPTION_ADJUST_VMA},
{"all-headers", no_argument, NULL, 'x'}, {"all-headers", no_argument, NULL, 'x'},
{"private-headers", no_argument, NULL, 'p'}, {"private-headers", no_argument, NULL, 'p'},
{"private", required_argument, NULL, 'P'},
{"architecture", required_argument, NULL, 'm'}, {"architecture", required_argument, NULL, 'm'},
{"archive-headers", no_argument, NULL, 'a'}, {"archive-headers", no_argument, NULL, 'a'},
{"debugging", no_argument, NULL, 'g'}, {"debugging", no_argument, NULL, 'g'},
@ -2595,6 +2616,57 @@ dump_bfd_private_header (bfd *abfd)
bfd_print_private_bfd_data (abfd, stdout); bfd_print_private_bfd_data (abfd, stdout);
} }
static void
dump_target_specific (bfd *abfd)
{
const struct objdump_private_desc * const *desc;
struct objdump_private_option *opt;
char *e, *b;
/* Find the desc. */
for (desc = objdump_private_vectors; *desc != NULL; desc++)
if ((*desc)->filter (abfd))
break;
if (desc == NULL)
{
non_fatal (_("option -P/--private not supported by this file"));
return;
}
/* Clear all options. */
for (opt = (*desc)->options; opt->name; opt++)
opt->selected = FALSE;
/* Decode options. */
b = dump_private_options;
do
{
e = strchr (b, ',');
if (e)
*e = 0;
for (opt = (*desc)->options; opt->name; opt++)
if (strcmp (opt->name, b) == 0)
{
opt->selected = TRUE;
break;
}
if (opt->name == NULL)
non_fatal (_("target specific dump '%s' not supported"), b);
if (e)
{
*e = ',';
b = e + 1;
}
}
while (e != NULL);
/* Dump. */
(*desc)->dump (abfd);
}
/* Display a section in hexadecimal format with associated characters. /* Display a section in hexadecimal format with associated characters.
Each line prefixed by the zero padded address. */ Each line prefixed by the zero padded address. */
@ -3096,6 +3168,8 @@ dump_bfd (bfd *abfd)
dump_bfd_header (abfd); dump_bfd_header (abfd);
if (dump_private_headers) if (dump_private_headers)
dump_bfd_private_header (abfd); dump_bfd_private_header (abfd);
if (dump_private_options != NULL)
dump_target_specific (abfd);
if (! dump_debugging_tags && ! suppress_bfd_header) if (! dump_debugging_tags && ! suppress_bfd_header)
putchar ('\n'); putchar ('\n');
if (dump_section_headers) if (dump_section_headers)
@ -3307,7 +3381,7 @@ main (int argc, char **argv)
set_default_bfd_target (); set_default_bfd_target ();
while ((c = getopt_long (argc, argv, while ((c = getopt_long (argc, argv,
"pib:m:M:VvCdDlfFaHhrRtTxsSI:j:wE:zgeGW::", "pP:ib:m:M:VvCdDlfFaHhrRtTxsSI:j:wE:zgeGW::",
long_options, (int *) 0)) long_options, (int *) 0))
!= EOF) != EOF)
{ {
@ -3424,6 +3498,10 @@ main (int argc, char **argv)
dump_private_headers = TRUE; dump_private_headers = TRUE;
seenflag = TRUE; seenflag = TRUE;
break; break;
case 'P':
dump_private_options = optarg;
seenflag = TRUE;
break;
case 'x': case 'x':
dump_private_headers = TRUE; dump_private_headers = TRUE;
dump_symtab = TRUE; dump_symtab = TRUE;

50
binutils/objdump.h Normal file
View file

@ -0,0 +1,50 @@
/* objdump.h
Copyright 2011 Free Software Foundation, Inc.
This file is part of GNU Binutils.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include <stdio.h>
struct objdump_private_option
{
/* Option name. */
const char *name;
/* TRUE if the option is selected. Automatically set and cleared by
objdump. */
unsigned int selected;
};
struct objdump_private_desc
{
/* Help displayed for --help. */
void (*help)(FILE *stream);
/* Return TRUE if these options can be applied to ABFD. */
int (*filter)(bfd *abfd);
/* Do the actual work: display whatever is requested according to the
options whose SELECTED field is set. */
void (*dump)(bfd *abfd);
/* List of options. Terminated by a NULL name. */
struct objdump_private_option *options;
};
/* XCOFF specific target. */
extern const struct objdump_private_desc objdump_private_desc_xcoff;

1670
binutils/od-xcoff.c Normal file

File diff suppressed because it is too large Load diff