* Many files: Added gettext invocations around user-visible
strings. * bucomm.h: Added gettext-related includes and defines. * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, HAVE_LC_MESSAGES): Define. * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and po/Makefile. Use AM_PROG_LEX. * Makefile.am (SUBDIRS): New macro. (POTFILES): Likewise. (po/POTFILES.in): New target. (LDADD): Added INTLLIBS. (objdump_LDADD): Likewise. (c__filt_LDADD): Likewise. (ar_LDADD): Likewise. (ranlib_LDADD): Likewise. (dlltool_LDADD): Likewise. (windres_LDADD): Likewise. * po/Make-in, po/POTFILES.in, po/binutils.pot: New files.
This commit is contained in:
parent
53d3ce37d4
commit
9d04d6183d
|
@ -1,3 +1,24 @@
|
|||
Tue Apr 21 22:13:08 1998 Tom Tromey <tromey@scribbles.cygnus.com>
|
||||
|
||||
* Many files: Added gettext invocations around user-visible
|
||||
strings.
|
||||
* bucomm.h: Added gettext-related includes and defines.
|
||||
* acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY,
|
||||
HAVE_LC_MESSAGES): Define.
|
||||
* configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and
|
||||
po/Makefile. Use AM_PROG_LEX.
|
||||
* Makefile.am (SUBDIRS): New macro.
|
||||
(POTFILES): Likewise.
|
||||
(po/POTFILES.in): New target.
|
||||
(LDADD): Added INTLLIBS.
|
||||
(objdump_LDADD): Likewise.
|
||||
(c__filt_LDADD): Likewise.
|
||||
(ar_LDADD): Likewise.
|
||||
(ranlib_LDADD): Likewise.
|
||||
(dlltool_LDADD): Likewise.
|
||||
(windres_LDADD): Likewise.
|
||||
* po/Make-in, po/POTFILES.in, po/binutils.pot: New files.
|
||||
|
||||
Tue Apr 21 16:07:18 1998 Stanislav Brabec <utx@k332.feld.cvut.cz>
|
||||
|
||||
* objcopy.c (preserve_dates): New file static variable.
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
AUTOMAKE_OPTIONS = cygnus dejagnu
|
||||
|
||||
SUBDIRS = po
|
||||
|
||||
tooldir = $(exec_prefix)/$(target_alias)
|
||||
|
||||
## These aren't set by automake, because they appear in
|
||||
|
@ -92,6 +94,11 @@ OPCODES = ../opcodes/libopcodes.la
|
|||
|
||||
LIBIBERTY = ../libiberty/libiberty.a
|
||||
|
||||
POTFILES = $(CFILES) $(DEBUG_SRCS) $(HFILES)
|
||||
po/POTFILES.in: @MAINT@ Makefile
|
||||
for file in $(POTFILES); do echo $$file; done | sort > tmp \
|
||||
&& mv tmp $(srcdir)/po/POTFILES.in
|
||||
|
||||
EXPECT = `if [ -f $$r/../expect/expect ] ; then \
|
||||
echo $$r/../expect/expect ; \
|
||||
else echo expect ; fi`
|
||||
|
@ -135,7 +142,7 @@ installcheck:
|
|||
|
||||
info_TEXINFOS = binutils.texi
|
||||
|
||||
LDADD = $(BFDLIB) $(LIBIBERTY)
|
||||
LDADD = $(BFDLIB) $(LIBIBERTY) $(INTLLIBS)
|
||||
|
||||
size_SOURCES = size.c $(BULIBS)
|
||||
|
||||
|
@ -148,7 +155,7 @@ strip_new_SOURCES = objcopy.c is-strip.c $(WRITE_DEBUG_SRCS) $(BULIBS)
|
|||
nm_new_SOURCES = nm.c $(BULIBS)
|
||||
|
||||
objdump_SOURCES = objdump.c prdbg.c $(DEBUG_SRCS) $(BULIBS)
|
||||
objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY)
|
||||
objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS)
|
||||
|
||||
underscore.c: stamp-under ; @true
|
||||
|
||||
|
@ -162,13 +169,13 @@ cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h
|
|||
$(COMPILE) -c -DMAIN -DVERSION='"$(VERSION)"' $(BASEDIR)/libiberty/cplus-dem.c
|
||||
|
||||
c__filt_SOURCES =
|
||||
c__filt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY)
|
||||
c__filt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY) $(INTLLIBS)
|
||||
|
||||
ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c $(BULIBS)
|
||||
ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
|
||||
ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c $(BULIBS)
|
||||
ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
|
||||
ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
addr2line_SOURCES = addr2line.c $(BULIBS)
|
||||
|
||||
|
@ -218,7 +225,7 @@ sysinfo.o: sysinfo.c
|
|||
srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
|
||||
|
||||
dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
|
||||
dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
|
||||
dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
dlltool.o:dlltool.c
|
||||
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
|
||||
|
@ -237,10 +244,11 @@ nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS)
|
|||
|
||||
windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \
|
||||
$(BULIBS)
|
||||
windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
|
||||
windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
|
||||
syslex.c deflex.c
|
||||
syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c
|
||||
|
||||
diststuff: $(DISTSTUFF) info
|
||||
|
||||
DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated automatically by automake 1.2e from Makefile.am
|
||||
# Makefile.in generated automatically by automake 1.3 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
|
@ -32,6 +32,8 @@ mandir = @mandir@
|
|||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DISTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
@ -70,20 +72,15 @@ CC = @CC@
|
|||
DLLTOOL_DEFS = @DLLTOOL_DEFS@
|
||||
EXEEXT = @EXEEXT@
|
||||
HDEFINES = @HDEFINES@
|
||||
LD = @LD@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
NLMCONV_DEFS = @NLMCONV_DEFS@
|
||||
NM = @NM@
|
||||
PACKAGE = @PACKAGE@
|
||||
RANLIB = @RANLIB@
|
||||
UNDERSCORE = @UNDERSCORE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
AUTOMAKE_OPTIONS = cygnus dejagnu
|
||||
|
||||
SUBDIRS = po
|
||||
|
||||
tooldir = $(exec_prefix)/$(target_alias)
|
||||
|
||||
CC_FOR_BUILD = @CC_FOR_BUILD@
|
||||
|
@ -170,6 +167,8 @@ OPCODES = ../opcodes/libopcodes.la
|
|||
|
||||
LIBIBERTY = ../libiberty/libiberty.a
|
||||
|
||||
POTFILES = $(CFILES) $(DEBUG_SRCS) $(HFILES)
|
||||
|
||||
EXPECT = `if [ -f $$r/../expect/expect ] ; then \
|
||||
echo $$r/../expect/expect ; \
|
||||
else echo expect ; fi`
|
||||
|
@ -194,7 +193,7 @@ CC_FOR_TARGET = ` \
|
|||
|
||||
info_TEXINFOS = binutils.texi
|
||||
|
||||
LDADD = $(BFDLIB) $(LIBIBERTY)
|
||||
LDADD = $(BFDLIB) $(LIBIBERTY) $(INTLLIBS)
|
||||
|
||||
size_SOURCES = size.c $(BULIBS)
|
||||
|
||||
|
@ -207,23 +206,23 @@ strip_new_SOURCES = objcopy.c is-strip.c $(WRITE_DEBUG_SRCS) $(BULIBS)
|
|||
nm_new_SOURCES = nm.c $(BULIBS)
|
||||
|
||||
objdump_SOURCES = objdump.c prdbg.c $(DEBUG_SRCS) $(BULIBS)
|
||||
objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY)
|
||||
objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS)
|
||||
|
||||
c__filt_SOURCES =
|
||||
c__filt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY)
|
||||
c__filt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY) $(INTLLIBS)
|
||||
|
||||
ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c $(BULIBS)
|
||||
ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
|
||||
ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c $(BULIBS)
|
||||
ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
|
||||
ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
addr2line_SOURCES = addr2line.c $(BULIBS)
|
||||
|
||||
srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
|
||||
|
||||
dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
|
||||
dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
|
||||
dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
|
||||
|
||||
|
@ -233,10 +232,10 @@ nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS)
|
|||
|
||||
windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \
|
||||
$(BULIBS)
|
||||
windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@
|
||||
windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
|
||||
syslex.c deflex.c
|
||||
syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c
|
||||
|
||||
DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \
|
||||
site.exp site.bak
|
||||
|
@ -335,13 +334,14 @@ CFLAGS = @CFLAGS@
|
|||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
|
||||
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
MAKEINFO = `if test -f $(top_builddir)/../texinfo/makeinfo/makeinfo; then echo $(top_builddir)/../texinfo/makeinfo/makeinfo; else echo makeinfo; fi`
|
||||
TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi`
|
||||
TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
|
||||
INFO_DEPS = binutils.info
|
||||
DVIS = binutils.dvi
|
||||
TEXINFOS = binutils.texi
|
||||
MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 addr2line.1 nlmconv.1 $(DEMANGLER_PROG).1
|
||||
|
||||
man1dir = $(mandir)/man1
|
||||
MANS = $(man_MANS)
|
||||
|
||||
NROFF = nroff
|
||||
DIST_COMMON = README ChangeLog Makefile.am Makefile.in NEWS acconfig.h \
|
||||
|
@ -350,6 +350,9 @@ configure.in deflex.c defparse.c nlmheader.c rclex.c rcparse.c \
|
|||
stamp-h.in
|
||||
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
|
@ -357,14 +360,14 @@ GZIP = --best
|
|||
SOURCES = $(nlmconv_SOURCES) $(srconv_SOURCES) $(sysdump_SOURCES) $(coffdump_SOURCES) $(dlltool_SOURCES) $(windres_SOURCES) $(size_SOURCES) $(objdump_SOURCES) $(ar_SOURCES) $(strings_SOURCES) $(ranlib_SOURCES) $(c__filt_SOURCES) $(objcopy_SOURCES) $(addr2line_SOURCES) $(nm_new_SOURCES) $(strip_new_SOURCES)
|
||||
OBJECTS = $(nlmconv_OBJECTS) $(srconv_OBJECTS) $(sysdump_OBJECTS) $(coffdump_OBJECTS) $(dlltool_OBJECTS) $(windres_OBJECTS) $(size_OBJECTS) $(objdump_OBJECTS) $(ar_OBJECTS) $(strings_OBJECTS) $(ranlib_OBJECTS) $(c__filt_OBJECTS) $(objcopy_OBJECTS) $(addr2line_OBJECTS) $(nm_new_OBJECTS) $(strip_new_OBJECTS)
|
||||
|
||||
default: all
|
||||
all: all-recursive-am all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .dvi .info .l .lo .o .ps .s .texi .texinfo .y
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
.SUFFIXES: .S .c .dvi .info .l .lo .o .ps .s .texi .texinfo .txi .y
|
||||
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
@ -408,18 +411,18 @@ maintainer-clean-binPROGRAMS:
|
|||
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(bindir)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \
|
||||
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
$(NORMAL_UNINSTALL)
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \
|
||||
done
|
||||
|
||||
mostlyclean-noinstPROGRAMS:
|
||||
|
@ -571,26 +574,38 @@ DVIPS = dvips
|
|||
.texinfo.dvi:
|
||||
TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.txi.info:
|
||||
@rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
$(MAKEINFO) -I $(srcdir) $<
|
||||
|
||||
.txi.dvi:
|
||||
TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.txi:
|
||||
@rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
$(MAKEINFO) -I $(srcdir) $<
|
||||
.dvi.ps:
|
||||
$(DVIPS) $< -o $@
|
||||
|
||||
install-info-am: $(INFO_DEPS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(infodir)
|
||||
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||
@for file in $(INFO_DEPS); do \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
|
||||
if test -f $$d/$$ifile; then \
|
||||
echo " $(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile"; \
|
||||
$(INSTALL_DATA) $$d/$$ifile $(infodir)/$$ifile; \
|
||||
echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
|
||||
$(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
|
||||
else : ; fi; \
|
||||
done; \
|
||||
done
|
||||
@$(POST_INSTALL)
|
||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
|
||||
for file in $(INFO_DEPS); do \
|
||||
echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
|
||||
install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
|
||||
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
|
||||
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
|
||||
done; \
|
||||
else : ; fi
|
||||
|
||||
|
@ -601,11 +616,11 @@ uninstall-info:
|
|||
else ii=; fi; \
|
||||
for file in $(INFO_DEPS); do \
|
||||
test -z "$ii" \
|
||||
|| install-info --info-dir=$(infodir) --remove $$file; \
|
||||
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
|
||||
done
|
||||
$(NORMAL_UNINSTALL)
|
||||
@$(NORMAL_UNINSTALL)
|
||||
for file in $(INFO_DEPS); do \
|
||||
(cd $(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
|
||||
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
|
||||
done
|
||||
|
||||
dist-info: $(INFO_DEPS)
|
||||
|
@ -637,101 +652,82 @@ maintainer-clean-aminfo:
|
|||
fi; \
|
||||
done
|
||||
clean-info: mostlyclean-aminfo
|
||||
|
||||
install-man1:
|
||||
$(mkinstalldirs) $(DESTDIR)$(man1dir)
|
||||
@list='$(man1_MANS)'; \
|
||||
l2='$(man_MANS)'; for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
|
||||
uninstall-man1:
|
||||
@list='$(man1_MANS)'; \
|
||||
l2='$(man_MANS)'; for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
|
||||
rm -f $(DESTDIR)$(man1dir)/$$inst; \
|
||||
done
|
||||
install-man: $(MANS)
|
||||
$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(mandir)/man1
|
||||
@sect=1; \
|
||||
inst=`echo "ar" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/ar.1; then file=$(srcdir)/ar.1; \
|
||||
else file=ar.1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
@sect=1; \
|
||||
inst=`echo "nlmconv" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/nlmconv.1; then file=$(srcdir)/nlmconv.1; \
|
||||
else file=nlmconv.1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
@sect=1; \
|
||||
inst=`echo "$(DEMANGLER_PROG)" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/$(DEMANGLER_PROG).1; then file=$(srcdir)/$(DEMANGLER_PROG).1; \
|
||||
else file=$(DEMANGLER_PROG).1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
@sect=1; \
|
||||
inst=`echo "nm" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/nm.1; then file=$(srcdir)/nm.1; \
|
||||
else file=nm.1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
@sect=1; \
|
||||
inst=`echo "objdump" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/objdump.1; then file=$(srcdir)/objdump.1; \
|
||||
else file=objdump.1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
@sect=1; \
|
||||
inst=`echo "ranlib" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/ranlib.1; then file=$(srcdir)/ranlib.1; \
|
||||
else file=ranlib.1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
@sect=1; \
|
||||
inst=`echo "size" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/size.1; then file=$(srcdir)/size.1; \
|
||||
else file=size.1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
@sect=1; \
|
||||
inst=`echo "strings" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/strings.1; then file=$(srcdir)/strings.1; \
|
||||
else file=strings.1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
@sect=1; \
|
||||
inst=`echo "strip" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/strip.1; then file=$(srcdir)/strip.1; \
|
||||
else file=strip.1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
@sect=1; \
|
||||
inst=`echo "objcopy" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/objcopy.1; then file=$(srcdir)/objcopy.1; \
|
||||
else file=objcopy.1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
@sect=1; \
|
||||
inst=`echo "addr2line" | sed '$(transform)'`.1; \
|
||||
if test -f $(srcdir)/addr2line.1; then file=$(srcdir)/addr2line.1; \
|
||||
else file=addr2line.1; fi; \
|
||||
echo " $(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst"; \
|
||||
$(INSTALL_DATA) $$file $(mandir)/man$$sect/$$inst
|
||||
|
||||
@$(NORMAL_INSTALL)
|
||||
$(MAKE) install-man1
|
||||
uninstall-man:
|
||||
$(NORMAL_UNINSTALL)
|
||||
-inst=`echo "ar" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
-inst=`echo "nlmconv" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
-inst=`echo "$(DEMANGLER_PROG)" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
-inst=`echo "nm" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
-inst=`echo "objdump" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
-inst=`echo "ranlib" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
-inst=`echo "size" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
-inst=`echo "strings" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
-inst=`echo "strip" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
-inst=`echo "objcopy" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
-inst=`echo "addr2line" | sed '$(transform)'`.1; \
|
||||
rm -f $(mandir)/man1/$$inst
|
||||
@$(NORMAL_UNINSTALL)
|
||||
$(MAKE) uninstall-man1
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive install-info-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $$target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
rev="$$subdir $$rev"; \
|
||||
done; \
|
||||
for subdir in $$rev; do \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
(cd $$subdir && $(MAKE) $$target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
(cd $$subdir && $(MAKE) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
|
@ -739,9 +735,12 @@ ID: $(HEADERS) $(SOURCES) $(LISP)
|
|||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
|
@ -800,6 +799,14 @@ distdir: $(DISTFILES)
|
|||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
done
|
||||
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||
|
||||
RUNTESTFLAGS =
|
||||
|
@ -826,29 +833,38 @@ site.exp: Makefile
|
|||
-@sed '1,/^## All variables above are.*##/ d' site.bak >> $@-t
|
||||
-@mv site.exp site.bak
|
||||
@mv $@-t site.exp
|
||||
info: $(INFO_DEPS)
|
||||
dvi: $(DVIS)
|
||||
info: $(INFO_DEPS) info-recursive
|
||||
dvi: $(DVIS) dvi-recursive
|
||||
check:
|
||||
$(MAKE) check-DEJAGNU
|
||||
installcheck:
|
||||
install-info: install-info-am
|
||||
install-exec: install-binPROGRAMS install-exec-local
|
||||
$(MAKE) check-recursive check-DEJAGNU
|
||||
installcheck: installcheck-recursive
|
||||
install-info: install-info-am install-info-recursive
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) all-recursive
|
||||
|
||||
all-am: Makefile $(PROGRAMS) $(MANS) config.h
|
||||
|
||||
install-exec-am: install-binPROGRAMS install-exec-local
|
||||
|
||||
install-data-am: install-man
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS uninstall-man
|
||||
|
||||
install-exec: install-exec-recursive install-exec-am
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install-data: install-man
|
||||
install-data: install-data-recursive install-data-am
|
||||
@$(NORMAL_INSTALL)
|
||||
|
||||
install: install-exec install-data all
|
||||
install: install-recursive install-exec-am install-data-am
|
||||
@:
|
||||
|
||||
uninstall: uninstall-binPROGRAMS uninstall-man
|
||||
|
||||
all: Makefile $(PROGRAMS) $(MANS) config.h
|
||||
uninstall: uninstall-recursive uninstall-am
|
||||
|
||||
install-strip:
|
||||
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(bindir) $(mandir)/man1
|
||||
installdirs: installdirs-recursive
|
||||
$(mkinstalldirs) $(DATADIR)$(bindir) $(DESTDIR)$(mandir)/man1
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
@ -865,46 +881,65 @@ distclean-generic:
|
|||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
|
||||
mostlyclean: mostlyclean-hdr mostlyclean-binPROGRAMS \
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \
|
||||
mostlyclean-noinstPROGRAMS mostlyclean-compile \
|
||||
mostlyclean-libtool mostlyclean-aminfo mostlyclean-tags \
|
||||
mostlyclean-generic mostlyclean-local
|
||||
mostlyclean-generic
|
||||
|
||||
clean: clean-hdr clean-binPROGRAMS clean-noinstPROGRAMS clean-compile \
|
||||
clean-libtool clean-aminfo clean-tags clean-generic \
|
||||
mostlyclean
|
||||
clean-am: clean-hdr clean-binPROGRAMS clean-noinstPROGRAMS \
|
||||
clean-compile clean-libtool clean-aminfo clean-tags \
|
||||
clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-hdr distclean-binPROGRAMS distclean-noinstPROGRAMS \
|
||||
distclean-compile distclean-libtool distclean-aminfo \
|
||||
distclean-tags distclean-generic clean
|
||||
-rm -f config.status
|
||||
-rm -f libtool
|
||||
distclean-am: distclean-hdr distclean-binPROGRAMS \
|
||||
distclean-noinstPROGRAMS distclean-compile \
|
||||
distclean-libtool distclean-aminfo distclean-tags \
|
||||
distclean-generic clean-am
|
||||
|
||||
maintainer-clean: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
|
||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
|
||||
maintainer-clean-noinstPROGRAMS \
|
||||
maintainer-clean-compile maintainer-clean-libtool \
|
||||
maintainer-clean-aminfo maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean
|
||||
maintainer-clean-generic distclean-am
|
||||
|
||||
mostlyclean: mostlyclean-recursive mostlyclean-am mostlyclean-local
|
||||
|
||||
clean: clean-recursive clean-am
|
||||
|
||||
distclean: distclean-recursive distclean-am
|
||||
-rm -f config.status
|
||||
-rm -f libtool
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
-rm -f config.status
|
||||
|
||||
.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
|
||||
maintainer-clean-hdr mostlyclean-binPROGRAMS distclean-binPROGRAMS \
|
||||
clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
|
||||
install-binPROGRAMS mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
|
||||
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
|
||||
mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
|
||||
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
|
||||
mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
|
||||
clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
|
||||
clean-libtool maintainer-clean-libtool install-info-am uninstall-info \
|
||||
mostlyclean-aminfo distclean-aminfo clean-aminfo \
|
||||
maintainer-clean-aminfo install-man uninstall-man tags mostlyclean-tags \
|
||||
maintainer-clean-aminfo install-man1 uninstall-man1 install-man \
|
||||
uninstall-man install-data-recursive uninstall-data-recursive \
|
||||
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
|
||||
uninstalldirs-recursive all-recursive check-recursive \
|
||||
installcheck-recursive info-recursive dvi-recursive \
|
||||
mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \
|
||||
info dvi installcheck install-info install-exec install-data install \
|
||||
uninstall all installdirs mostlyclean-generic distclean-generic \
|
||||
info dvi installcheck install-info all-recursive-am all-am \
|
||||
install-exec-am install-data-am uninstall-am install-exec install-data \
|
||||
install uninstall all installdirs mostlyclean-generic distclean-generic \
|
||||
clean-generic maintainer-clean-generic clean mostlyclean distclean \
|
||||
maintainer-clean
|
||||
|
||||
po/POTFILES.in: @MAINT@ Makefile
|
||||
for file in $(POTFILES); do echo $$file; done | sort > tmp \
|
||||
&& mv tmp $(srcdir)/po/POTFILES.in
|
||||
|
||||
check-DEJAGNU: site.exp
|
||||
srcdir=`cd $(srcdir) && pwd`; export srcdir; \
|
||||
|
@ -987,6 +1022,7 @@ dlltool.o:dlltool.c
|
|||
nlmconv.o: nlmconv.c $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
|
||||
ldname=`echo ld | sed '$(transform)'`; \
|
||||
$(COMPILE) -c -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(srcdir)/nlmconv.c
|
||||
|
||||
diststuff: $(DISTSTUFF) info
|
||||
|
||||
# Targets to rebuild dependencies in this Makefile.
|
||||
|
|
|
@ -32,3 +32,18 @@
|
|||
|
||||
/* Do we need to use the b modifier when opening binary files? */
|
||||
#undef USE_BINARY_FOPEN
|
||||
|
||||
/* Define to 1 if NLS is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define as 1 if you have catgets and don't want to use GNU gettext. */
|
||||
#undef HAVE_CATGETS
|
||||
|
||||
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
|
||||
#undef HAVE_GETTEXT
|
||||
|
||||
/* Define as 1 if you have the stpcpy function. */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define if your locale.h file contains LC_MESSAGES. */
|
||||
#undef HAVE_LC_MESSAGES
|
||||
|
|
|
@ -0,0 +1,324 @@
|
|||
/* addr2line.c -- convert addresses to line number and function name
|
||||
Copyright 1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Ulrich Lauther <Ulrich.Lauther@zfe.siemens.de>
|
||||
|
||||
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 2, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Derived from objdump.c and nm.c by Ulrich.Lauther@zfe.siemens.de
|
||||
|
||||
Usage:
|
||||
addr2line [options] addr addr ...
|
||||
or
|
||||
addr2line [options]
|
||||
|
||||
both forms write results to stdout, the second form reads addresses
|
||||
to be converted from stdin. */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "bfd.h"
|
||||
#include "getopt.h"
|
||||
#include "libiberty.h"
|
||||
#include "demangle.h"
|
||||
#include "bucomm.h"
|
||||
|
||||
extern char *program_version;
|
||||
|
||||
static boolean with_functions; /* -f, show function names. */
|
||||
static boolean do_demangle; /* -C, demangle names. */
|
||||
static boolean base_names; /* -s, strip directory names. */
|
||||
|
||||
static int naddr; /* Number of addresses to process. */
|
||||
static char **addr; /* Hex addresses to process. */
|
||||
|
||||
static asymbol **syms; /* Symbol table. */
|
||||
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"basenames", no_argument, NULL, 's'},
|
||||
{"demangle", no_argument, NULL, 'C'},
|
||||
{"exe", required_argument, NULL, 'e'},
|
||||
{"functions", no_argument, NULL, 'f'},
|
||||
{"target", required_argument, NULL, 'b'},
|
||||
{"help", no_argument, NULL, 'H'},
|
||||
{"version", no_argument, NULL, 'V'},
|
||||
{0, no_argument, 0, 0}
|
||||
};
|
||||
|
||||
static void usage PARAMS ((FILE *, int));
|
||||
static void slurp_symtab PARAMS ((bfd *));
|
||||
static void find_address_in_section PARAMS ((bfd *, asection *, PTR));
|
||||
static void translate_addresses PARAMS ((bfd *));
|
||||
static void process_file PARAMS ((const char *, const char *));
|
||||
|
||||
/* Print a usage message to STREAM and exit with STATUS. */
|
||||
|
||||
static void
|
||||
usage (stream, status)
|
||||
FILE *stream;
|
||||
int status;
|
||||
{
|
||||
fprintf (stream, _("\
|
||||
Usage: %s [-CfsHV] [-b bfdname] [--target=bfdname]\n\
|
||||
[-e executable] [--exe=executable] [--demangle]\n\
|
||||
[--basenames] [--functions] [addr addr ...]\n"),
|
||||
program_name);
|
||||
list_supported_targets (program_name, stream);
|
||||
if (status == 0)
|
||||
fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
|
||||
exit (status);
|
||||
}
|
||||
|
||||
/* Read in the symbol table. */
|
||||
|
||||
static void
|
||||
slurp_symtab (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
long storage;
|
||||
long symcount;
|
||||
|
||||
if ((bfd_get_file_flags (abfd) & HAS_SYMS) == 0)
|
||||
return;
|
||||
|
||||
storage = bfd_get_symtab_upper_bound (abfd);
|
||||
if (storage < 0)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
|
||||
syms = (asymbol **) xmalloc (storage);
|
||||
|
||||
symcount = bfd_canonicalize_symtab (abfd, syms);
|
||||
if (symcount < 0)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
}
|
||||
|
||||
/* These global variables are used to pass information between
|
||||
translate_addresses and find_address_in_section. */
|
||||
|
||||
static bfd_vma pc;
|
||||
static const char *filename;
|
||||
static const char *functionname;
|
||||
static unsigned int line;
|
||||
static boolean found;
|
||||
|
||||
/* Look for an address in a section. This is called via
|
||||
bfd_map_over_sections. */
|
||||
|
||||
static void
|
||||
find_address_in_section (abfd, section, data)
|
||||
bfd *abfd;
|
||||
asection *section;
|
||||
PTR data;
|
||||
{
|
||||
bfd_vma vma;
|
||||
|
||||
if (found)
|
||||
return;
|
||||
|
||||
if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0)
|
||||
return;
|
||||
|
||||
vma = bfd_get_section_vma (abfd, section);
|
||||
if (pc < vma)
|
||||
return;
|
||||
|
||||
found = bfd_find_nearest_line (abfd, section, syms, pc - vma,
|
||||
&filename, &functionname, &line);
|
||||
}
|
||||
|
||||
/* Read hexadecimal addresses from stdin, translate into
|
||||
file_name:line_number and optionally function name. */
|
||||
|
||||
static void
|
||||
translate_addresses (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
int read_stdin = (naddr == 0);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (read_stdin)
|
||||
{
|
||||
char addr_hex[100];
|
||||
|
||||
if (fgets (addr_hex, sizeof addr_hex, stdin) == NULL)
|
||||
break;
|
||||
pc = bfd_scan_vma (addr_hex, NULL, 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (naddr <= 0)
|
||||
break;
|
||||
--naddr;
|
||||
pc = bfd_scan_vma (*addr++, NULL, 16);
|
||||
}
|
||||
|
||||
found = false;
|
||||
bfd_map_over_sections (abfd, find_address_in_section, (PTR) NULL);
|
||||
|
||||
if (! found)
|
||||
{
|
||||
if (with_functions)
|
||||
printf ("??\n");
|
||||
printf ("??:0\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (with_functions)
|
||||
{
|
||||
if (*functionname == '\0')
|
||||
printf ("??\n");
|
||||
else if (! do_demangle)
|
||||
printf ("%s\n", functionname);
|
||||
else
|
||||
{
|
||||
char *res;
|
||||
|
||||
res = cplus_demangle (functionname, DMGL_ANSI | DMGL_PARAMS);
|
||||
if (res == NULL)
|
||||
printf ("%s\n", functionname);
|
||||
else
|
||||
{
|
||||
printf ("%s\n", res);
|
||||
free (res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (base_names)
|
||||
{
|
||||
char *h;
|
||||
|
||||
h = strrchr (filename, '/');
|
||||
if (h != NULL)
|
||||
filename = h + 1;
|
||||
}
|
||||
|
||||
printf ("%s:%u\n", filename, line);
|
||||
}
|
||||
|
||||
/* fflush() is essential for using this command as a server
|
||||
child process that reads addresses from a pipe and responds
|
||||
with line number information, processing one address at a
|
||||
time. */
|
||||
fflush (stdout);
|
||||
}
|
||||
}
|
||||
|
||||
/* Process a file. */
|
||||
|
||||
static void
|
||||
process_file (filename, target)
|
||||
const char *filename;
|
||||
const char *target;
|
||||
{
|
||||
bfd *abfd;
|
||||
char **matching;
|
||||
|
||||
abfd = bfd_openr (filename, target);
|
||||
if (abfd == NULL)
|
||||
bfd_fatal (filename);
|
||||
|
||||
if (bfd_check_format (abfd, bfd_archive))
|
||||
fatal (_("%s: can not get addresses from archive"), filename);
|
||||
|
||||
if (! bfd_check_format_matches (abfd, bfd_object, &matching))
|
||||
{
|
||||
bfd_nonfatal (bfd_get_filename (abfd));
|
||||
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
|
||||
{
|
||||
list_matching_formats (matching);
|
||||
free (matching);
|
||||
}
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
slurp_symtab (abfd);
|
||||
|
||||
translate_addresses (abfd);
|
||||
|
||||
if (syms != NULL)
|
||||
{
|
||||
free (syms);
|
||||
syms = NULL;
|
||||
}
|
||||
|
||||
bfd_close (abfd);
|
||||
}
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
char *filename;
|
||||
char *target;
|
||||
int c;
|
||||
|
||||
program_name = *argv;
|
||||
xmalloc_set_program_name (program_name);
|
||||
|
||||
bfd_init ();
|
||||
set_default_bfd_target ();
|
||||
|
||||
filename = NULL;
|
||||
target = NULL;
|
||||
while ((c = getopt_long (argc, argv, "b:Ce:sfHV", long_options, (int *) 0))
|
||||
!= EOF)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
case 0:
|
||||
break; /* we've been given a long option */
|
||||
case 'b':
|
||||
target = optarg;
|
||||
break;
|
||||
case 'C':
|
||||
do_demangle = true;
|
||||
break;
|
||||
case 'e':
|
||||
filename = optarg;
|
||||
break;
|
||||
case 's':
|
||||
base_names = true;
|
||||
break;
|
||||
case 'f':
|
||||
with_functions = true;
|
||||
break;
|
||||
case 'V':
|
||||
print_version ("addr2line");
|
||||
break;
|
||||
case 'H':
|
||||
usage (stdout, 0);
|
||||
break;
|
||||
default:
|
||||
usage (stderr, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (filename == NULL)
|
||||
filename = "a.out";
|
||||
|
||||
addr = argv + optind;
|
||||
naddr = argc - optind;
|
||||
|
||||
process_file (filename, target);
|
||||
|
||||
return 0;
|
||||
}
|
130
binutils/ar.c
130
binutils/ar.c
|
@ -1,5 +1,5 @@
|
|||
/* ar.c - Archive modify and extract.
|
||||
Copyright 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
|
||||
Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
|
@ -52,9 +52,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
/* Kludge declaration from BFD! This is ugly! FIXME! XXX */
|
||||
|
||||
struct ar_hdr *
|
||||
bfd_special_undocumented_glue PARAMS ((bfd * abfd, char *filename));
|
||||
bfd_special_undocumented_glue PARAMS ((bfd * abfd, const char *filename));
|
||||
|
||||
/* Forward declarations */
|
||||
/* Static declarations */
|
||||
|
||||
static void
|
||||
mri_emul PARAMS ((void));
|
||||
|
||||
static const char *
|
||||
normalize PARAMS ((const char *, bfd *));
|
||||
|
@ -94,6 +97,9 @@ ranlib_only PARAMS ((const char *archname));
|
|||
|
||||
static void
|
||||
ranlib_touch PARAMS ((const char *archname));
|
||||
|
||||
static void
|
||||
usage PARAMS ((int));
|
||||
|
||||
/** Globals and flags */
|
||||
|
||||
|
@ -139,12 +145,15 @@ enum pos
|
|||
pos_default, pos_before, pos_after, pos_end
|
||||
} postype = pos_default;
|
||||
|
||||
static bfd **
|
||||
get_pos_bfd PARAMS ((bfd **, enum pos, const char *));
|
||||
|
||||
/* Whether to truncate names of files stored in the archive. */
|
||||
static boolean ar_truncate = false;
|
||||
|
||||
int interactive = 0;
|
||||
|
||||
void
|
||||
static void
|
||||
mri_emul ()
|
||||
{
|
||||
interactive = isatty (fileno (stdin));
|
||||
|
@ -201,13 +210,13 @@ map_over_members (arch, function, files, count)
|
|||
}
|
||||
}
|
||||
if (!found)
|
||||
fprintf (stderr, "no entry %s in archive\n", *files);
|
||||
fprintf (stderr, _("no entry %s in archive\n"), *files);
|
||||
}
|
||||
}
|
||||
|
||||
boolean operation_alters_arch = false;
|
||||
|
||||
void
|
||||
static void
|
||||
usage (help)
|
||||
int help;
|
||||
{
|
||||
|
@ -215,18 +224,18 @@ usage (help)
|
|||
|
||||
s = help ? stdout : stderr;
|
||||
if (! is_ranlib)
|
||||
fprintf (s, "\
|
||||
Usage: %s [-]{dmpqrtx}[abcilosuvV] [member-name] archive-file file...\n\
|
||||
%s -M [<mri-script]\n",
|
||||
fprintf (s, _("\
|
||||
Usage: %s [-]{dmpqrtx}[abcilosSuvV] [member-name] archive-file file...\n\
|
||||
%s -M [<mri-script]\n"),
|
||||
program_name, program_name);
|
||||
else
|
||||
fprintf (s, "\
|
||||
Usage: %s [-vV] archive\n", program_name);
|
||||
fprintf (s, _("\
|
||||
Usage: %s [-vV] archive\n"), program_name);
|
||||
|
||||
list_supported_targets (program_name, stderr);
|
||||
|
||||
if (help)
|
||||
fprintf (s, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
|
||||
fprintf (s, _("Report bugs to bug-gnu-utils@gnu.org\n"));
|
||||
|
||||
xexit (help ? 0 : 1);
|
||||
}
|
||||
|
@ -337,6 +346,8 @@ main (argc, argv)
|
|||
START_PROGRESS (program_name, 0);
|
||||
|
||||
bfd_init ();
|
||||
set_default_bfd_target ();
|
||||
|
||||
show_version = 0;
|
||||
|
||||
xatexit (remove_output);
|
||||
|
@ -346,7 +357,7 @@ main (argc, argv)
|
|||
boolean touch = false;
|
||||
|
||||
if (argc < 2 || strcmp (argv[1], "--help") == 0)
|
||||
usage ();
|
||||
usage (0);
|
||||
if (strcmp (argv[1], "-V") == 0
|
||||
|| strcmp (argv[1], "-v") == 0
|
||||
|| strncmp (argv[1], "--v", 3) == 0)
|
||||
|
@ -375,7 +386,7 @@ main (argc, argv)
|
|||
}
|
||||
|
||||
if (argc < 2)
|
||||
usage ();
|
||||
usage (0);
|
||||
|
||||
arg_ptr = argv[1];
|
||||
|
||||
|
@ -394,7 +405,7 @@ main (argc, argv)
|
|||
case 't':
|
||||
case 'x':
|
||||
if (operation != none)
|
||||
fatal ("two different operation options specified");
|
||||
fatal (_("two different operation options specified"));
|
||||
switch (c)
|
||||
{
|
||||
case 'd':
|
||||
|
@ -437,6 +448,9 @@ main (argc, argv)
|
|||
case 's':
|
||||
write_armap = 1;
|
||||
break;
|
||||
case 'S':
|
||||
write_armap = -1;
|
||||
break;
|
||||
case 'u':
|
||||
newer_only = 1;
|
||||
break;
|
||||
|
@ -459,8 +473,8 @@ main (argc, argv)
|
|||
ar_truncate = true;
|
||||
break;
|
||||
default:
|
||||
fprintf (stderr, "%s: illegal option -- %c\n", program_name, c);
|
||||
usage ();
|
||||
fprintf (stderr, _("%s: illegal option -- %c\n"), program_name, c);
|
||||
usage (0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -468,7 +482,7 @@ main (argc, argv)
|
|||
print_version ("ar");
|
||||
|
||||
if (argc < 3)
|
||||
usage ();
|
||||
usage (0);
|
||||
|
||||
if (mri_mode)
|
||||
{
|
||||
|
@ -491,10 +505,10 @@ main (argc, argv)
|
|||
}
|
||||
|
||||
if (operation == none)
|
||||
fatal ("no operation specified");
|
||||
fatal (_("no operation specified"));
|
||||
|
||||
if (newer_only && operation != replace)
|
||||
fatal ("`u' is only meaningful with the `r' option.");
|
||||
fatal (_("`u' is only meaningful with the `r' option."));
|
||||
|
||||
arg_index = 2;
|
||||
|
||||
|
@ -573,7 +587,7 @@ main (argc, argv)
|
|||
|
||||
/* Shouldn't happen! */
|
||||
default:
|
||||
fprintf (stderr, "%s: internal error -- this option not implemented\n",
|
||||
fprintf (stderr, _("%s: internal error -- this option not implemented\n"),
|
||||
program_name);
|
||||
xexit (1);
|
||||
}
|
||||
|
@ -603,8 +617,6 @@ open_inarch (archive_filename, file)
|
|||
|
||||
if (stat (archive_filename, &sbuf) != 0)
|
||||
{
|
||||
bfd *obj;
|
||||
|
||||
#ifndef __GO32__
|
||||
|
||||
/* KLUDGE ALERT! Temporary fix until I figger why
|
||||
|
@ -625,12 +637,17 @@ open_inarch (archive_filename, file)
|
|||
|
||||
/* Try to figure out the target to use for the archive from the
|
||||
first object on the list. */
|
||||
obj = bfd_openr (file, NULL);
|
||||
if (obj != NULL)
|
||||
if (file != NULL)
|
||||
{
|
||||
if (bfd_check_format (obj, bfd_object))
|
||||
target = bfd_get_target (obj);
|
||||
(void) bfd_close (obj);
|
||||
bfd *obj;
|
||||
|
||||
obj = bfd_openr (file, NULL);
|
||||
if (obj != NULL)
|
||||
{
|
||||
if (bfd_check_format (obj, bfd_object))
|
||||
target = bfd_get_target (obj);
|
||||
(void) bfd_close (obj);
|
||||
}
|
||||
}
|
||||
|
||||
/* Create an empty archive. */
|
||||
|
@ -684,10 +701,10 @@ print_contents (abfd)
|
|||
struct stat buf;
|
||||
long size;
|
||||
if (bfd_stat_arch_elt (abfd, &buf) != 0)
|
||||
fatal ("internal stat error on %s", bfd_get_filename (abfd));
|
||||
fatal (_("internal stat error on %s"), bfd_get_filename (abfd));
|
||||
|
||||
if (verbose)
|
||||
printf ("\n<member %s>\n\n", bfd_get_filename (abfd));
|
||||
printf (_("\n<member %s>\n\n"), bfd_get_filename (abfd));
|
||||
|
||||
bfd_seek (abfd, 0, SEEK_SET);
|
||||
|
||||
|
@ -703,7 +720,7 @@ print_contents (abfd)
|
|||
nread = bfd_read (cbuf, 1, tocopy, abfd); /* oops -- broke
|
||||
abstraction! */
|
||||
if (nread != tocopy)
|
||||
fatal ("%s is not a valid archive",
|
||||
fatal (_("%s is not a valid archive"),
|
||||
bfd_get_filename (bfd_my_archive (abfd)));
|
||||
fwrite (cbuf, 1, nread, stdout);
|
||||
ncopied += tocopy;
|
||||
|
@ -732,7 +749,7 @@ extract_file (abfd)
|
|||
long size;
|
||||
struct stat buf;
|
||||
if (bfd_stat_arch_elt (abfd, &buf) != 0)
|
||||
fatal ("internal stat error on %s", bfd_get_filename (abfd));
|
||||
fatal (_("internal stat error on %s"), bfd_get_filename (abfd));
|
||||
size = buf.st_size;
|
||||
|
||||
if (verbose)
|
||||
|
@ -764,7 +781,7 @@ extract_file (abfd)
|
|||
|
||||
nread = bfd_read (cbuf, 1, tocopy, abfd);
|
||||
if (nread != tocopy)
|
||||
fatal ("%s is not a valid archive",
|
||||
fatal (_("%s is not a valid archive"),
|
||||
bfd_get_filename (bfd_my_archive (abfd)));
|
||||
|
||||
/* See comment above; this saves disk arm motion */
|
||||
|
@ -871,13 +888,13 @@ do_quick_append (archive_filename, files_to_append)
|
|||
if (newfile == false)
|
||||
{
|
||||
if (bfd_check_format (temp, bfd_archive) != true)
|
||||
fatal ("%s is not an archive", archive_filename);
|
||||
fatal (_("%s is not an archive"), archive_filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite (ARMAG, 1, SARMAG, ofile);
|
||||
if (!silent_create)
|
||||
fprintf (stderr, "%s: creating %s\n",
|
||||
fprintf (stderr, _("%s: creating %s\n"),
|
||||
program_name, archive_filename);
|
||||
}
|
||||
|
||||
|
@ -988,13 +1005,26 @@ write_archive (iarch)
|
|||
into when altering. DEFAULT_POS should be how to interpret pos_default,
|
||||
and should be a pos value. */
|
||||
|
||||
bfd **
|
||||
get_pos_bfd (contents, default_pos)
|
||||
static bfd **
|
||||
get_pos_bfd (contents, default_pos, default_posname)
|
||||
bfd **contents;
|
||||
enum pos default_pos;
|
||||
const char *default_posname;
|
||||
{
|
||||
bfd **after_bfd = contents;
|
||||
enum pos realpos = (postype == pos_default ? default_pos : postype);
|
||||
enum pos realpos;
|
||||
const char *realposname;
|
||||
|
||||
if (postype == pos_default)
|
||||
{
|
||||
realpos = default_pos;
|
||||
realposname = default_posname;
|
||||
}
|
||||
else
|
||||
{
|
||||
realpos = postype;
|
||||
realposname = posname;
|
||||
}
|
||||
|
||||
if (realpos == pos_end)
|
||||
{
|
||||
|
@ -1004,7 +1034,7 @@ get_pos_bfd (contents, default_pos)
|
|||
else
|
||||
{
|
||||
for (; *after_bfd; after_bfd = &(*after_bfd)->next)
|
||||
if (!strcmp ((*after_bfd)->filename, posname))
|
||||
if (strcmp ((*after_bfd)->filename, realposname) == 0)
|
||||
{
|
||||
if (realpos == pos_after)
|
||||
after_bfd = &(*after_bfd)->next;
|
||||
|
@ -1059,7 +1089,7 @@ delete_members (arch, files_to_delete)
|
|||
|
||||
if (verbose && found == false)
|
||||
{
|
||||
printf ("No member named `%s'\n", *files_to_delete);
|
||||
printf (_("No member named `%s'\n"), *files_to_delete);
|
||||
}
|
||||
next_file:
|
||||
;
|
||||
|
@ -1097,7 +1127,7 @@ move_members (arch, files_to_move)
|
|||
*current_ptr_ptr = current_ptr->next;
|
||||
|
||||
/* Now glue to end */
|
||||
after_bfd = get_pos_bfd (&arch->next, pos_end);
|
||||
after_bfd = get_pos_bfd (&arch->next, pos_end, NULL);
|
||||
link = *after_bfd;
|
||||
*after_bfd = current_ptr;
|
||||
current_ptr->next = link;
|
||||
|
@ -1110,7 +1140,7 @@ move_members (arch, files_to_move)
|
|||
|
||||
current_ptr_ptr = &((*current_ptr_ptr)->next);
|
||||
}
|
||||
fprintf (stderr, "%s: no entry %s in archive %s!\n",
|
||||
fprintf (stderr, _("%s: no entry %s in archive %s!\n"),
|
||||
program_name, *files_to_move, arch->filename);
|
||||
xexit (1);
|
||||
next_file:;
|
||||
|
@ -1159,17 +1189,16 @@ replace_members (arch, files_to_move, quick)
|
|||
goto next_file;
|
||||
}
|
||||
if (bfd_stat_arch_elt (current, &asbuf) != 0)
|
||||
fatal ("internal stat error on %s", current->filename);
|
||||
fatal (_("internal stat error on %s"), current->filename);
|
||||
|
||||
if (fsbuf.st_mtime <= asbuf.st_mtime)
|
||||
goto next_file;
|
||||
}
|
||||
|
||||
/* snip out this entry from the chain */
|
||||
*current_ptr = current->next;
|
||||
|
||||
after_bfd = get_pos_bfd (&arch->next, pos_end);
|
||||
after_bfd = get_pos_bfd (&arch->next, pos_after,
|
||||
current->filename);
|
||||
temp = *after_bfd;
|
||||
|
||||
*after_bfd = bfd_openr (*files_to_move, NULL);
|
||||
if (*after_bfd == (bfd *) NULL)
|
||||
{
|
||||
|
@ -1177,6 +1206,9 @@ replace_members (arch, files_to_move, quick)
|
|||
}
|
||||
(*after_bfd)->next = temp;
|
||||
|
||||
/* snip out this entry from the chain */
|
||||
*current_ptr = (*current_ptr)->next;
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
printf ("r - %s\n", *files_to_move);
|
||||
|
@ -1192,7 +1224,7 @@ replace_members (arch, files_to_move, quick)
|
|||
|
||||
/* Add to the end of the archive. */
|
||||
|
||||
after_bfd = get_pos_bfd (&arch->next, pos_end);
|
||||
after_bfd = get_pos_bfd (&arch->next, pos_end, NULL);
|
||||
temp = *after_bfd;
|
||||
*after_bfd = bfd_openr (*files_to_move, NULL);
|
||||
if (*after_bfd == (bfd *) NULL)
|
||||
|
@ -1266,7 +1298,7 @@ ranlib_touch (archname)
|
|||
}
|
||||
|
||||
if (! bfd_has_map (arch))
|
||||
fatal ("%s: no archive map to update", archname);
|
||||
fatal (_("%s: no archive map to update"), archname);
|
||||
|
||||
bfd_update_armap_timestamp (arch);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* bucomm.h -- binutils common include file.
|
||||
Copyright 1992 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
|
@ -15,18 +15,157 @@ 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, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _BUCOMM_H
|
||||
#define _BUCOMM_H
|
||||
|
||||
#include "ansidecl.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef USE_BINARY_FOPEN
|
||||
#include "fopen-bin.h"
|
||||
#else
|
||||
#include "fopen-same.h"
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#else
|
||||
extern char *strchr ();
|
||||
extern char *strrchr ();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
#ifdef HAVE_SYS_FILE_H
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_DECLARATION_STRSTR
|
||||
extern char *strstr ();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SBRK
|
||||
#ifdef NEED_DECLARATION_SBRK
|
||||
extern char *sbrk ();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef NEED_DECLARATION_GETENV
|
||||
extern char *getenv ();
|
||||
#endif
|
||||
|
||||
#ifndef O_RDONLY
|
||||
#define O_RDONLY 0
|
||||
#endif
|
||||
|
||||
#ifndef O_RDWR
|
||||
#define O_RDWR 2
|
||||
#endif
|
||||
|
||||
#ifndef SEEK_SET
|
||||
#define SEEK_SET 0
|
||||
#endif
|
||||
#ifndef SEEK_CUR
|
||||
#define SEEK_CUR 1
|
||||
#endif
|
||||
#ifndef SEEK_END
|
||||
#define SEEK_END 2
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# undef alloca
|
||||
# define alloca __builtin_alloca
|
||||
#else
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# else
|
||||
# ifndef alloca /* predefined by HP cc +Olibcalls */
|
||||
# if !defined (__STDC__) && !defined (__hpux)
|
||||
char *alloca ();
|
||||
# else
|
||||
void *alloca ();
|
||||
# endif /* __STDC__, __hpux */
|
||||
# endif /* alloca */
|
||||
# endif /* HAVE_ALLOCA_H */
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#include <libintl.h>
|
||||
#define _(String) gettext (String)
|
||||
#ifdef gettext_noop
|
||||
#define N_(String) gettext_noop (String)
|
||||
#else
|
||||
#define N_(String) (String)
|
||||
#endif
|
||||
#else
|
||||
/* Stubs that do something close enough. */
|
||||
#define textdomain(String) (String)
|
||||
#define gettext(String) (String)
|
||||
#define dgettext(Domain,Message) (Message)
|
||||
#define dcgettext(Domain,Message,Type) (Message)
|
||||
#define bindtextdomain(Domain,Directory) (Domain)
|
||||
#define _(String) (String)
|
||||
#define N_(String) (String)
|
||||
/* In this case we don't care about the value. */
|
||||
#ifndef LC_MESSAGES
|
||||
#define LC_MESSAGES 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* bucomm.c */
|
||||
void bfd_nonfatal PARAMS ((CONST char *));
|
||||
|
||||
void bfd_fatal PARAMS ((CONST char *));
|
||||
|
||||
PTR xmalloc PARAMS ((size_t));
|
||||
|
||||
PTR xrealloc PARAMS ((char *, size_t));
|
||||
|
||||
void fatal PARAMS ((CONST char *, ...));
|
||||
|
||||
void set_default_bfd_target PARAMS ((void));
|
||||
|
||||
void list_matching_formats PARAMS ((char **p));
|
||||
|
||||
void list_supported_targets PARAMS ((const char *, FILE *));
|
||||
|
||||
void print_arelt_descr PARAMS ((FILE *file, bfd *abfd, boolean verbose));
|
||||
|
||||
char *make_tempname PARAMS ((char *));
|
||||
|
||||
bfd_vma parse_vma PARAMS ((const char *, const char *));
|
||||
|
||||
extern char *program_name;
|
||||
|
||||
/* filemode.c */
|
||||
void mode_string PARAMS ((unsigned long mode, char *buf));
|
||||
|
||||
/* version.c */
|
||||
extern void print_version PARAMS ((const char *));
|
||||
|
||||
/* libiberty */
|
||||
PTR xmalloc PARAMS ((size_t));
|
||||
|
||||
PTR xrealloc PARAMS ((PTR, size_t));
|
||||
|
||||
#endif /* _BUCOMM_H */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* Coff file dumper.
|
||||
Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
|
@ -15,7 +15,7 @@ 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, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Written by Steve Chamberlain <sac@cygnus.com>
|
||||
|
||||
|
@ -25,16 +25,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
|
||||
#include <bfd.h>
|
||||
#include <getopt.h>
|
||||
#include <stdio.h>
|
||||
#include <libiberty.h>
|
||||
#include "bucomm.h"
|
||||
|
||||
#include "coffgrok.h"
|
||||
|
||||
#include "bucomm.h"
|
||||
|
||||
#define PROGRAM_VERSION "1.0"
|
||||
|
||||
|
||||
char *xcalloc(a,b)
|
||||
int a;
|
||||
int b;
|
||||
|
@ -103,7 +100,7 @@ dump_coff_lines (p)
|
|||
int i;
|
||||
int online = 0;
|
||||
tab(1);
|
||||
printf("#lines %d ",p->nlines);
|
||||
printf(_("#lines %d "),p->nlines);
|
||||
for (i = 0; i < p->nlines; i++)
|
||||
{
|
||||
printf("(%d 0x%x)", p->lines[i], p->addresses[i]);
|
||||
|
@ -127,6 +124,12 @@ dump_coff_type (p)
|
|||
printf ("size %d ", p->size);
|
||||
switch (p->type)
|
||||
{
|
||||
case coff_secdef_type:
|
||||
printf ("section definition at %x size %x\n",
|
||||
p->u.asecdef.address,
|
||||
p->u.asecdef.size);
|
||||
nl();
|
||||
break;
|
||||
case coff_pointer_type:
|
||||
printf ("pointer to");
|
||||
nl ();
|
||||
|
@ -459,7 +462,7 @@ show_usage (file, status)
|
|||
static void
|
||||
show_help ()
|
||||
{
|
||||
printf ("%s: Print a human readable interpretation of a SYSROFF object file\n",
|
||||
printf (_("%s: Print a human readable interpretation of a SYSROFF object file\n"),
|
||||
program_name);
|
||||
show_usage (stdout, 0);
|
||||
}
|
||||
|
@ -495,7 +498,7 @@ main (ac, av)
|
|||
show_help ();
|
||||
/*NOTREACHED*/
|
||||
case 'V':
|
||||
printf ("GNU %s version %s\n", program_name, PROGRAM_VERSION);
|
||||
printf (_("GNU %s version %s\n"), program_name, PROGRAM_VERSION);
|
||||
exit (0);
|
||||
/*NOTREACHED*/
|
||||
case 0:
|
||||
|
@ -513,7 +516,7 @@ main (ac, av)
|
|||
|
||||
if (!input_file)
|
||||
{
|
||||
fprintf (stderr,"%s: no input file specified\n",
|
||||
fprintf (stderr,_("%s: no input file specified\n"),
|
||||
program_name);
|
||||
exit(1);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,7 +5,7 @@ AC_INIT(ar.c)
|
|||
|
||||
AC_CANONICAL_SYSTEM
|
||||
|
||||
AM_INIT_AUTOMAKE(binutils, 2.8.2)
|
||||
AM_INIT_AUTOMAKE(binutils, 2.9.1)
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
|
@ -37,8 +37,10 @@ fi
|
|||
AC_PROG_CC
|
||||
|
||||
AC_PROG_YACC
|
||||
AC_PROG_LEX
|
||||
AC_DECL_YYTEXT
|
||||
AM_PROG_LEX
|
||||
|
||||
ALL_LINGUAS=
|
||||
CY_GNU_GETTEXT
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
AM_CYGWIN32
|
||||
|
@ -62,13 +64,6 @@ AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
|
|||
AC_HEADER_SYS_WAIT
|
||||
AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(sbrk utimes)
|
||||
dnl Temporary workaround for bug in autoconf 2.12. When the bug is
|
||||
dnl fixed, we can just call AC_FUNC_VFORK in all cases.
|
||||
if test "x$cross_compiling" = "xno"; then
|
||||
AC_FUNC_VFORK
|
||||
else
|
||||
AC_CHECK_FUNC(vfork, , AC_DEFINE(vfork, fork))
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for time_t in time.h)
|
||||
AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
|
||||
|
@ -173,7 +168,7 @@ changequote([,])dnl
|
|||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
;;
|
||||
changequote(,)dnl
|
||||
i[3-6]86-*pe* | i[3-6]86-*-cygwin32)
|
||||
i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
|
||||
changequote([,])dnl
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
|
||||
|
@ -195,6 +190,8 @@ AC_SUBST(BUILD_DLLTOOL)
|
|||
AC_SUBST(DLLTOOL_DEFS)
|
||||
AC_SUBST(BUILD_WINDRES)
|
||||
|
||||
AC_DEFINE_UNQUOTED(TARGET, "${target}")
|
||||
|
||||
targ=$target
|
||||
. $srcdir/../bfd/config.bfd
|
||||
if test "x$targ_underscore" = "xyes"; then
|
||||
|
@ -204,4 +201,5 @@ else
|
|||
fi
|
||||
AC_SUBST(UNDERSCORE)
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
|
||||
[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -223,7 +224,8 @@
|
|||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#else
|
||||
#else /* ! HAVE_SYS_WAIT_H */
|
||||
#if ! defined (_WIN32) || defined (__CYGWIN32__)
|
||||
#ifndef WIFEXITED
|
||||
#define WIFEXITED(w) (((w)&0377) == 0)
|
||||
#endif
|
||||
|
@ -236,7 +238,21 @@
|
|||
#ifndef WEXITSTATUS
|
||||
#define WEXITSTATUS(w) (((w) >> 8) & 0377)
|
||||
#endif
|
||||
#else /* defined (_WIN32) && ! defined (__CYGWIN32__) */
|
||||
#ifndef WIFEXITED
|
||||
#define WIFEXITED(w) (((w) & 0xff) == 0)
|
||||
#endif
|
||||
#ifndef WIFSIGNALED
|
||||
#define WIFSIGNALED(w) (((w) & 0xff) != 0 && ((w) & 0xff) != 0x7f)
|
||||
#endif
|
||||
#ifndef WTERMSIG
|
||||
#define WTERMSIG(w) ((w) & 0x7f)
|
||||
#endif
|
||||
#ifndef WEXITSTATUS
|
||||
#define WEXITSTATUS(w) (((w) & 0xff00) >> 8)
|
||||
#endif
|
||||
#endif /* defined (_WIN32) && ! defined (__CYGWIN32__) */
|
||||
#endif /* ! HAVE_SYS_WAIT_H */
|
||||
|
||||
static char *as_name = "as";
|
||||
|
||||
|
@ -483,7 +499,7 @@ process_def_file (name)
|
|||
FILE *f = fopen (name, FOPEN_RT);
|
||||
if (!f)
|
||||
{
|
||||
fprintf (stderr, "%s: Can't open def file %s\n", program_name, name);
|
||||
fprintf (stderr, _("%s: Can't open def file %s\n"), program_name, name);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
@ -513,7 +529,7 @@ int
|
|||
yyerror (err)
|
||||
const char *err;
|
||||
{
|
||||
fprintf (stderr, "%s: Syntax error in def file %s:%d\n",
|
||||
fprintf (stderr, _("%s: Syntax error in def file %s:%d\n"),
|
||||
program_name, def_file, linenumber);
|
||||
return 0;
|
||||
}
|
||||
|
@ -546,10 +562,10 @@ def_name (name, base)
|
|||
int base;
|
||||
{
|
||||
if (verbose)
|
||||
fprintf (stderr, "%s NAME %s base %x\n", program_name, name, base);
|
||||
fprintf (stderr, _("%s NAME %s base %x\n"), program_name, name, base);
|
||||
if (d_is_dll)
|
||||
{
|
||||
fprintf (stderr, "Can't have LIBRARY and NAME\n");
|
||||
fprintf (stderr, _("Can't have LIBRARY and NAME\n"));
|
||||
}
|
||||
d_name = name;
|
||||
d_is_exe = 1;
|
||||
|
@ -561,10 +577,10 @@ def_library (name, base)
|
|||
int base;
|
||||
{
|
||||
if (verbose)
|
||||
printf ("%s: LIBRARY %s base %x\n", program_name, name, base);
|
||||
printf (_("%s: LIBRARY %s base %x\n"), program_name, name, base);
|
||||
if (d_is_exe)
|
||||
{
|
||||
fprintf (stderr, "%s: Can't have LIBRARY and NAME\n", program_name);
|
||||
fprintf (stderr, _("%s: Can't have LIBRARY and NAME\n"), program_name);
|
||||
}
|
||||
d_name = name;
|
||||
d_is_dll = 1;
|
||||
|
@ -623,7 +639,7 @@ def_import (internal, module, entry)
|
|||
const char *entry;
|
||||
{
|
||||
if (verbose)
|
||||
fprintf (stderr, "%s: IMPORTS are ignored", program_name);
|
||||
fprintf (stderr, _("%s: IMPORTS are ignored"), program_name);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -725,19 +741,19 @@ run (what, args)
|
|||
pid = pwait (pid, &wait_status, 0);
|
||||
if (pid == -1)
|
||||
{
|
||||
fprintf (stderr, "%s: wait: %s\n", program_name, strerror (errno));
|
||||
fprintf (stderr, _("%s: wait: %s\n"), program_name, strerror (errno));
|
||||
exit (1);
|
||||
}
|
||||
else if (WIFSIGNALED (wait_status))
|
||||
{
|
||||
fprintf (stderr, "%s: subprocess got fatal signal %d\n",
|
||||
fprintf (stderr, _("%s: subprocess got fatal signal %d\n"),
|
||||
program_name, WTERMSIG (wait_status));
|
||||
exit (1);
|
||||
}
|
||||
else if (WIFEXITED (wait_status))
|
||||
{
|
||||
if (WEXITSTATUS (wait_status) != 0)
|
||||
fprintf (stderr, "%s: %s exited with status %d\n",
|
||||
fprintf (stderr, _("%s: %s exited with status %d\n"),
|
||||
program_name, what, WEXITSTATUS (wait_status));
|
||||
}
|
||||
else
|
||||
|
@ -765,7 +781,7 @@ scan_open_obj_file (abfd)
|
|||
char *e;
|
||||
bfd_get_section_contents (abfd, s, buf, 0, size);
|
||||
if (verbose)
|
||||
fprintf (stderr, "%s: Sucking in info from %s\n",
|
||||
fprintf (stderr, _("%s: Sucking in info from %s\n"),
|
||||
program_name,
|
||||
bfd_get_filename (abfd));
|
||||
|
||||
|
@ -800,7 +816,7 @@ scan_open_obj_file (abfd)
|
|||
basenames (abfd);
|
||||
|
||||
if (verbose)
|
||||
fprintf (stderr, "%s: Done readin\n",
|
||||
fprintf (stderr, _("%s: Done readin\n"),
|
||||
program_name);
|
||||
}
|
||||
|
||||
|
@ -812,7 +828,7 @@ scan_obj_file (filename)
|
|||
|
||||
if (!f)
|
||||
{
|
||||
fprintf (stderr, "%s: Unable to open object file %s\n",
|
||||
fprintf (stderr, _("%s: Unable to open object file %s\n"),
|
||||
program_name,
|
||||
filename);
|
||||
exit (1);
|
||||
|
@ -937,18 +953,18 @@ gen_exp_file ()
|
|||
sprintf (outfile, "t%s", exp_name);
|
||||
|
||||
if (verbose)
|
||||
fprintf (stderr, "%s: Generate exp file %s\n",
|
||||
fprintf (stderr, _("%s: Generate exp file %s\n"),
|
||||
program_name, exp_name);
|
||||
|
||||
f = fopen (outfile, FOPEN_WT);
|
||||
if (!f)
|
||||
{
|
||||
fprintf (stderr, "%s: Unable to open output file %s\n", program_name, outfile);
|
||||
fprintf (stderr, _("%s: Unable to open output file %s\n"), program_name, outfile);
|
||||
exit (1);
|
||||
}
|
||||
if (verbose)
|
||||
{
|
||||
fprintf (stderr, "%s: Opened file %s\n",
|
||||
fprintf (stderr, _("%s: Opened file %s\n"),
|
||||
program_name, outfile);
|
||||
}
|
||||
|
||||
|
@ -1081,8 +1097,13 @@ gen_exp_file ()
|
|||
for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
|
||||
if (!exp->noname || show_allnames)
|
||||
{
|
||||
/* We use a single underscore for MS compatibility, and a
|
||||
double underscore for backward compatibility with old
|
||||
cygwin releases. */
|
||||
fprintf (f, "\t%s\t__imp_%s\n", ASM_GLOBAL, exp->name);
|
||||
fprintf (f, "\t%s\t_imp__%s\n", ASM_GLOBAL, exp->name);
|
||||
fprintf (f, "__imp_%s:\n", exp->name);
|
||||
fprintf (f, "_imp__%s:\n", exp->name);
|
||||
fprintf (f, "\t%s\t%s\n", ASM_LONG, exp->name);
|
||||
}
|
||||
}
|
||||
|
@ -1266,7 +1287,8 @@ static sinfo secdata[NSECS] =
|
|||
#endif
|
||||
|
||||
/*
|
||||
This is what we're trying to make
|
||||
This is what we're trying to make. We generate the imp symbols with
|
||||
both single and double underscores, for compatibility.
|
||||
|
||||
.text
|
||||
.global _GetFileVersionInfoSizeW@8
|
||||
|
@ -1330,6 +1352,7 @@ make_one_lib_file (exp, i)
|
|||
fprintf (f, "\t.text\n");
|
||||
fprintf (f, "\t%s\t%s%s\n", ASM_GLOBAL, ASM_PREFIX, exp->name);
|
||||
fprintf (f, "\t%s\t__imp_%s\n", ASM_GLOBAL, exp->name);
|
||||
fprintf (f, "\t%s\t_imp__%s\n", ASM_GLOBAL, exp->name);
|
||||
fprintf (f, "%s%s:\n\t%s\t__imp_%s\n", ASM_PREFIX,
|
||||
exp->name, ASM_JUMP, exp->name);
|
||||
|
||||
|
@ -1341,6 +1364,7 @@ make_one_lib_file (exp, i)
|
|||
|
||||
fprintf (f, "\t.section .idata$5\n");
|
||||
fprintf (f, "__imp_%s:\n", exp->name);
|
||||
fprintf (f, "_imp__%s:\n", exp->name);
|
||||
|
||||
dump_iat (f, exp);
|
||||
|
||||
|
@ -1371,7 +1395,7 @@ make_one_lib_file (exp, i)
|
|||
bfd *abfd;
|
||||
|
||||
asymbol *exp_label;
|
||||
asymbol *iname;
|
||||
asymbol *iname, *iname2;
|
||||
asymbol *iname_lab;
|
||||
asymbol **iname_lab_pp;
|
||||
asymbol **iname_pp;
|
||||
|
@ -1388,8 +1412,7 @@ make_one_lib_file (exp, i)
|
|||
asymbol **toc_pp;
|
||||
#endif
|
||||
|
||||
/* one symbol for each section, 2 extra + a null */
|
||||
asymbol *ptrs[NSECS+3+EXTRA+1];
|
||||
asymbol *ptrs[NSECS + 4 + EXTRA + 1];
|
||||
|
||||
char *outname = xmalloc (10);
|
||||
int oidx = 0;
|
||||
|
@ -1397,7 +1420,7 @@ make_one_lib_file (exp, i)
|
|||
abfd = bfd_openw (outname, HOW_BFD_TARGET);
|
||||
if (!abfd)
|
||||
{
|
||||
fprintf (stderr, "%s: bfd_open failed open output file %s\n",
|
||||
fprintf (stderr, _("%s: bfd_open failed open output file %s\n"),
|
||||
program_name, outname);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -1454,12 +1477,20 @@ make_one_lib_file (exp, i)
|
|||
ptrs[oidx++] = exp_label;
|
||||
}
|
||||
|
||||
/* Generate imp symbols with one underscore for Microsoft
|
||||
compatibility, and with two underscores for backward
|
||||
compatibility with old versions of cygwin. */
|
||||
iname = bfd_make_empty_symbol(abfd);
|
||||
iname->name = make_label ("__imp_", exp->name);
|
||||
iname->section = secdata[IDATA5].sec;
|
||||
iname->flags = BSF_GLOBAL;
|
||||
iname->value = 0;
|
||||
|
||||
iname2 = bfd_make_empty_symbol(abfd);
|
||||
iname2->name = make_label ("_imp__", exp->name);
|
||||
iname2->section = secdata[IDATA5].sec;
|
||||
iname2->flags = BSF_GLOBAL;
|
||||
iname2->value = 0;
|
||||
|
||||
iname_lab = bfd_make_empty_symbol(abfd);
|
||||
|
||||
|
@ -1471,6 +1502,7 @@ make_one_lib_file (exp, i)
|
|||
|
||||
iname_pp = ptrs + oidx;
|
||||
ptrs[oidx++] = iname;
|
||||
ptrs[oidx++] = iname2;
|
||||
|
||||
iname_lab_pp = ptrs + oidx;
|
||||
ptrs[oidx++] = iname_lab;
|
||||
|
@ -1581,7 +1613,10 @@ make_one_lib_file (exp, i)
|
|||
case IDATA6:
|
||||
if (!exp->noname)
|
||||
{
|
||||
int idx = exp->hint + 1;
|
||||
/* This used to add 1 to exp->hint. I don't know
|
||||
why it did that, and it does not match what I see
|
||||
in programs compiled with the MS tools. */
|
||||
int idx = exp->hint;
|
||||
si->size = strlen (xlate (exp->name)) + 3;
|
||||
si->data = xmalloc (si->size);
|
||||
si->data[0] = idx & 0xff;
|
||||
|
@ -1874,7 +1909,8 @@ gen_lib_file ()
|
|||
|
||||
if (!outarch)
|
||||
{
|
||||
fprintf (stderr, "%s: Can't open .lib file %s\n", program_name, imp_name);
|
||||
fprintf (stderr, _("%s: Can't open .lib file %s\n"),
|
||||
program_name, imp_name);
|
||||
exit (1);
|
||||
}
|
||||
bfd_set_format (outarch, bfd_archive);
|
||||
|
@ -1928,13 +1964,17 @@ gen_lib_file ()
|
|||
}
|
||||
|
||||
if (dontdeltemps < 2)
|
||||
for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
|
||||
{
|
||||
sprintf (outfile, "ds%d.o",i);
|
||||
unlink (outfile);
|
||||
}
|
||||
|
||||
{
|
||||
for (i = 0, exp = d_exports; exp; i++, exp = exp->next)
|
||||
{
|
||||
sprintf (outfile, "ds%d.o",i);
|
||||
if (unlink (outfile) < 0)
|
||||
fprintf (stderr, _("%s: cannot delete %s: %s\n"), program_name,
|
||||
outfile, strerror (errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************************************/
|
||||
|
||||
/* Run through the information gathered from the .o files and the
|
||||
|
@ -2032,7 +2072,7 @@ process_duplicates (d_export_vec)
|
|||
|
||||
more = 1;
|
||||
if (verbose)
|
||||
fprintf (stderr, "Warning, ignoring duplicate EXPORT %s %d,%d\n",
|
||||
fprintf (stderr, _("Warning, ignoring duplicate EXPORT %s %d,%d\n"),
|
||||
a->name,
|
||||
a->ordinal,
|
||||
b->ordinal);
|
||||
|
@ -2040,7 +2080,7 @@ process_duplicates (d_export_vec)
|
|||
&& b->ordinal != -1)
|
||||
{
|
||||
|
||||
fprintf (stderr, "Error, duplicate EXPORT with oridinals %s\n",
|
||||
fprintf (stderr, _("Error, duplicate EXPORT with oridinals %s\n"),
|
||||
a->name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -2212,22 +2252,22 @@ usage (file, status)
|
|||
FILE *file;
|
||||
int status;
|
||||
{
|
||||
fprintf (file, "Usage %s <options> <object-files>\n", program_name);
|
||||
fprintf (file, " --machine <machine>\n");
|
||||
fprintf (file, " --output-exp <outname> Generate export file.\n");
|
||||
fprintf (file, " --output-lib <outname> Generate input library.\n");
|
||||
fprintf (file, " --add-indirect Add dll indirects to export file.\n");
|
||||
fprintf (file, " --dllname <name> Name of input dll to put into output lib.\n");
|
||||
fprintf (file, " --def <deffile> Name input .def file\n");
|
||||
fprintf (file, " --output-def <deffile> Name output .def file\n");
|
||||
fprintf (file, " --base-file <basefile> Read linker generated base file\n");
|
||||
fprintf (file, " --no-idata4 Don't generate idata$4 section\n");
|
||||
fprintf (file, " --no-idata5 Don't generate idata$5 section\n");
|
||||
fprintf (file, " -v Verbose\n");
|
||||
fprintf (file, " -U Add underscores to .lib\n");
|
||||
fprintf (file, " -k Kill @<n> from exported names\n");
|
||||
fprintf (file, " --as <name> Use <name> for assembler\n");
|
||||
fprintf (file, " --nodelete Keep temp files.\n");
|
||||
fprintf (file, _("Usage %s <options> <object-files>\n"), program_name);
|
||||
fprintf (file, _(" --machine <machine>\n"));
|
||||
fprintf (file, _(" --output-exp <outname> Generate export file.\n"));
|
||||
fprintf (file, _(" --output-lib <outname> Generate input library.\n"));
|
||||
fprintf (file, _(" --add-indirect Add dll indirects to export file.\n"));
|
||||
fprintf (file, _(" --dllname <name> Name of input dll to put into output lib.\n"));
|
||||
fprintf (file, _(" --def <deffile> Name input .def file\n"));
|
||||
fprintf (file, _(" --output-def <deffile> Name output .def file\n"));
|
||||
fprintf (file, _(" --base-file <basefile> Read linker generated base file\n"));
|
||||
fprintf (file, _(" --no-idata4 Don't generate idata$4 section\n"));
|
||||
fprintf (file, _(" --no-idata5 Don't generate idata$5 section\n"));
|
||||
fprintf (file, _(" -v Verbose\n"));
|
||||
fprintf (file, _(" -U Add underscores to .lib\n"));
|
||||
fprintf (file, _(" -k Kill @<n> from exported names\n"));
|
||||
fprintf (file, _(" --as <name> Use <name> for assembler\n"));
|
||||
fprintf (file, _(" --nodelete Keep temp files.\n"));
|
||||
exit (status);
|
||||
}
|
||||
|
||||
|
@ -2330,7 +2370,7 @@ main (ac, av)
|
|||
base_file = fopen (optarg, FOPEN_RB);
|
||||
if (!base_file)
|
||||
{
|
||||
fprintf (stderr, "%s: Unable to open base-file %s\n",
|
||||
fprintf (stderr, _("%s: Unable to open base-file %s\n"),
|
||||
av[0],
|
||||
optarg);
|
||||
exit (1);
|
||||
|
@ -2350,7 +2390,7 @@ main (ac, av)
|
|||
|
||||
if (!mtable[i].type)
|
||||
{
|
||||
fprintf (stderr, "Machine not supported\n");
|
||||
fprintf (stderr, _("Machine not supported\n"));
|
||||
exit (1);
|
||||
}
|
||||
machine = i;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* nlmconv.c -- NLM conversion program
|
||||
Copyright (C) 1993, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
|
@ -186,12 +186,25 @@ main (argc, argv)
|
|||
char inlead, outlead;
|
||||
boolean gotstart, gotexit, gotcheck;
|
||||
struct stat st;
|
||||
FILE *custom_data, *help_data, *message_data, *rpc_data, *shared_data;
|
||||
size_t custom_size, help_size, message_size, module_size, rpc_size;
|
||||
asection *custom_section, *help_section, *message_section, *module_section;
|
||||
asection *rpc_section, *shared_section;
|
||||
FILE *custom_data = NULL;
|
||||
FILE *help_data = NULL;
|
||||
FILE *message_data = NULL;
|
||||
FILE *rpc_data = NULL;
|
||||
FILE *shared_data = NULL;
|
||||
size_t custom_size = 0;
|
||||
size_t help_size = 0;
|
||||
size_t message_size = 0;
|
||||
size_t module_size = 0;
|
||||
size_t rpc_size = 0;
|
||||
asection *custom_section = NULL;
|
||||
asection *help_section = NULL;
|
||||
asection *message_section = NULL;
|
||||
asection *module_section = NULL;
|
||||
asection *rpc_section = NULL;
|
||||
asection *shared_section = NULL;
|
||||
bfd *sharedbfd;
|
||||
size_t shared_offset, shared_size;
|
||||
size_t shared_offset = 0;
|
||||
size_t shared_size = 0;
|
||||
Nlm_Internal_Fixed_Header sharedhdr;
|
||||
int len;
|
||||
char *modname;
|
||||
|
@ -253,7 +266,7 @@ main (argc, argv)
|
|||
if (strcmp (input_file, output_file) == 0)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"%s: input and output files must be different\n",
|
||||
_("%s: input and output files must be different\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -303,7 +316,7 @@ main (argc, argv)
|
|||
if (input_file != NULL)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"%s: input file named both on command line and with INPUT\n",
|
||||
_("%s: input file named both on command line and with INPUT\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -314,7 +327,7 @@ main (argc, argv)
|
|||
}
|
||||
else if (input_file == NULL)
|
||||
{
|
||||
fprintf (stderr, "%s: no input file\n", program_name);
|
||||
fprintf (stderr, _("%s: no input file\n"), program_name);
|
||||
show_usage (stderr, 1);
|
||||
}
|
||||
|
||||
|
@ -344,7 +357,7 @@ main (argc, argv)
|
|||
Otherwise use the file named in the OUTPUT statement. */
|
||||
if (output_file == NULL)
|
||||
{
|
||||
fprintf (stderr, "%s: no name for output file\n",
|
||||
fprintf (stderr, _("%s: no name for output file\n"),
|
||||
program_name);
|
||||
show_usage (stderr, 1);
|
||||
}
|
||||
|
@ -359,7 +372,7 @@ main (argc, argv)
|
|||
|
||||
if (bfd_arch_get_compatible (inbfd, outbfd) == NULL)
|
||||
fprintf (stderr,
|
||||
"%s: warning:input and output formats are not compatible\n",
|
||||
_("%s: warning:input and output formats are not compatible\n"),
|
||||
program_name);
|
||||
|
||||
/* Move the values read from the command file into outbfd. */
|
||||
|
@ -389,7 +402,7 @@ main (argc, argv)
|
|||
if (bss_sec == NULL
|
||||
|| ! bfd_set_section_flags (outbfd, bss_sec, SEC_ALLOC)
|
||||
|| ! bfd_set_section_alignment (outbfd, bss_sec, 1))
|
||||
bfd_fatal ("make .bss section");
|
||||
bfd_fatal (_("make .bss section"));
|
||||
}
|
||||
|
||||
/* We store the original section names in the .nlmsections section,
|
||||
|
@ -398,9 +411,9 @@ main (argc, argv)
|
|||
the NLM header area. */
|
||||
secsec = bfd_make_section (outbfd, ".nlmsections");
|
||||
if (secsec == NULL)
|
||||
bfd_fatal ("make .nlmsections section");
|
||||
bfd_fatal (_("make .nlmsections section"));
|
||||
if (! bfd_set_section_flags (outbfd, secsec, SEC_HAS_CONTENTS))
|
||||
bfd_fatal ("set .nlmsections flags");
|
||||
bfd_fatal (_("set .nlmsections flags"));
|
||||
|
||||
#ifdef NLMCONV_POWERPC
|
||||
/* For PowerPC NetWare we need to build stubs for calls to undefined
|
||||
|
@ -428,14 +441,14 @@ main (argc, argv)
|
|||
add = ((vma + align - 1) &~ (align - 1)) - vma;
|
||||
vma += add;
|
||||
if (! bfd_set_section_vma (outbfd, bss_sec, vma))
|
||||
bfd_fatal ("set .bss vma");
|
||||
bfd_fatal (_("set .bss vma"));
|
||||
if (add != 0)
|
||||
{
|
||||
bfd_size_type data_size;
|
||||
|
||||
data_size = bfd_get_section_size_before_reloc (data_sec);
|
||||
if (! bfd_set_section_size (outbfd, data_sec, data_size + add))
|
||||
bfd_fatal ("set .data size");
|
||||
bfd_fatal (_("set .data size"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -616,7 +629,7 @@ main (argc, argv)
|
|||
}
|
||||
if (l == NULL)
|
||||
fprintf (stderr,
|
||||
"%s: warning: symbol %s imported but not in import list\n",
|
||||
_("%s: warning: symbol %s imported but not in import list\n"),
|
||||
program_name, bfd_asymbol_name (sym));
|
||||
}
|
||||
|
||||
|
@ -636,7 +649,7 @@ main (argc, argv)
|
|||
&& text_sec != (asection *) NULL)
|
||||
val += bfd_section_size (outbfd, text_sec);
|
||||
if (! bfd_set_start_address (outbfd, val))
|
||||
bfd_fatal ("set start address");
|
||||
bfd_fatal (_("set start address"));
|
||||
gotstart = true;
|
||||
}
|
||||
if (strcmp (bfd_asymbol_name (sym), exit_procedure) == 0)
|
||||
|
@ -685,14 +698,14 @@ main (argc, argv)
|
|||
bfd_set_symtab (outbfd, outsyms, symcount + newsymcount);
|
||||
|
||||
if (! gotstart)
|
||||
fprintf (stderr, "%s: warning: START procedure %s not defined\n",
|
||||
fprintf (stderr, _("%s: warning: START procedure %s not defined\n"),
|
||||
program_name, start_procedure);
|
||||
if (! gotexit)
|
||||
fprintf (stderr, "%s: warning: EXIT procedure %s not defined\n",
|
||||
fprintf (stderr, _("%s: warning: EXIT procedure %s not defined\n"),
|
||||
program_name, exit_procedure);
|
||||
if (check_procedure != NULL
|
||||
&& ! gotcheck)
|
||||
fprintf (stderr, "%s: warning: CHECK procedure %s not defined\n",
|
||||
fprintf (stderr, _("%s: warning: CHECK procedure %s not defined\n"),
|
||||
program_name, check_procedure);
|
||||
|
||||
/* Add additional sections required for the header information. */
|
||||
|
@ -714,7 +727,7 @@ main (argc, argv)
|
|||
|| ! bfd_set_section_size (outbfd, custom_section, custom_size)
|
||||
|| ! bfd_set_section_flags (outbfd, custom_section,
|
||||
SEC_HAS_CONTENTS))
|
||||
bfd_fatal ("custom section");
|
||||
bfd_fatal (_("custom section"));
|
||||
}
|
||||
}
|
||||
if (help_file != NULL)
|
||||
|
@ -735,7 +748,7 @@ main (argc, argv)
|
|||
|| ! bfd_set_section_size (outbfd, help_section, help_size)
|
||||
|| ! bfd_set_section_flags (outbfd, help_section,
|
||||
SEC_HAS_CONTENTS))
|
||||
bfd_fatal ("help section");
|
||||
bfd_fatal (_("help section"));
|
||||
strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8);
|
||||
}
|
||||
}
|
||||
|
@ -757,7 +770,7 @@ main (argc, argv)
|
|||
|| ! bfd_set_section_size (outbfd, message_section, message_size)
|
||||
|| ! bfd_set_section_flags (outbfd, message_section,
|
||||
SEC_HAS_CONTENTS))
|
||||
bfd_fatal ("message section");
|
||||
bfd_fatal (_("message section"));
|
||||
strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8);
|
||||
}
|
||||
}
|
||||
|
@ -773,7 +786,7 @@ main (argc, argv)
|
|||
|| ! bfd_set_section_size (outbfd, module_section, module_size)
|
||||
|| ! bfd_set_section_flags (outbfd, module_section,
|
||||
SEC_HAS_CONTENTS))
|
||||
bfd_fatal ("module section");
|
||||
bfd_fatal (_("module section"));
|
||||
}
|
||||
if (rpc_file != NULL)
|
||||
{
|
||||
|
@ -793,7 +806,7 @@ main (argc, argv)
|
|||
|| ! bfd_set_section_size (outbfd, rpc_section, rpc_size)
|
||||
|| ! bfd_set_section_flags (outbfd, rpc_section,
|
||||
SEC_HAS_CONTENTS))
|
||||
bfd_fatal ("rpc section");
|
||||
bfd_fatal (_("rpc section"));
|
||||
strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8);
|
||||
}
|
||||
}
|
||||
|
@ -830,19 +843,19 @@ main (argc, argv)
|
|||
{
|
||||
/* There is no place to record this information. */
|
||||
fprintf (stderr,
|
||||
"%s:%s: warning: shared libraries can not have uninitialized data\n",
|
||||
_("%s:%s: warning: shared libraries can not have uninitialized data\n"),
|
||||
program_name, sharelib_file);
|
||||
}
|
||||
shared_offset = st.st_size;
|
||||
if (shared_offset > sharedhdr.codeImageOffset)
|
||||
if (shared_offset > (size_t) sharedhdr.codeImageOffset)
|
||||
shared_offset = sharedhdr.codeImageOffset;
|
||||
if (shared_offset > sharedhdr.dataImageOffset)
|
||||
if (shared_offset > (size_t) sharedhdr.dataImageOffset)
|
||||
shared_offset = sharedhdr.dataImageOffset;
|
||||
if (shared_offset > sharedhdr.relocationFixupOffset)
|
||||
if (shared_offset > (size_t) sharedhdr.relocationFixupOffset)
|
||||
shared_offset = sharedhdr.relocationFixupOffset;
|
||||
if (shared_offset > sharedhdr.externalReferencesOffset)
|
||||
if (shared_offset > (size_t) sharedhdr.externalReferencesOffset)
|
||||
shared_offset = sharedhdr.externalReferencesOffset;
|
||||
if (shared_offset > sharedhdr.publicsOffset)
|
||||
if (shared_offset > (size_t) sharedhdr.publicsOffset)
|
||||
shared_offset = sharedhdr.publicsOffset;
|
||||
shared_size = st.st_size - shared_offset;
|
||||
shared_section = bfd_make_section (outbfd, ".nlmshared");
|
||||
|
@ -851,7 +864,7 @@ main (argc, argv)
|
|||
shared_size)
|
||||
|| ! bfd_set_section_flags (outbfd, shared_section,
|
||||
SEC_HAS_CONTENTS))
|
||||
bfd_fatal ("shared section");
|
||||
bfd_fatal (_("shared section"));
|
||||
strncpy (nlm_extended_header (outbfd)->stamp, "MeSsAgEs", 8);
|
||||
}
|
||||
}
|
||||
|
@ -859,7 +872,7 @@ main (argc, argv)
|
|||
|
||||
/* Check whether a version was given. */
|
||||
if (strncmp (version_hdr->stamp, "VeRsIoN#", 8) != 0)
|
||||
fprintf (stderr, "%s: warning: No version number given\n",
|
||||
fprintf (stderr, _("%s: warning: No version number given\n"),
|
||||
program_name);
|
||||
|
||||
/* At least for now, always create an extended header, because that
|
||||
|
@ -900,13 +913,13 @@ main (argc, argv)
|
|||
|
||||
data = xmalloc (custom_size);
|
||||
if (fread (data, 1, custom_size, custom_data) != custom_size)
|
||||
fprintf (stderr, "%s:%s: read: %s\n", program_name, custom_file,
|
||||
fprintf (stderr, _("%s:%s: read: %s\n"), program_name, custom_file,
|
||||
strerror (errno));
|
||||
else
|
||||
{
|
||||
if (! bfd_set_section_contents (outbfd, custom_section, data,
|
||||
(file_ptr) 0, custom_size))
|
||||
bfd_fatal ("custom section");
|
||||
bfd_fatal (_("custom section"));
|
||||
nlm_fixed_header (outbfd)->customDataOffset =
|
||||
custom_section->filepos;
|
||||
nlm_fixed_header (outbfd)->customDataSize = custom_size;
|
||||
|
@ -924,7 +937,7 @@ main (argc, argv)
|
|||
}
|
||||
if (map_file != NULL)
|
||||
fprintf (stderr,
|
||||
"%s: warning: MAP and FULLMAP are not supported; try ld -M\n",
|
||||
_("%s: warning: MAP and FULLMAP are not supported; try ld -M\n"),
|
||||
program_name);
|
||||
if (help_file != NULL)
|
||||
{
|
||||
|
@ -932,13 +945,13 @@ main (argc, argv)
|
|||
|
||||
data = xmalloc (help_size);
|
||||
if (fread (data, 1, help_size, help_data) != help_size)
|
||||
fprintf (stderr, "%s:%s: read: %s\n", program_name, help_file,
|
||||
fprintf (stderr, _("%s:%s: read: %s\n"), program_name, help_file,
|
||||
strerror (errno));
|
||||
else
|
||||
{
|
||||
if (! bfd_set_section_contents (outbfd, help_section, data,
|
||||
(file_ptr) 0, help_size))
|
||||
bfd_fatal ("help section");
|
||||
bfd_fatal (_("help section"));
|
||||
nlm_extended_header (outbfd)->helpFileOffset =
|
||||
help_section->filepos;
|
||||
nlm_extended_header (outbfd)->helpFileLength = help_size;
|
||||
|
@ -951,13 +964,13 @@ main (argc, argv)
|
|||
|
||||
data = xmalloc (message_size);
|
||||
if (fread (data, 1, message_size, message_data) != message_size)
|
||||
fprintf (stderr, "%s:%s: read: %s\n", program_name, message_file,
|
||||
fprintf (stderr, _("%s:%s: read: %s\n"), program_name, message_file,
|
||||
strerror (errno));
|
||||
else
|
||||
{
|
||||
if (! bfd_set_section_contents (outbfd, message_section, data,
|
||||
(file_ptr) 0, message_size))
|
||||
bfd_fatal ("message section");
|
||||
bfd_fatal (_("message section"));
|
||||
nlm_extended_header (outbfd)->messageFileOffset =
|
||||
message_section->filepos;
|
||||
nlm_extended_header (outbfd)->messageFileLength = message_size;
|
||||
|
@ -990,7 +1003,7 @@ main (argc, argv)
|
|||
}
|
||||
if (! bfd_set_section_contents (outbfd, module_section, data,
|
||||
(file_ptr) 0, module_size))
|
||||
bfd_fatal ("module section");
|
||||
bfd_fatal (_("module section"));
|
||||
nlm_fixed_header (outbfd)->moduleDependencyOffset =
|
||||
module_section->filepos;
|
||||
nlm_fixed_header (outbfd)->numberOfModuleDependencies = c;
|
||||
|
@ -1001,13 +1014,13 @@ main (argc, argv)
|
|||
|
||||
data = xmalloc (rpc_size);
|
||||
if (fread (data, 1, rpc_size, rpc_data) != rpc_size)
|
||||
fprintf (stderr, "%s:%s: read: %s\n", program_name, rpc_file,
|
||||
fprintf (stderr, _("%s:%s: read: %s\n"), program_name, rpc_file,
|
||||
strerror (errno));
|
||||
else
|
||||
{
|
||||
if (! bfd_set_section_contents (outbfd, rpc_section, data,
|
||||
(file_ptr) 0, rpc_size))
|
||||
bfd_fatal ("rpc section");
|
||||
bfd_fatal (_("rpc section"));
|
||||
nlm_extended_header (outbfd)->RPCDataOffset =
|
||||
rpc_section->filepos;
|
||||
nlm_extended_header (outbfd)->RPCDataLength = rpc_size;
|
||||
|
@ -1021,13 +1034,13 @@ main (argc, argv)
|
|||
data = xmalloc (shared_size);
|
||||
if (fseek (shared_data, shared_offset, SEEK_SET) != 0
|
||||
|| fread (data, 1, shared_size, shared_data) != shared_size)
|
||||
fprintf (stderr, "%s:%s: read: %s\n", program_name, sharelib_file,
|
||||
fprintf (stderr, _("%s:%s: read: %s\n"), program_name, sharelib_file,
|
||||
strerror (errno));
|
||||
else
|
||||
{
|
||||
if (! bfd_set_section_contents (outbfd, shared_section, data,
|
||||
(file_ptr) 0, shared_size))
|
||||
bfd_fatal ("shared section");
|
||||
bfd_fatal (_("shared section"));
|
||||
}
|
||||
nlm_extended_header (outbfd)->sharedCodeOffset =
|
||||
sharedhdr.codeImageOffset - shared_offset + shared_section->filepos;
|
||||
|
@ -1074,7 +1087,7 @@ main (argc, argv)
|
|||
for (modname = nlm_fixed_header (outbfd)->moduleName;
|
||||
*modname != '\0';
|
||||
modname++)
|
||||
if (islower (*modname))
|
||||
if (islower ((unsigned char) *modname))
|
||||
*modname = toupper (*modname);
|
||||
|
||||
strncpy (nlm_variable_header (outbfd)->oldThreadName, " LONG",
|
||||
|
@ -1099,7 +1112,7 @@ main (argc, argv)
|
|||
static void
|
||||
show_help ()
|
||||
{
|
||||
printf ("%s: Convert an object file into a NetWare Loadable Module\n",
|
||||
printf (_("%s: Convert an object file into a NetWare Loadable Module\n"),
|
||||
program_name);
|
||||
show_usage (stdout, 0);
|
||||
}
|
||||
|
@ -1111,15 +1124,15 @@ show_usage (file, status)
|
|||
FILE *file;
|
||||
int status;
|
||||
{
|
||||
fprintf (file, "\
|
||||
fprintf (file, _("\
|
||||
Usage: %s [-dhV] [-I bfdname] [-O bfdname] [-T header-file] [-l linker]\n\
|
||||
[--input-target=bfdname] [--output-target=bfdname]\n\
|
||||
[--header-file=file] [--linker=linker] [--debug]\n\
|
||||
[--help] [--version]\n\
|
||||
[in-file [out-file]]\n",
|
||||
[in-file [out-file]]\n"),
|
||||
program_name);
|
||||
if (status == 0)
|
||||
fprintf (file, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
|
||||
fprintf (file, _("Report bugs to bug-gnu-utils@gnu.org\n"));
|
||||
exit (status);
|
||||
}
|
||||
|
||||
|
@ -1151,7 +1164,7 @@ select_output_format (arch, mach, bigendian)
|
|||
return "nlm32-powerpc";
|
||||
#endif
|
||||
default:
|
||||
fprintf (stderr, "%s: support not compiled in for %s\n",
|
||||
fprintf (stderr, _("%s: support not compiled in for %s\n"),
|
||||
program_name, bfd_printable_arch_mach (arch, mach));
|
||||
exit (1);
|
||||
/* Avoid warning. */
|
||||
|
@ -1194,7 +1207,7 @@ setup_sections (inbfd, insec, data_ptr)
|
|||
{
|
||||
outsec = bfd_make_section (outbfd, outname);
|
||||
if (outsec == NULL)
|
||||
bfd_fatal ("make section");
|
||||
bfd_fatal (_("make section"));
|
||||
}
|
||||
|
||||
insec->output_section = outsec;
|
||||
|
@ -1208,17 +1221,17 @@ setup_sections (inbfd, insec, data_ptr)
|
|||
(bfd_section_size (outbfd, outsec)
|
||||
+ bfd_section_size (inbfd, insec)
|
||||
+ add)))
|
||||
bfd_fatal ("set section size");
|
||||
bfd_fatal (_("set section size"));
|
||||
|
||||
if ((bfd_section_alignment (inbfd, insec)
|
||||
> bfd_section_alignment (outbfd, outsec))
|
||||
&& ! bfd_set_section_alignment (outbfd, outsec,
|
||||
bfd_section_alignment (inbfd, insec)))
|
||||
bfd_fatal ("set section alignment");
|
||||
bfd_fatal (_("set section alignment"));
|
||||
|
||||
if (! bfd_set_section_flags (outbfd, outsec,
|
||||
f | bfd_get_section_flags (outbfd, outsec)))
|
||||
bfd_fatal ("set section flags");
|
||||
bfd_fatal (_("set section flags"));
|
||||
|
||||
bfd_set_reloc (outbfd, outsec, (arelent **) NULL, 0);
|
||||
|
||||
|
@ -1229,7 +1242,7 @@ setup_sections (inbfd, insec, data_ptr)
|
|||
secsecsize = (secsecsize + 3) &~ 3;
|
||||
secsecsize += 8;
|
||||
if (! bfd_set_section_size (outbfd, secsec, secsecsize))
|
||||
bfd_fatal ("set .nlmsections size");
|
||||
bfd_fatal (_("set .nlmsections size"));
|
||||
}
|
||||
|
||||
/* Copy the section contents. */
|
||||
|
@ -1317,7 +1330,7 @@ copy_sections (inbfd, insec, data_ptr)
|
|||
/* Add this section to .nlmsections. */
|
||||
if (! bfd_set_section_contents (outbfd, secsec, (PTR) inname, secsecoff,
|
||||
strlen (inname) + 1))
|
||||
bfd_fatal ("set .nlmsection contents");
|
||||
bfd_fatal (_("set .nlmsection contents"));
|
||||
secsecoff += strlen (inname) + 1;
|
||||
|
||||
add = ((secsecoff + 3) &~ 3) - secsecoff;
|
||||
|
@ -1325,7 +1338,7 @@ copy_sections (inbfd, insec, data_ptr)
|
|||
{
|
||||
bfd_h_put_32 (outbfd, (bfd_vma) 0, buf);
|
||||
if (! bfd_set_section_contents (outbfd, secsec, buf, secsecoff, add))
|
||||
bfd_fatal ("set .nlmsection contents");
|
||||
bfd_fatal (_("set .nlmsection contents"));
|
||||
secsecoff += add;
|
||||
}
|
||||
|
||||
|
@ -1334,12 +1347,12 @@ copy_sections (inbfd, insec, data_ptr)
|
|||
else
|
||||
bfd_h_put_32 (outbfd, (bfd_vma) 0, buf);
|
||||
if (! bfd_set_section_contents (outbfd, secsec, buf, secsecoff, 4))
|
||||
bfd_fatal ("set .nlmsection contents");
|
||||
bfd_fatal (_("set .nlmsection contents"));
|
||||
secsecoff += 4;
|
||||
|
||||
bfd_h_put_32 (outbfd, (bfd_vma) size, buf);
|
||||
if (! bfd_set_section_contents (outbfd, secsec, buf, secsecoff, 4))
|
||||
bfd_fatal ("set .nlmsection contents");
|
||||
bfd_fatal (_("set .nlmsection contents"));
|
||||
secsecoff += 4;
|
||||
}
|
||||
|
||||
|
@ -1663,7 +1676,7 @@ alpha_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents,
|
|||
{
|
||||
register bfd_size_type i;
|
||||
|
||||
for (i = 0; i < old_reloc_count; i++, relocs++)
|
||||
for (i = 0; i < (bfd_size_type) old_reloc_count; i++, relocs++)
|
||||
(*relocs)->address += insec->output_offset;
|
||||
}
|
||||
}
|
||||
|
@ -1842,7 +1855,7 @@ powerpc_build_stubs (inbfd, outbfd, symbols_ptr, symcount_ptr)
|
|||
(got_base
|
||||
+ (stubcount
|
||||
* POWERPC_STUB_TOC_ENTRY_SIZE))))
|
||||
bfd_fatal ("stub section sizes");
|
||||
bfd_fatal (_("stub section sizes"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1891,7 +1904,7 @@ powerpc_resolve_stubs (inbfd, outbfd)
|
|||
buf,
|
||||
l->start->value,
|
||||
POWERPC_STUB_SIZE))
|
||||
bfd_fatal ("writing stub");
|
||||
bfd_fatal (_("writing stub"));
|
||||
|
||||
/* Create a new reloc for the TOC entry. */
|
||||
reloc = (arelent *) xmalloc (sizeof (arelent));
|
||||
|
@ -1981,7 +1994,7 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents,
|
|||
between two sections both of which were placed in the
|
||||
same output section. This should not happen. */
|
||||
if (bfd_get_section (sym) != insec->output_section)
|
||||
fprintf (stderr, "%s: unresolved PC relative reloc against %s\n",
|
||||
fprintf (stderr, _("%s: unresolved PC relative reloc against %s\n"),
|
||||
program_name, bfd_asymbol_name (sym));
|
||||
else
|
||||
{
|
||||
|
@ -2046,7 +2059,7 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents,
|
|||
if ((bfd_signed_vma) val < - 0x8000
|
||||
|| (bfd_signed_vma) val >= 0x8000)
|
||||
fprintf (stderr,
|
||||
"%s: overflow when adjusting relocation against %s\n",
|
||||
_("%s: overflow when adjusting relocation against %s\n"),
|
||||
program_name, bfd_asymbol_name (sym));
|
||||
bfd_put_16 (outbfd, val, (bfd_byte *) contents + rel->address);
|
||||
break;
|
||||
|
@ -2169,7 +2182,7 @@ link_inputs (inputs, ld)
|
|||
PEXECUTE_SEARCH | PEXECUTE_ONE);
|
||||
if (pid == -1)
|
||||
{
|
||||
fprintf (stderr, "%s: execution of %s failed: ", program_name, ld);
|
||||
fprintf (stderr, _("%s: execution of %s failed: "), program_name, ld);
|
||||
fprintf (stderr, errfmt, errarg);
|
||||
unlink (unlink_on_exit);
|
||||
exit (1);
|
||||
|
@ -2184,7 +2197,7 @@ link_inputs (inputs, ld)
|
|||
|
||||
if (status != 0)
|
||||
{
|
||||
fprintf (stderr, "%s: Execution of %s failed\n", program_name, ld);
|
||||
fprintf (stderr, _("%s: Execution of %s failed\n"), program_name, ld);
|
||||
unlink (unlink_on_exit);
|
||||
exit (1);
|
||||
}
|
||||
|
|
283
binutils/nm.c
283
binutils/nm.c
|
@ -1,5 +1,5 @@
|
|||
/* nm.c -- Describe symbol table of a rel file.
|
||||
Copyright 1991, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
|
@ -35,6 +35,29 @@ struct size_sym
|
|||
bfd_vma size;
|
||||
};
|
||||
|
||||
/* When fetching relocs, we use this structure to pass information to
|
||||
get_relocs. */
|
||||
|
||||
struct get_relocs_info
|
||||
{
|
||||
asection **secs;
|
||||
arelent ***relocs;
|
||||
long *relcount;
|
||||
asymbol **syms;
|
||||
};
|
||||
|
||||
static void
|
||||
usage PARAMS ((FILE *, int));
|
||||
|
||||
static void
|
||||
set_print_radix PARAMS ((char *));
|
||||
|
||||
static void
|
||||
set_output_format PARAMS ((char *));
|
||||
|
||||
static void
|
||||
display_archive PARAMS ((bfd *));
|
||||
|
||||
static boolean
|
||||
display_file PARAMS ((char *filename));
|
||||
|
||||
|
@ -54,6 +77,9 @@ print_symbols PARAMS ((bfd *, boolean, PTR, long, unsigned int, bfd *));
|
|||
static void
|
||||
print_size_symbols PARAMS ((bfd *, boolean, struct size_sym *, long, bfd *));
|
||||
|
||||
static void
|
||||
print_symname PARAMS ((const char *, const char *, bfd *));
|
||||
|
||||
static void
|
||||
print_symbol PARAMS ((bfd *, asymbol *, bfd *));
|
||||
|
||||
|
@ -134,6 +160,8 @@ print_symbol_info_sysv PARAMS ((symbol_info * info, bfd * abfd));
|
|||
static void
|
||||
print_symbol_info_posix PARAMS ((symbol_info * info, bfd * abfd));
|
||||
|
||||
static void
|
||||
get_relocs PARAMS ((bfd *, asection *, PTR));
|
||||
|
||||
/* Support for different output formats. */
|
||||
struct output_fns
|
||||
|
@ -187,6 +215,7 @@ static struct output_fns *format = &formats[FORMAT_DEFAULT];
|
|||
|
||||
static int do_demangle = 0; /* Pretty print C++ symbol names. */
|
||||
static int external_only = 0; /* print external symbols only */
|
||||
static int defined_only = 0; /* Print defined symbols only */
|
||||
static int no_sort = 0; /* don't sort; print syms in order found */
|
||||
static int print_debug_syms = 0; /* print debugger-only symbols too */
|
||||
static int print_armap = 0; /* describe __.SYMDEF data in archive files. */
|
||||
|
@ -197,6 +226,7 @@ static int undefined_only = 0; /* print undefined symbols only */
|
|||
static int dynamic = 0; /* print dynamic symbols. */
|
||||
static int show_version = 0; /* show the version number */
|
||||
static int show_stats = 0; /* show statistics */
|
||||
static int line_numbers = 0; /* print line numbers for symbols */
|
||||
|
||||
/* When to print the names of files. Not mutually exclusive in SYSV format. */
|
||||
static int filename_per_file = 0; /* Once per file, on its own line. */
|
||||
|
@ -217,11 +247,11 @@ static int print_radix = 16;
|
|||
static char other_format[] = "%02x";
|
||||
static char desc_format[] = "%04x";
|
||||
|
||||
/* IMPORT */
|
||||
extern char *program_name;
|
||||
extern char *program_version;
|
||||
extern char *target;
|
||||
extern int print_version;
|
||||
static char *target = NULL;
|
||||
|
||||
/* Used to cache the line numbers for a BFD. */
|
||||
static bfd *lineno_cache_bfd;
|
||||
static bfd *lineno_cache_rel_bfd;
|
||||
|
||||
static struct option long_options[] =
|
||||
{
|
||||
|
@ -231,6 +261,7 @@ static struct option long_options[] =
|
|||
{"extern-only", no_argument, &external_only, 1},
|
||||
{"format", required_argument, 0, 'f'},
|
||||
{"help", no_argument, 0, 'h'},
|
||||
{"line-numbers", no_argument, 0, 'l'},
|
||||
{"no-cplus", no_argument, &do_demangle, 0}, /* Linux compatibility. */
|
||||
{"no-demangle", no_argument, &do_demangle, 0},
|
||||
{"no-sort", no_argument, &no_sort, 1},
|
||||
|
@ -243,6 +274,7 @@ static struct option long_options[] =
|
|||
{"size-sort", no_argument, &sort_by_size, 1},
|
||||
{"stats", no_argument, &show_stats, 1},
|
||||
{"target", required_argument, 0, 200},
|
||||
{"defined-only", no_argument, &defined_only, 1},
|
||||
{"undefined-only", no_argument, &undefined_only, 1},
|
||||
{"version", no_argument, &show_version, 1},
|
||||
{0, no_argument, 0, 0}
|
||||
|
@ -250,27 +282,30 @@ static struct option long_options[] =
|
|||
|
||||
/* Some error-reporting functions */
|
||||
|
||||
void
|
||||
static void
|
||||
usage (stream, status)
|
||||
FILE *stream;
|
||||
int status;
|
||||
{
|
||||
fprintf (stream, "\
|
||||
Usage: %s [-aABCDgnopPrsuvV] [-t radix] [--radix=radix] [--target=bfdname]\n\
|
||||
fprintf (stream, _("\
|
||||
Usage: %s [-aABCDglnopPrsuvV] [-t radix] [--radix=radix] [--target=bfdname]\n\
|
||||
[--debug-syms] [--extern-only] [--print-armap] [--print-file-name]\n\
|
||||
[--numeric-sort] [--no-sort] [--reverse-sort] [--size-sort]\n\
|
||||
[--undefined-only] [--portability] [-f {bsd,sysv,posix}]\n\
|
||||
[--format={bsd,sysv,posix}] [--demangle] [--no-demangle] [--dynamic]\n\
|
||||
[--defined-only] [--line-numbers]\n\
|
||||
[--version] [--help]\n\
|
||||
[file...]\n",
|
||||
[file...]\n"),
|
||||
program_name);
|
||||
list_supported_targets (program_name, stream);
|
||||
if (status == 0)
|
||||
fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
|
||||
exit (status);
|
||||
}
|
||||
|
||||
/* Set the radix for the symbol value and size according to RADIX. */
|
||||
|
||||
void
|
||||
static void
|
||||
set_print_radix (radix)
|
||||
char *radix;
|
||||
{
|
||||
|
@ -297,12 +332,12 @@ set_print_radix (radix)
|
|||
other_format[3] = desc_format[3] = *radix;
|
||||
break;
|
||||
default:
|
||||
fprintf (stderr, "%s: %s: invalid radix\n", program_name, radix);
|
||||
fprintf (stderr, _("%s: %s: invalid radix\n"), program_name, radix);
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
set_output_format (f)
|
||||
char *f;
|
||||
{
|
||||
|
@ -323,7 +358,7 @@ set_output_format (f)
|
|||
i = FORMAT_SYSV;
|
||||
break;
|
||||
default:
|
||||
fprintf (stderr, "%s: %s: invalid output format\n", program_name, f);
|
||||
fprintf (stderr, _("%s: %s: invalid output format\n"), program_name, f);
|
||||
exit (1);
|
||||
}
|
||||
format = &formats[i];
|
||||
|
@ -343,8 +378,9 @@ main (argc, argv)
|
|||
START_PROGRESS (program_name, 0);
|
||||
|
||||
bfd_init ();
|
||||
set_default_bfd_target ();
|
||||
|
||||
while ((c = getopt_long (argc, argv, "aABCDef:gnopPrst:uvV", long_options, (int *) 0)) != EOF)
|
||||
while ((c = getopt_long (argc, argv, "aABCDef:glnopPrst:uvV", long_options, (int *) 0)) != EOF)
|
||||
{
|
||||
switch (c)
|
||||
{
|
||||
|
@ -375,6 +411,9 @@ main (argc, argv)
|
|||
break;
|
||||
case 'h':
|
||||
usage (stdout, 0);
|
||||
case 'l':
|
||||
line_numbers = 1;
|
||||
break;
|
||||
case 'n':
|
||||
case 'v':
|
||||
sort_numerically = 1;
|
||||
|
@ -414,10 +453,7 @@ main (argc, argv)
|
|||
}
|
||||
|
||||
if (show_version)
|
||||
{
|
||||
printf ("GNU %s version %s\n", program_name, program_version);
|
||||
exit (0);
|
||||
}
|
||||
print_version ("nm");
|
||||
|
||||
/* OK, all options now parsed. If no filename specified, do a.out. */
|
||||
if (optind == argc)
|
||||
|
@ -444,7 +480,7 @@ main (argc, argv)
|
|||
extern char **environ;
|
||||
char *lim = (char *) sbrk (0);
|
||||
|
||||
fprintf (stderr, "%s: data size %ld\n", program_name,
|
||||
fprintf (stderr, _("%s: data size %ld\n"), program_name,
|
||||
(long) (lim - (char *) &environ));
|
||||
}
|
||||
#endif
|
||||
|
@ -496,12 +532,20 @@ display_archive (file)
|
|||
}
|
||||
|
||||
if (last_arfile != NULL)
|
||||
bfd_close (last_arfile);
|
||||
{
|
||||
bfd_close (last_arfile);
|
||||
lineno_cache_bfd = NULL;
|
||||
lineno_cache_rel_bfd = NULL;
|
||||
}
|
||||
last_arfile = arfile;
|
||||
}
|
||||
|
||||
if (last_arfile != NULL)
|
||||
bfd_close (last_arfile);
|
||||
{
|
||||
bfd_close (last_arfile);
|
||||
lineno_cache_bfd = NULL;
|
||||
lineno_cache_rel_bfd = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static boolean
|
||||
|
@ -542,6 +586,9 @@ display_file (filename)
|
|||
if (bfd_close (file) == false)
|
||||
bfd_fatal (filename);
|
||||
|
||||
lineno_cache_bfd = NULL;
|
||||
lineno_cache_rel_bfd = NULL;
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -745,7 +792,7 @@ sort_symbols_by_size (abfd, dynamic, minisyms, symcount, size, symsizesp)
|
|||
{
|
||||
struct size_sym *symsizes;
|
||||
bfd_byte *from, *fromend;
|
||||
asymbol *sym;
|
||||
asymbol *sym = NULL;
|
||||
asymbol *store_sym, *store_next;
|
||||
|
||||
qsort (minisyms, symcount, size, size_forward1);
|
||||
|
@ -789,6 +836,8 @@ sort_symbols_by_size (abfd, dynamic, minisyms, symcount, size, symsizesp)
|
|||
if (next == NULL)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
}
|
||||
else
|
||||
next = NULL;
|
||||
|
||||
sec = bfd_get_section (sym);
|
||||
|
||||
|
@ -843,7 +892,7 @@ display_rel_file (abfd, archive_bfd)
|
|||
{
|
||||
if (!(bfd_get_file_flags (abfd) & HAS_SYMS))
|
||||
{
|
||||
printf ("No symbols in \"%s\".\n", bfd_get_filename (abfd));
|
||||
printf (_("No symbols in \"%s\".\n"), bfd_get_filename (abfd));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -854,7 +903,7 @@ display_rel_file (abfd, archive_bfd)
|
|||
|
||||
if (symcount == 0)
|
||||
{
|
||||
fprintf (stderr, "%s: no symbols\n", bfd_get_filename (abfd));
|
||||
fprintf (stderr, _("%s: no symbols\n"), bfd_get_filename (abfd));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -928,6 +977,7 @@ filter_symbols (abfd, dynamic, minisyms, symcount, size)
|
|||
keep = bfd_is_und_section (sym->section);
|
||||
else if (external_only)
|
||||
keep = ((sym->flags & BSF_GLOBAL) != 0
|
||||
|| (sym->flags & BSF_WEAK) != 0
|
||||
|| bfd_is_und_section (sym->section)
|
||||
|| bfd_is_com_section (sym->section));
|
||||
else
|
||||
|
@ -944,6 +994,13 @@ filter_symbols (abfd, dynamic, minisyms, symcount, size)
|
|||
|| bfd_is_und_section (sym->section)))
|
||||
keep = 0;
|
||||
|
||||
if (keep
|
||||
&& defined_only)
|
||||
{
|
||||
if (bfd_is_und_section (sym->section))
|
||||
keep = 0;
|
||||
}
|
||||
|
||||
if (keep)
|
||||
{
|
||||
memcpy (to, from, size);
|
||||
|
@ -959,7 +1016,8 @@ filter_symbols (abfd, dynamic, minisyms, symcount, size)
|
|||
|
||||
static void
|
||||
print_symname (format, name, abfd)
|
||||
char *format, *name;
|
||||
const char *format;
|
||||
const char *name;
|
||||
bfd *abfd;
|
||||
{
|
||||
if (do_demangle && *name)
|
||||
|
@ -1067,7 +1125,7 @@ print_symbol (abfd, sym, archive_bfd)
|
|||
if (undefined_only)
|
||||
{
|
||||
if (bfd_is_und_section (bfd_get_section (sym)))
|
||||
print_symname ("%s\n", bfd_asymbol_name (sym), abfd);
|
||||
print_symname ("%s", bfd_asymbol_name (sym), abfd);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1075,8 +1133,121 @@ print_symbol (abfd, sym, archive_bfd)
|
|||
|
||||
bfd_get_symbol_info (abfd, sym, &syminfo);
|
||||
(*format->print_symbol_info) (&syminfo, abfd);
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
if (line_numbers)
|
||||
{
|
||||
static asymbol **syms;
|
||||
static long symcount;
|
||||
const char *filename, *functionname;
|
||||
unsigned int lineno;
|
||||
|
||||
/* We need to get the canonical symbols in order to call
|
||||
bfd_find_nearest_line. This is inefficient, but, then, you
|
||||
don't have to use --line-numbers. */
|
||||
if (abfd != lineno_cache_bfd && syms != NULL)
|
||||
{
|
||||
free (syms);
|
||||
syms = NULL;
|
||||
}
|
||||
if (syms == NULL)
|
||||
{
|
||||
long symsize;
|
||||
|
||||
symsize = bfd_get_symtab_upper_bound (abfd);
|
||||
if (symsize < 0)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
syms = (asymbol **) xmalloc (symsize);
|
||||
symcount = bfd_canonicalize_symtab (abfd, syms);
|
||||
if (symcount < 0)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
lineno_cache_bfd = abfd;
|
||||
}
|
||||
|
||||
if (bfd_is_und_section (bfd_get_section (sym)))
|
||||
{
|
||||
static asection **secs;
|
||||
static arelent ***relocs;
|
||||
static long *relcount;
|
||||
static unsigned int seccount;
|
||||
unsigned int i;
|
||||
const char *symname;
|
||||
|
||||
/* For an undefined symbol, we try to find a reloc for the
|
||||
symbol, and print the line number of the reloc. */
|
||||
|
||||
if (abfd != lineno_cache_rel_bfd && relocs != NULL)
|
||||
{
|
||||
for (i = 0; i < seccount; i++)
|
||||
if (relocs[i] != NULL)
|
||||
free (relocs[i]);
|
||||
free (secs);
|
||||
free (relocs);
|
||||
free (relcount);
|
||||
secs = NULL;
|
||||
relocs = NULL;
|
||||
relcount = NULL;
|
||||
}
|
||||
|
||||
if (relocs == NULL)
|
||||
{
|
||||
struct get_relocs_info info;
|
||||
|
||||
seccount = bfd_count_sections (abfd);
|
||||
|
||||
secs = (asection **) xmalloc (seccount * sizeof *secs);
|
||||
relocs = (arelent ***) xmalloc (seccount * sizeof *relocs);
|
||||
relcount = (long *) xmalloc (seccount * sizeof *relcount);
|
||||
|
||||
info.secs = secs;
|
||||
info.relocs = relocs;
|
||||
info.relcount = relcount;
|
||||
info.syms = syms;
|
||||
bfd_map_over_sections (abfd, get_relocs, (PTR) &info);
|
||||
lineno_cache_rel_bfd = abfd;
|
||||
}
|
||||
|
||||
symname = bfd_asymbol_name (sym);
|
||||
for (i = 0; i < seccount; i++)
|
||||
{
|
||||
long j;
|
||||
|
||||
for (j = 0; j < relcount[i]; j++)
|
||||
{
|
||||
arelent *r;
|
||||
|
||||
r = relocs[i][j];
|
||||
if (r->sym_ptr_ptr != NULL
|
||||
&& (*r->sym_ptr_ptr)->section == sym->section
|
||||
&& (*r->sym_ptr_ptr)->value == sym->value
|
||||
&& strcmp (symname,
|
||||
bfd_asymbol_name (*r->sym_ptr_ptr)) == 0
|
||||
&& bfd_find_nearest_line (abfd, secs[i], syms,
|
||||
r->address, &filename,
|
||||
&functionname, &lineno))
|
||||
{
|
||||
/* We only print the first one we find. */
|
||||
printf ("\t%s:%u", filename, lineno);
|
||||
i = seccount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (bfd_get_section (sym)->owner == abfd)
|
||||
{
|
||||
if (bfd_find_nearest_line (abfd, bfd_get_section (sym), syms,
|
||||
sym->value, &filename, &functionname,
|
||||
&lineno)
|
||||
&& filename != NULL
|
||||
&& lineno != 0)
|
||||
{
|
||||
printf ("\t%s:%u", filename, lineno);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
putchar ('\n');
|
||||
}
|
||||
|
||||
/* The following 3 groups of functions are called unconditionally,
|
||||
|
@ -1100,11 +1271,11 @@ print_object_filename_sysv (filename)
|
|||
char *filename;
|
||||
{
|
||||
if (undefined_only)
|
||||
printf ("\n\nUndefined symbols from %s:\n\n", filename);
|
||||
printf (_("\n\nUndefined symbols from %s:\n\n"), filename);
|
||||
else
|
||||
printf ("\n\nSymbols from %s:\n\n", filename);
|
||||
printf ("\
|
||||
Name Value Class Type Size Line Section\n\n");
|
||||
printf (_("\n\nSymbols from %s:\n\n"), filename);
|
||||
printf (_("\
|
||||
Name Value Class Type Size Line Section\n\n"));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1154,11 +1325,11 @@ print_archive_member_sysv (archive, filename)
|
|||
CONST char *filename;
|
||||
{
|
||||
if (undefined_only)
|
||||
printf ("\n\nUndefined symbols from %s[%s]:\n\n", archive, filename);
|
||||
printf (_("\n\nUndefined symbols from %s[%s]:\n\n"), archive, filename);
|
||||
else
|
||||
printf ("\n\nSymbols from %s[%s]:\n\n", archive, filename);
|
||||
printf ("\
|
||||
Name Value Class Type Size Line Section\n\n");
|
||||
printf (_("\n\nSymbols from %s[%s]:\n\n"), archive, filename);
|
||||
printf (_("\
|
||||
Name Value Class Type Size Line Section\n\n"));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1327,7 +1498,7 @@ print_symdef_entry (abfd)
|
|||
bfd *elt;
|
||||
if (!everprinted)
|
||||
{
|
||||
printf ("\nArchive index:\n");
|
||||
printf (_("\nArchive index:\n"));
|
||||
everprinted = true;
|
||||
}
|
||||
elt = bfd_get_elt_at_index (abfd, idx);
|
||||
|
@ -1340,3 +1511,41 @@ print_symdef_entry (abfd)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* This function is used to get the relocs for a particular section.
|
||||
It is called via bfd_map_over_sections. */
|
||||
|
||||
static void
|
||||
get_relocs (abfd, sec, dataarg)
|
||||
bfd *abfd;
|
||||
asection *sec;
|
||||
PTR dataarg;
|
||||
{
|
||||
struct get_relocs_info *data = (struct get_relocs_info *) dataarg;
|
||||
|
||||
*data->secs = sec;
|
||||
|
||||
if ((sec->flags & SEC_RELOC) == 0)
|
||||
{
|
||||
*data->relocs = NULL;
|
||||
*data->relcount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
long relsize;
|
||||
|
||||
relsize = bfd_get_reloc_upper_bound (abfd, sec);
|
||||
if (relsize < 0)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
|
||||
*data->relocs = (arelent **) xmalloc (relsize);
|
||||
*data->relcount = bfd_canonicalize_reloc (abfd, sec, *data->relocs,
|
||||
data->syms);
|
||||
if (*data->relcount < 0)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
}
|
||||
|
||||
++data->secs;
|
||||
++data->relocs;
|
||||
++data->relcount;
|
||||
}
|
||||
|
|
|
@ -291,14 +291,14 @@ copy_usage (stream, exit_status)
|
|||
FILE *stream;
|
||||
int exit_status;
|
||||
{
|
||||
fprintf (stream, "\
|
||||
fprintf (stream, _("\
|
||||
Usage: %s [-vVSpgxX] [-I bfdname] [-O bfdname] [-F bfdname] [-b byte]\n\
|
||||
[-R section] [-i interleave] [--interleave=interleave] [--byte=byte]\n\
|
||||
[--input-target=bfdname] [--output-target=bfdname] [--target=bfdname]\n\
|
||||
[--strip-all] [--strip-debug] [--strip-unneeded] [--discard-all]\n\
|
||||
[--discard-locals] [--debugging] [--remove-section=section]\n",
|
||||
[--discard-locals] [--debugging] [--remove-section=section]\n"),
|
||||
program_name);
|
||||
fprintf (stream, "\
|
||||
fprintf (stream, _("\
|
||||
[--gap-fill=val] [--pad-to=address] [--preserve-dates]\n\
|
||||
[--set-start=val] [--adjust-start=incr]\n\
|
||||
[--adjust-vma=incr] [--adjust-section-vma=section{=,+,-}val]\n\
|
||||
|
@ -307,10 +307,10 @@ Usage: %s [-vVSpgxX] [-I bfdname] [-O bfdname] [-F bfdname] [-b byte]\n\
|
|||
[--keep-symbol symbol] [-K symbol] [--strip-symbol symbol] [-N symbol]\n\
|
||||
[--localize-symbol symbol] [-L symbol] [--weaken-symbol symbol]\n\
|
||||
[-W symbol] [--change-leading-char] [--remove-leading-char] [--weaken]\n\
|
||||
[--verbose] [--version] [--help] in-file [out-file]\n");
|
||||
[--verbose] [--version] [--help] in-file [out-file]\n"));
|
||||
list_supported_targets (program_name, stream);
|
||||
if (exit_status == 0)
|
||||
fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
|
||||
fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
|
||||
exit (exit_status);
|
||||
}
|
||||
|
||||
|
@ -319,17 +319,17 @@ strip_usage (stream, exit_status)
|
|||
FILE *stream;
|
||||
int exit_status;
|
||||
{
|
||||
fprintf (stream, "\
|
||||
fprintf (stream, _("\
|
||||
Usage: %s [-vVsSpgxX] [-I bfdname] [-O bfdname] [-F bfdname] [-R section]\n\
|
||||
[--input-target=bfdname] [--output-target=bfdname] [--target=bfdname]\n\
|
||||
[--strip-all] [--strip-debug] [--strip-unneeded] [--discard-all]\n\
|
||||
[--discard-locals] [--keep-symbol symbol] [-K symbol]\n\
|
||||
[--strip-symbol symbol] [-N symbol] [--remove-section=section]\n\
|
||||
[-o file] [--preserve-dates] [--verbose] [--version] [--help] file...\n",
|
||||
[-o file] [--preserve-dates] [--verbose] [--version] [--help] file...\n"),
|
||||
program_name);
|
||||
list_supported_targets (program_name, stream);
|
||||
if (exit_status == 0)
|
||||
fprintf (stream, "Report bugs to bug-gnu-utils@gnu.org\n");
|
||||
fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
|
||||
exit (exit_status);
|
||||
}
|
||||
|
||||
|
@ -375,10 +375,10 @@ parse_flags (s)
|
|||
copy = xmalloc (len + 1);
|
||||
strncpy (copy, s, len);
|
||||
copy[len] = '\0';
|
||||
fprintf (stderr, "%s: unrecognized section flag `%s'\n",
|
||||
fprintf (stderr, _("%s: unrecognized section flag `%s'\n"),
|
||||
program_name, copy);
|
||||
fprintf (stderr,
|
||||
"%s: supported flags: alloc, load, readonly, code, data, rom, contents\n",
|
||||
_("%s: supported flags: alloc, load, readonly, code, data, rom, contents\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ copy_object (ibfd, obfd)
|
|||
}
|
||||
|
||||
if (verbose)
|
||||
printf ("copy from %s(%s) to %s(%s)\n",
|
||||
printf (_("copy from %s(%s) to %s(%s)\n"),
|
||||
bfd_get_filename(ibfd), bfd_get_target(ibfd),
|
||||
bfd_get_filename(obfd), bfd_get_target(obfd));
|
||||
|
||||
|
@ -631,7 +631,7 @@ copy_object (ibfd, obfd)
|
|||
bfd_get_mach (ibfd)))
|
||||
{
|
||||
fprintf (stderr,
|
||||
"Warning: Output file cannot represent architecture %s\n",
|
||||
_("Warning: Output file cannot represent architecture %s\n"),
|
||||
bfd_printable_arch_mach (bfd_get_arch (ibfd),
|
||||
bfd_get_mach (ibfd)));
|
||||
}
|
||||
|
@ -659,7 +659,7 @@ copy_object (ibfd, obfd)
|
|||
padd->section = bfd_make_section (obfd, padd->name);
|
||||
if (padd->section == NULL)
|
||||
{
|
||||
fprintf (stderr, "%s: can't create section `%s': %s\n",
|
||||
fprintf (stderr, _("%s: can't create section `%s': %s\n"),
|
||||
program_name, padd->name,
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
status = 1;
|
||||
|
@ -736,7 +736,7 @@ copy_object (ibfd, obfd)
|
|||
if (! bfd_set_section_size (obfd, osections[i],
|
||||
size + (gap_stop - gap_start)))
|
||||
{
|
||||
fprintf (stderr, "%s: Can't fill gap after %s: %s\n",
|
||||
fprintf (stderr, _("%s: Can't fill gap after %s: %s\n"),
|
||||
program_name,
|
||||
bfd_get_section_name (obfd, osections[i]),
|
||||
bfd_errmsg (bfd_get_error()));
|
||||
|
@ -762,7 +762,7 @@ copy_object (ibfd, obfd)
|
|||
if (! bfd_set_section_size (obfd, osections[c - 1],
|
||||
pad_to - lma))
|
||||
{
|
||||
fprintf (stderr, "%s: Can't add padding to %s: %s\n",
|
||||
fprintf (stderr, _("%s: Can't add padding to %s: %s\n"),
|
||||
program_name,
|
||||
bfd_get_section_name (obfd, osections[c - 1]),
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
|
@ -911,7 +911,7 @@ copy_object (ibfd, obfd)
|
|||
important for the ECOFF code at least. */
|
||||
if (!bfd_copy_private_bfd_data (ibfd, obfd))
|
||||
{
|
||||
fprintf (stderr, "%s: %s: error copying private BFD data: %s\n",
|
||||
fprintf (stderr, _("%s: %s: error copying private BFD data: %s\n"),
|
||||
program_name, bfd_get_filename (obfd),
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
status = 1;
|
||||
|
@ -945,7 +945,7 @@ copy_archive (ibfd, obfd, output_target)
|
|||
if (mkdir (dir, 0700) != 0)
|
||||
#endif
|
||||
{
|
||||
fatal ("cannot mkdir %s for archive copying (error: %s)",
|
||||
fatal (_("cannot mkdir %s for archive copying (error: %s)"),
|
||||
dir, strerror (errno));
|
||||
}
|
||||
obfd->has_armap = ibfd->has_armap;
|
||||
|
@ -1198,7 +1198,7 @@ setup_section (ibfd, isection, obfdarg)
|
|||
return;
|
||||
|
||||
loser:
|
||||
fprintf (stderr, "%s: %s: section `%s': error in %s: %s\n",
|
||||
fprintf (stderr, _("%s: %s: section `%s': error in %s: %s\n"),
|
||||
program_name,
|
||||
bfd_get_filename (ibfd), bfd_section_name (ibfd, isection),
|
||||
err, bfd_errmsg (bfd_get_error ()));
|
||||
|
@ -1461,7 +1461,7 @@ write_debugging_info (obfd, dhandle, symcountp, symppp)
|
|||
| SEC_READONLY
|
||||
| SEC_DEBUGGING)))
|
||||
{
|
||||
fprintf (stderr, "%s: can't create debugging section: %s\n",
|
||||
fprintf (stderr, _("%s: can't create debugging section: %s\n"),
|
||||
bfd_get_filename (obfd), bfd_errmsg (bfd_get_error ()));
|
||||
return false;
|
||||
}
|
||||
|
@ -1475,7 +1475,7 @@ write_debugging_info (obfd, dhandle, symcountp, symppp)
|
|||
|| ! bfd_set_section_contents (obfd, stabstrsec, strings,
|
||||
(file_ptr) 0, stringsize))
|
||||
{
|
||||
fprintf (stderr, "%s: can't set debugging section contents: %s\n",
|
||||
fprintf (stderr, _("%s: can't set debugging section contents: %s\n"),
|
||||
bfd_get_filename (obfd), bfd_errmsg (bfd_get_error ()));
|
||||
return false;
|
||||
}
|
||||
|
@ -1484,7 +1484,7 @@ write_debugging_info (obfd, dhandle, symcountp, symppp)
|
|||
}
|
||||
|
||||
fprintf (stderr,
|
||||
"%s: don't know how to write debugging information for %s\n",
|
||||
_("%s: don't know how to write debugging information for %s\n"),
|
||||
bfd_get_filename (obfd), bfd_get_target (obfd));
|
||||
return false;
|
||||
}
|
||||
|
@ -1669,7 +1669,7 @@ set_times (destination, statbuf)
|
|||
if (result != 0)
|
||||
{
|
||||
fprintf (stderr, "%s: ", destination);
|
||||
perror ("can not set time");
|
||||
perror (_("can not set time"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1774,7 +1774,7 @@ strip_main (argc, argv)
|
|||
if (stat (argv[i], &statbuf) < 0)
|
||||
{
|
||||
fprintf (stderr, "%s: ", argv[i]);
|
||||
perror ("cannot stat");
|
||||
perror (_("cannot stat"));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -1825,7 +1825,7 @@ copy_main (argc, argv)
|
|||
copy_byte = atoi(optarg);
|
||||
if (copy_byte < 0)
|
||||
{
|
||||
fprintf (stderr, "%s: byte number must be non-negative\n",
|
||||
fprintf (stderr, _("%s: byte number must be non-negative\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -1834,7 +1834,7 @@ copy_main (argc, argv)
|
|||
interleave = atoi(optarg);
|
||||
if (interleave < 1)
|
||||
{
|
||||
fprintf(stderr, "%s: interleave must be positive\n",
|
||||
fprintf(stderr, _("%s: interleave must be positive\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -1907,7 +1907,7 @@ copy_main (argc, argv)
|
|||
if (s == NULL)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"%s: bad format for --add-section NAME=FILENAME\n",
|
||||
_("%s: bad format for --add-section NAME=FILENAME\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -1942,7 +1942,7 @@ copy_main (argc, argv)
|
|||
if (fread (pa->contents, 1, pa->size, f) == 0
|
||||
|| ferror (f))
|
||||
{
|
||||
fprintf (stderr, "%s: %s: fread failed\n",
|
||||
fprintf (stderr, _("%s: %s: fread failed\n"),
|
||||
program_name, pa->filename);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -1971,7 +1971,7 @@ copy_main (argc, argv)
|
|||
if (s == NULL)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"%s: bad format for --adjust-section-vma\n",
|
||||
_("%s: bad format for --adjust-section-vma\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -2018,7 +2018,7 @@ copy_main (argc, argv)
|
|||
gap_fill = (bfd_byte) gap_fill_vma;
|
||||
if ((bfd_vma) gap_fill != gap_fill_vma)
|
||||
{
|
||||
fprintf (stderr, "%s: warning: truncating gap-fill from 0x",
|
||||
fprintf (stderr, _("%s: warning: truncating gap-fill from 0x"),
|
||||
program_name);
|
||||
fprintf_vma (stderr, gap_fill_vma);
|
||||
fprintf (stderr, "to 0x%x\n", (unsigned int) gap_fill);
|
||||
|
@ -2045,7 +2045,7 @@ copy_main (argc, argv)
|
|||
s = strchr (optarg, '=');
|
||||
if (s == NULL)
|
||||
{
|
||||
fprintf (stderr, "%s: bad format for --set-section-flags\n",
|
||||
fprintf (stderr, _("%s: bad format for --set-section-flags\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -2079,7 +2079,7 @@ copy_main (argc, argv)
|
|||
|
||||
if (copy_byte >= interleave)
|
||||
{
|
||||
fprintf (stderr, "%s: byte number must be less than interleave\n",
|
||||
fprintf (stderr, _("%s: byte number must be less than interleave\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -2103,7 +2103,7 @@ copy_main (argc, argv)
|
|||
if (stat (input_filename, &statbuf) < 0)
|
||||
{
|
||||
fprintf (stderr, "%s: ", input_filename);
|
||||
perror ("cannot stat");
|
||||
perror (_("cannot stat"));
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
|
@ -2138,11 +2138,11 @@ copy_main (argc, argv)
|
|||
{
|
||||
if (! p->used && p->adjust != ignore_vma)
|
||||
{
|
||||
fprintf (stderr, "%s: warning: --adjust-section-vma %s%c0x",
|
||||
fprintf (stderr, _("%s: warning: --adjust-section-vma %s%c0x"),
|
||||
program_name, p->name,
|
||||
p->adjust == set_vma ? '=' : '+');
|
||||
fprintf_vma (stderr, p->val);
|
||||
fprintf (stderr, " never used\n");
|
||||
fprintf (stderr, _(" never used\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* objdump.c -- dump information about an object file.
|
||||
Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
|
||||
Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
|
@ -215,24 +216,24 @@ usage (stream, status)
|
|||
FILE *stream;
|
||||
int status;
|
||||
{
|
||||
fprintf (stream, "\
|
||||
fprintf (stream, _("\
|
||||
Usage: %s [-ahifCdDprRtTxsSlw] [-b bfdname] [-m machine] [-j section-name]\n\
|
||||
[--archive-headers] [--target=bfdname] [--debugging] [--disassemble]\n\
|
||||
[--disassemble-all] [--disassemble-zeroes] [--file-headers]\n\
|
||||
[--section-headers] [--headers]\n\
|
||||
[--info] [--section=section-name] [--line-numbers] [--source]\n",
|
||||
[--info] [--section=section-name] [--line-numbers] [--source]\n"),
|
||||
program_name);
|
||||
fprintf (stream, "\
|
||||
fprintf (stream, _("\
|
||||
[--architecture=machine] [--reloc] [--full-contents] [--stabs]\n\
|
||||
[--syms] [--all-headers] [--dynamic-syms] [--dynamic-reloc]\n\
|
||||
[--wide] [--version] [--help] [--private-headers]\n\
|
||||
[--start-address=addr] [--stop-address=addr]\n\
|
||||
[--prefix-addresses] [--[no-]show-raw-insn] [--demangle]\n\
|
||||
[--adjust-vma=offset] [-EB|-EL] [--endian={big|little}] objfile...\n\
|
||||
at least one option besides -l (--line-numbers) must be given\n");
|
||||
at least one option besides -l (--line-numbers) must be given\n"));
|
||||
list_supported_targets (program_name, stream);
|
||||
if (status == 0)
|
||||
fprintf (stream, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
|
||||
fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
|
||||
exit (status);
|
||||
}
|
||||
|
||||
|
@ -357,11 +358,11 @@ static void
|
|||
dump_headers (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
printf ("Sections:\n");
|
||||
printf (_("Sections:\n"));
|
||||
#ifndef BFD64
|
||||
printf ("Idx Name Size VMA LMA File off Algn\n");
|
||||
printf (_("Idx Name Size VMA LMA File off Algn\n"));
|
||||
#else
|
||||
printf ("Idx Name Size VMA LMA File off Algn\n");
|
||||
printf (_("Idx Name Size VMA LMA File off Algn\n"));
|
||||
#endif
|
||||
bfd_map_over_sections (abfd, dump_section_header, (PTR) NULL);
|
||||
}
|
||||
|
@ -375,7 +376,7 @@ slurp_symtab (abfd)
|
|||
|
||||
if (!(bfd_get_file_flags (abfd) & HAS_SYMS))
|
||||
{
|
||||
printf ("No symbols in \"%s\".\n", bfd_get_filename (abfd));
|
||||
printf (_("No symbols in \"%s\".\n"), bfd_get_filename (abfd));
|
||||
symcount = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
@ -392,7 +393,7 @@ slurp_symtab (abfd)
|
|||
if (symcount < 0)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
if (symcount == 0)
|
||||
fprintf (stderr, "%s: %s: No symbols\n",
|
||||
fprintf (stderr, _("%s: %s: No symbols\n"),
|
||||
program_name, bfd_get_filename (abfd));
|
||||
return sy;
|
||||
}
|
||||
|
@ -411,7 +412,7 @@ slurp_dynamic_symtab (abfd)
|
|||
{
|
||||
if (!(bfd_get_file_flags (abfd) & DYNAMIC))
|
||||
{
|
||||
fprintf (stderr, "%s: %s: not a dynamic object\n",
|
||||
fprintf (stderr, _("%s: %s: not a dynamic object\n"),
|
||||
program_name, bfd_get_filename (abfd));
|
||||
dynsymcount = 0;
|
||||
return NULL;
|
||||
|
@ -428,7 +429,7 @@ slurp_dynamic_symtab (abfd)
|
|||
if (dynsymcount < 0)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
if (dynsymcount == 0)
|
||||
fprintf (stderr, "%s: %s: No dynamic symbols\n",
|
||||
fprintf (stderr, _("%s: %s: No dynamic symbols\n"),
|
||||
program_name, bfd_get_filename (abfd));
|
||||
return sy;
|
||||
}
|
||||
|
@ -828,9 +829,6 @@ objdump_print_addr_with_sym (abfd, sec, sym, vma, info, skip_zeroes)
|
|||
objdump_print_value (vma - bfd_asymbol_value (sym), info, true);
|
||||
}
|
||||
(*info->fprintf_func) (info->stream, ">");
|
||||
|
||||
/* Notify the disassembler of the symbol being used: */
|
||||
disasm_symaddr (sym, info);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1232,7 +1230,8 @@ disassemble_bytes (info, disassemble_fn, insns, data, start, stop, relppp,
|
|||
{
|
||||
char buf[1000];
|
||||
SFILE sfile;
|
||||
int bpc, pb = 0;
|
||||
int bpc = 0;
|
||||
int pb = 0;
|
||||
|
||||
done_dot = false;
|
||||
|
||||
|
@ -1265,6 +1264,11 @@ disassemble_bytes (info, disassemble_fn, insns, data, start, stop, relppp,
|
|||
info->stream = (FILE *) &sfile;
|
||||
info->bytes_per_line = 0;
|
||||
info->bytes_per_chunk = 0;
|
||||
if ((*relppp < relppend) && ((**relppp)->address >= (bfd_vma) i &&
|
||||
(**relppp)->address < (bfd_vma) i + bytes))
|
||||
info->flags = INSN_HAS_RELOC;
|
||||
else
|
||||
info->flags = 0;
|
||||
bytes = (*disassemble_fn) (section->vma + i, info);
|
||||
info->fprintf_func = (fprintf_ftype) fprintf;
|
||||
info->stream = stdout;
|
||||
|
@ -1489,7 +1493,7 @@ disassemble_data (abfd)
|
|||
const bfd_arch_info_type *info = bfd_scan_arch (machine);
|
||||
if (info == NULL)
|
||||
{
|
||||
fprintf (stderr, "%s: Can't use supplied machine %s\n",
|
||||
fprintf (stderr, _("%s: Can't use supplied machine %s\n"),
|
||||
program_name,
|
||||
machine);
|
||||
exit (1);
|
||||
|
@ -1510,7 +1514,7 @@ disassemble_data (abfd)
|
|||
disassemble_fn = disassembler (abfd);
|
||||
if (!disassemble_fn)
|
||||
{
|
||||
fprintf (stderr, "%s: Can't disassemble for architecture %s\n",
|
||||
fprintf (stderr, _("%s: Can't disassemble for architecture %s\n"),
|
||||
program_name,
|
||||
bfd_printable_arch_mach (bfd_get_arch (abfd), 0));
|
||||
return;
|
||||
|
@ -1575,7 +1579,7 @@ disassemble_data (abfd)
|
|||
}
|
||||
}
|
||||
|
||||
printf ("Disassembly of section %s:\n", section->name);
|
||||
printf (_("Disassembly of section %s:\n"), section->name);
|
||||
|
||||
datasize = bfd_get_section_size_before_reloc (section);
|
||||
if (datasize == 0)
|
||||
|
@ -1608,7 +1612,7 @@ disassemble_data (abfd)
|
|||
|
||||
sym = find_symbol_for_address (abfd, section, section->vma + i,
|
||||
true, &place);
|
||||
++place;
|
||||
|
||||
while (i < stop)
|
||||
{
|
||||
asymbol *nextsym;
|
||||
|
@ -1616,10 +1620,20 @@ disassemble_data (abfd)
|
|||
boolean insns;
|
||||
|
||||
if (sym != NULL && bfd_asymbol_value (sym) <= section->vma + i)
|
||||
disasm_info.symbol = sym;
|
||||
{
|
||||
int x;
|
||||
|
||||
for (x = place;
|
||||
(x < sorted_symcount
|
||||
&& bfd_asymbol_value (sorted_syms[x]) <= section->vma + i);
|
||||
++x)
|
||||
continue;
|
||||
disasm_info.symbols = & sorted_syms[place];
|
||||
disasm_info.num_symbols = x - place;
|
||||
}
|
||||
else
|
||||
disasm_info.symbol = NULL;
|
||||
|
||||
disasm_info.symbols = NULL;
|
||||
|
||||
if (! prefix_addresses)
|
||||
{
|
||||
printf ("\n");
|
||||
|
@ -1637,6 +1651,7 @@ disassemble_data (abfd)
|
|||
else
|
||||
{
|
||||
while (place < sorted_symcount
|
||||
/* ??? Why the test for != section? */
|
||||
&& (sorted_syms[place]->section != section
|
||||
|| (bfd_asymbol_value (sorted_syms[place])
|
||||
<= bfd_asymbol_value (sym))))
|
||||
|
@ -1735,14 +1750,14 @@ read_section_stabs (abfd, stabsect_name, strsect_name)
|
|||
stabsect = bfd_get_section_by_name (abfd, stabsect_name);
|
||||
if (0 == stabsect)
|
||||
{
|
||||
printf ("No %s section present\n\n", stabsect_name);
|
||||
printf (_("No %s section present\n\n"), stabsect_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
stabstrsect = bfd_get_section_by_name (abfd, strsect_name);
|
||||
if (0 == stabstrsect)
|
||||
{
|
||||
fprintf (stderr, "%s: %s has no %s section\n", program_name,
|
||||
fprintf (stderr, _("%s: %s has no %s section\n"), program_name,
|
||||
bfd_get_filename (abfd), strsect_name);
|
||||
return false;
|
||||
}
|
||||
|
@ -1755,7 +1770,7 @@ read_section_stabs (abfd, stabsect_name, strsect_name)
|
|||
|
||||
if (! bfd_get_section_contents (abfd, stabsect, (PTR) stabs, 0, stab_size))
|
||||
{
|
||||
fprintf (stderr, "%s: Reading %s section of %s failed: %s\n",
|
||||
fprintf (stderr, _("%s: Reading %s section of %s failed: %s\n"),
|
||||
program_name, stabsect_name, bfd_get_filename (abfd),
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
free (stabs);
|
||||
|
@ -1766,7 +1781,7 @@ read_section_stabs (abfd, stabsect_name, strsect_name)
|
|||
if (! bfd_get_section_contents (abfd, stabstrsect, (PTR) strtab, 0,
|
||||
stabstr_size))
|
||||
{
|
||||
fprintf (stderr, "%s: Reading %s section of %s failed: %s\n",
|
||||
fprintf (stderr, _("%s: Reading %s section of %s failed: %s\n"),
|
||||
program_name, strsect_name, bfd_get_filename (abfd),
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
free (stabs);
|
||||
|
@ -1808,7 +1823,7 @@ print_section_stabs (abfd, stabsect_name, strsect_name)
|
|||
stabp = stabs;
|
||||
stabs_end = stabp + stab_size;
|
||||
|
||||
printf ("Contents of %s section:\n\n", stabsect_name);
|
||||
printf (_("Contents of %s section:\n\n"), stabsect_name);
|
||||
printf ("Symnum n_type n_othr n_desc n_value n_strx String\n");
|
||||
|
||||
/* Loop through all symbols and print them.
|
||||
|
@ -1885,11 +1900,12 @@ dump_section_stabs (abfd, stabsect_name, strsect_name)
|
|||
|
||||
len = strlen (stabsect_name);
|
||||
|
||||
/* If the prefix matches, and the files section name ends with a nul or a digit,
|
||||
then we match. Ie: we want either an exact match or a a section followed by
|
||||
a number. */
|
||||
/* If the prefix matches, and the files section name ends with a
|
||||
nul or a digit, then we match. I.e., we want either an exact
|
||||
match or a section followed by a number. */
|
||||
if (strncmp (stabsect_name, s->name, len) == 0
|
||||
&& (s->name[len] == '\000' || isdigit (s->name[len])))
|
||||
&& (s->name[len] == '\000'
|
||||
|| isdigit ((unsigned char) s->name[len])))
|
||||
{
|
||||
if (read_section_stabs (abfd, s->name, strsect_name))
|
||||
{
|
||||
|
@ -1907,10 +1923,10 @@ dump_bfd_header (abfd)
|
|||
{
|
||||
char *comma = "";
|
||||
|
||||
printf ("architecture: %s, ",
|
||||
printf (_("architecture: %s, "),
|
||||
bfd_printable_arch_mach (bfd_get_arch (abfd),
|
||||
bfd_get_mach (abfd)));
|
||||
printf ("flags 0x%08x:\n", abfd->flags);
|
||||
printf (_("flags 0x%08x:\n"), abfd->flags);
|
||||
|
||||
#define PF(x, y) if (abfd->flags & x) {printf("%s%s", comma, y); comma=", ";}
|
||||
PF (HAS_RELOC, "HAS_RELOC");
|
||||
|
@ -1923,7 +1939,7 @@ dump_bfd_header (abfd)
|
|||
PF (WP_TEXT, "WP_TEXT");
|
||||
PF (D_PAGED, "D_PAGED");
|
||||
PF (BFD_IS_RELAXABLE, "BFD_IS_RELAXABLE");
|
||||
printf ("\nstart address 0x");
|
||||
printf (_("\nstart address 0x"));
|
||||
printf_vma (abfd->start_address);
|
||||
printf ("\n");
|
||||
}
|
||||
|
@ -1966,7 +1982,7 @@ display_bfd (abfd)
|
|||
}
|
||||
}
|
||||
|
||||
printf ("\n%s: file format %s\n", bfd_get_filename (abfd),
|
||||
printf (_("\n%s: file format %s\n"), bfd_get_filename (abfd),
|
||||
abfd->xvec->name);
|
||||
if (dump_ar_hdrs)
|
||||
print_arelt_descr (stdout, abfd, true);
|
||||
|
@ -2007,7 +2023,7 @@ display_bfd (abfd)
|
|||
if (dhandle != NULL)
|
||||
{
|
||||
if (! print_debugging_info (stdout, dhandle))
|
||||
fprintf (stderr, "%s: printing debugging information failed\n",
|
||||
fprintf (stderr, _("%s: printing debugging information failed\n"),
|
||||
bfd_get_filename (abfd));
|
||||
}
|
||||
}
|
||||
|
@ -2041,7 +2057,7 @@ display_file (filename, target)
|
|||
{
|
||||
bfd *last_arfile = NULL;
|
||||
|
||||
printf ("In archive %s:\n", bfd_get_filename (file));
|
||||
printf (_("In archive %s:\n"), bfd_get_filename (file));
|
||||
for (;;)
|
||||
{
|
||||
bfd_set_error (bfd_error_no_error);
|
||||
|
@ -2094,7 +2110,7 @@ dump_data (abfd)
|
|||
{
|
||||
if (section->flags & SEC_HAS_CONTENTS)
|
||||
{
|
||||
printf ("Contents of section %s:\n", section->name);
|
||||
printf (_("Contents of section %s:\n"), section->name);
|
||||
|
||||
if (bfd_section_size (abfd, section) == 0)
|
||||
continue;
|
||||
|
@ -2597,7 +2613,7 @@ display_target_tables ()
|
|||
static void
|
||||
display_info ()
|
||||
{
|
||||
printf ("BFD header file version %s\n", BFD_VERSION);
|
||||
printf (_("BFD header file version %s\n"), BFD_VERSION);
|
||||
display_target_list ();
|
||||
display_target_tables ();
|
||||
}
|
||||
|
@ -2716,7 +2732,7 @@ main (argc, argv)
|
|||
endian = BFD_ENDIAN_LITTLE;
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "%s: unrecognized -E option\n", program_name);
|
||||
fprintf (stderr, _("%s: unrecognized -E option\n"), program_name);
|
||||
usage (stderr, 1);
|
||||
}
|
||||
break;
|
||||
|
@ -2727,7 +2743,7 @@ main (argc, argv)
|
|||
endian = BFD_ENDIAN_LITTLE;
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "%s: unrecognized --endian type `%s'\n",
|
||||
fprintf (stderr, _("%s: unrecognized --endian type `%s'\n"),
|
||||
program_name, optarg);
|
||||
usage (stderr, 1);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,250 @@
|
|||
# Makefile for program source directory in GNU NLS utilities package.
|
||||
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
# This file file be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU Public License
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SHELL = /bin/sh
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datadir = $(prefix)/@DATADIRNAME@
|
||||
localedir = $(datadir)/locale
|
||||
gnulocaledir = $(prefix)/share/locale
|
||||
gettextsrcdir = $(prefix)/share/gettext/po
|
||||
subdir = po
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
|
||||
|
||||
CC = @CC@
|
||||
GENCAT = @GENCAT@
|
||||
GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
|
||||
MSGFMT = @MSGFMT@
|
||||
XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
|
||||
MSGMERGE = PATH=../src:$$PATH msgmerge
|
||||
|
||||
DEFS = @DEFS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
|
||||
INCLUDES = -I.. -I$(top_srcdir)/intl
|
||||
|
||||
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
||||
|
||||
SOURCES = cat-id-tbl.c
|
||||
POFILES = @POFILES@
|
||||
GMOFILES = @GMOFILES@
|
||||
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
|
||||
stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
|
||||
|
||||
POTFILES = \
|
||||
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) $<
|
||||
|
||||
.po.pox:
|
||||
$(MAKE) $(PACKAGE).pot
|
||||
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
||||
|
||||
.po.mo:
|
||||
$(MSGFMT) -o $@ $<
|
||||
|
||||
.po.gmo:
|
||||
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
|
||||
&& rm -f $$file && $(GMSGFMT) -o $$file $<
|
||||
|
||||
.po.cat:
|
||||
sed -f ../intl/po2msg.sed < $< > $*.msg \
|
||||
&& rm -f $@ && $(GENCAT) $@ $*.msg
|
||||
|
||||
|
||||
all: all-@USE_NLS@
|
||||
|
||||
all-yes: $(CATALOGS)
|
||||
all-no:
|
||||
|
||||
$(srcdir)/$(PACKAGE).pot: @MAINT@ $(POTFILES)
|
||||
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
||||
--add-comments --keyword=_ --keyword=N_ \
|
||||
--files-from=$(srcdir)/POTFILES.in
|
||||
rm -f $(srcdir)/$(PACKAGE).pot
|
||||
mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
|
||||
|
||||
$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
|
||||
$(srcdir)/stamp-cat-id: $(PACKAGE).pot
|
||||
rm -f cat-id-tbl.tmp
|
||||
sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
|
||||
| sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
|
||||
if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
|
||||
rm cat-id-tbl.tmp; \
|
||||
else \
|
||||
echo cat-id-tbl.c changed; \
|
||||
rm -f $(srcdir)/cat-id-tbl.c; \
|
||||
mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
|
||||
fi
|
||||
cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
|
||||
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $(datadir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(datadir); \
|
||||
fi
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
case "$$cat" in \
|
||||
*.gmo) destdir=$(gnulocaledir);; \
|
||||
*) destdir=$(localedir);; \
|
||||
esac; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
dir=$$destdir/$$lang/LC_MESSAGES; \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $$dir; \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $$dir; \
|
||||
fi; \
|
||||
if test -r $$cat; then \
|
||||
$(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
else \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
|
||||
fi; \
|
||||
if test -r $$cat.m; then \
|
||||
$(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
if test -r $(srcdir)/$$cat.m ; then \
|
||||
$(INSTALL_DATA) $(srcdir)/$$cat.m \
|
||||
$$dir/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
echo "installing $(srcdir)/$$cat as" \
|
||||
"$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
|
||||
else \
|
||||
true; \
|
||||
fi; \
|
||||
fi; \
|
||||
done
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test -r $(MKINSTALLDIRS); then \
|
||||
$(MKINSTALLDIRS) $(gettextsrcdir); \
|
||||
else \
|
||||
$(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
|
||||
fi; \
|
||||
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
||||
$(gettextsrcdir)/Makefile.in.in; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
||||
# Define this as empty until I found a useful application.
|
||||
installcheck:
|
||||
|
||||
uninstall:
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
|
||||
rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
|
||||
done
|
||||
rm -f $(gettextsrcdir)/po-Makefile.in.in
|
||||
|
||||
check: all
|
||||
|
||||
cat-id-tbl.o: ../intl/libgettext.h
|
||||
|
||||
dvi info tags TAGS ID:
|
||||
|
||||
mostlyclean:
|
||||
rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
|
||||
rm -fr *.o
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f $(GMOFILES)
|
||||
|
||||
distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir: update-po $(DISTFILES)
|
||||
dists="$(DISTFILES)"; \
|
||||
for file in $$dists; do \
|
||||
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|
||||
|| cp -p $(srcdir)/$$file $(distdir); \
|
||||
done
|
||||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(PACKAGE).pot
|
||||
PATH=`pwd`/../src:$$PATH; \
|
||||
cd $(srcdir); \
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
|
||||
mv $$lang.po $$lang.old.po; \
|
||||
echo "$$lang:"; \
|
||||
if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
|
||||
rm -f $$lang.old.po; \
|
||||
else \
|
||||
echo "msgmerge for $$cat failed!"; \
|
||||
rm -f $$lang.po; \
|
||||
mv $$lang.old.po $$lang.po; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
POTFILES: POTFILES.in
|
||||
( if test 'x$(srcdir)' != 'x.'; then \
|
||||
posrcprefix='$(top_srcdir)/'; \
|
||||
else \
|
||||
posrcprefix="../"; \
|
||||
fi; \
|
||||
rm -f $@-t $@ \
|
||||
&& (sed -e '/^#/d' -e '/^[ ]*$$/d' \
|
||||
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
|
||||
| sed -e '$$s/\\$$//') > $@-t \
|
||||
&& chmod a-w $@-t \
|
||||
&& mv $@-t $@ )
|
||||
|
||||
POTFILES.in: @MAINT@ ../Makefile
|
||||
cd .. && $(MAKE) po/POTFILES.in
|
||||
|
||||
Makefile: Make-in ../config.status POTFILES
|
||||
cd .. \
|
||||
&& CONFIG_FILES=$(subdir)/Makefile.in:$(subdir)/Make-in \
|
||||
CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,47 @@
|
|||
addr2line.c
|
||||
ar.c
|
||||
arsup.c
|
||||
arsup.h
|
||||
bucomm.c
|
||||
bucomm.h
|
||||
budbg.h
|
||||
coffdump.c
|
||||
coffgrok.c
|
||||
coffgrok.h
|
||||
debug.c
|
||||
debug.c
|
||||
debug.h
|
||||
dlltool.c
|
||||
dlltool.h
|
||||
filemode.c
|
||||
ieee.c
|
||||
ieee.c
|
||||
is-ranlib.c
|
||||
is-strip.c
|
||||
maybe-ranlib.c
|
||||
maybe-strip.c
|
||||
nlmconv.c
|
||||
nlmconv.h
|
||||
nm.c
|
||||
not-ranlib.c
|
||||
not-strip.c
|
||||
objcopy.c
|
||||
objdump.c
|
||||
prdbg.c
|
||||
rdcoff.c
|
||||
rdcoff.c
|
||||
rddbg.c
|
||||
rddbg.c
|
||||
resbin.c
|
||||
rescoff.c
|
||||
resrc.c
|
||||
size.c
|
||||
srconv.c
|
||||
stabs.c
|
||||
stabs.c
|
||||
strings.c
|
||||
sysdump.c
|
||||
version.c
|
||||
windres.c
|
||||
windres.h
|
||||
wrstabs.c
|
194
binutils/size.c
194
binutils/size.c
|
@ -1,5 +1,5 @@
|
|||
/* size.c -- report size of various sections of an executable file.
|
||||
Copyright 1991, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
|
@ -15,7 +15,7 @@ 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, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Extensions/incompatibilities:
|
||||
o - BSD output has filenames at the end.
|
||||
|
@ -29,9 +29,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|||
*/
|
||||
|
||||
#include "bfd.h"
|
||||
#include "sysdep.h"
|
||||
#include "getopt.h"
|
||||
#include "bucomm.h"
|
||||
#include "libiberty.h"
|
||||
|
||||
#ifndef BSD_DEFAULT
|
||||
#define BSD_DEFAULT 1
|
||||
|
@ -50,31 +50,42 @@ int show_help = 0;
|
|||
/* Program exit status. */
|
||||
int return_code = 0;
|
||||
|
||||
/* IMPORTS */
|
||||
extern char *program_version;
|
||||
extern char *target;
|
||||
static char *target = NULL;
|
||||
|
||||
/* Forward declarations */
|
||||
/* Static declarations */
|
||||
|
||||
static void usage PARAMS ((FILE *, int));
|
||||
static void display_file PARAMS ((char *filename));
|
||||
|
||||
static void display_bfd PARAMS ((bfd *));
|
||||
static void display_archive PARAMS ((bfd *));
|
||||
static int size_number PARAMS ((bfd_size_type));
|
||||
#if 0
|
||||
static void lprint_number PARAMS ((int, bfd_size_type));
|
||||
#endif
|
||||
static void rprint_number PARAMS ((int, bfd_size_type));
|
||||
static void print_berkeley_format PARAMS ((bfd *));
|
||||
static void sysv_internal_sizer PARAMS ((bfd *, asection *, PTR));
|
||||
static void sysv_internal_printer PARAMS ((bfd *, asection *, PTR));
|
||||
static void print_sysv_format PARAMS ((bfd *));
|
||||
static void print_sizes PARAMS ((bfd * file));
|
||||
|
||||
static void berkeley_sum PARAMS ((bfd *, sec_ptr, PTR));
|
||||
|
||||
void
|
||||
static void
|
||||
usage (stream, status)
|
||||
FILE *stream;
|
||||
int status;
|
||||
{
|
||||
fprintf (stream, "\
|
||||
fprintf (stream, _("\
|
||||
Usage: %s [-ABdoxV] [--format=berkeley|sysv] [--radix=8|10|16]\n\
|
||||
[--target=bfdname] [--version] [--help] [file...]\n", program_name);
|
||||
[--target=bfdname] [--version] [--help] [file...]\n"), program_name);
|
||||
#if BSD_DEFAULT
|
||||
fputs ("default is --format=berkeley\n", stream);
|
||||
fputs (_("default is --format=berkeley\n"), stream);
|
||||
#else
|
||||
fputs ("default is --format=sysv\n", stream);
|
||||
fputs (_("default is --format=sysv\n"), stream);
|
||||
#endif
|
||||
list_supported_targets (program_name, stream);
|
||||
if (status == 0)
|
||||
fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
|
||||
exit (status);
|
||||
}
|
||||
|
||||
|
@ -97,8 +108,10 @@ main (argc, argv)
|
|||
int c;
|
||||
|
||||
program_name = *argv;
|
||||
xmalloc_set_program_name (program_name);
|
||||
|
||||
bfd_init ();
|
||||
set_default_bfd_target ();
|
||||
|
||||
while ((c = getopt_long (argc, argv, "ABVdox", long_options,
|
||||
(int *) 0)) != EOF)
|
||||
|
@ -116,7 +129,7 @@ main (argc, argv)
|
|||
berkeley_format = 0;
|
||||
break;
|
||||
default:
|
||||
fprintf (stderr, "invalid argument to --format: %s\n", optarg);
|
||||
fprintf (stderr, _("invalid argument to --format: %s\n"), optarg);
|
||||
usage (stderr, 1);
|
||||
}
|
||||
break;
|
||||
|
@ -143,7 +156,7 @@ main (argc, argv)
|
|||
radix = hex;
|
||||
break;
|
||||
default:
|
||||
printf ("Invalid radix: %s\n", optarg);
|
||||
printf (_("Invalid radix: %s\n"), optarg);
|
||||
usage (stderr, 1);
|
||||
}
|
||||
break;
|
||||
|
@ -173,10 +186,7 @@ main (argc, argv)
|
|||
}
|
||||
|
||||
if (show_version)
|
||||
{
|
||||
printf ("GNU %s version %s\n", program_name, program_version);
|
||||
exit (0);
|
||||
}
|
||||
print_version ("size");
|
||||
if (show_help)
|
||||
usage (stdout, 0);
|
||||
|
||||
|
@ -191,7 +201,7 @@ main (argc, argv)
|
|||
|
||||
/* Display stats on file or archive member ABFD. */
|
||||
|
||||
void
|
||||
static void
|
||||
display_bfd (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
|
@ -208,7 +218,7 @@ display_bfd (abfd)
|
|||
return;
|
||||
}
|
||||
|
||||
if (bfd_error == file_ambiguously_recognized)
|
||||
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
|
||||
{
|
||||
bfd_nonfatal (bfd_get_filename (abfd));
|
||||
list_matching_formats (matching);
|
||||
|
@ -234,7 +244,7 @@ display_bfd (abfd)
|
|||
|
||||
bfd_nonfatal (bfd_get_filename (abfd));
|
||||
|
||||
if (bfd_error == file_ambiguously_recognized)
|
||||
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
|
||||
{
|
||||
list_matching_formats (matching);
|
||||
free (matching);
|
||||
|
@ -251,12 +261,12 @@ display_archive (file)
|
|||
|
||||
for (;;)
|
||||
{
|
||||
bfd_error = no_error;
|
||||
bfd_set_error (bfd_error_no_error);
|
||||
|
||||
arfile = bfd_openr_next_archived_file (file, arfile);
|
||||
if (arfile == NULL)
|
||||
{
|
||||
if (bfd_error != no_more_archived_files)
|
||||
if (bfd_get_error () != bfd_error_no_more_archived_files)
|
||||
{
|
||||
bfd_nonfatal (bfd_get_filename (file));
|
||||
return_code = 2;
|
||||
|
@ -296,24 +306,51 @@ display_file (filename)
|
|||
|
||||
/* This is what lexical functions are for. */
|
||||
|
||||
void
|
||||
static int
|
||||
size_number (num)
|
||||
bfd_size_type num;
|
||||
{
|
||||
char buffer[40];
|
||||
sprintf (buffer,
|
||||
(radix == decimal ? "%lu" :
|
||||
((radix == octal) ? "0%lo" : "0x%lx")),
|
||||
(unsigned long) num);
|
||||
|
||||
return strlen (buffer);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/* This is not used. */
|
||||
|
||||
static void
|
||||
lprint_number (width, num)
|
||||
int width;
|
||||
bfd_size_type num;
|
||||
{
|
||||
printf ((radix == decimal ? "%-*lu\t" :
|
||||
((radix == octal) ? "%-*lo\t" : "%-*lx\t")),
|
||||
width, (unsigned long) num);
|
||||
char buffer[40];
|
||||
sprintf (buffer,
|
||||
(radix == decimal ? "%lu" :
|
||||
((radix == octal) ? "0%lo" : "0x%lx")),
|
||||
(unsigned long) num);
|
||||
|
||||
printf ("%-*s", width, buffer);
|
||||
}
|
||||
|
||||
void
|
||||
#endif
|
||||
|
||||
static void
|
||||
rprint_number (width, num)
|
||||
int width;
|
||||
bfd_size_type num;
|
||||
{
|
||||
printf ((radix == decimal ? "%*lu\t" :
|
||||
((radix == octal) ? "%*lo\t" : "%*lx\t")),
|
||||
width, (unsigned long) num);
|
||||
char buffer[40];
|
||||
sprintf (buffer,
|
||||
(radix == decimal ? "%lu" :
|
||||
((radix == octal) ? "0%lo" : "0x%lx")),
|
||||
(unsigned long) num);
|
||||
|
||||
printf ("%*s", width, buffer);
|
||||
}
|
||||
|
||||
static bfd_size_type bsssize;
|
||||
|
@ -326,18 +363,23 @@ berkeley_sum (abfd, sec, ignore)
|
|||
sec_ptr sec;
|
||||
PTR ignore;
|
||||
{
|
||||
flagword flags;
|
||||
bfd_size_type size;
|
||||
|
||||
flags = bfd_get_section_flags (abfd, sec);
|
||||
if ((flags & SEC_ALLOC) == 0)
|
||||
return;
|
||||
|
||||
size = bfd_get_section_size_before_reloc (sec);
|
||||
if (bfd_get_section_flags (abfd, sec) & SEC_CODE)
|
||||
if ((flags & SEC_CODE) != 0 || (flags & SEC_READONLY) != 0)
|
||||
textsize += size;
|
||||
else if (bfd_get_section_flags (abfd, sec) & SEC_DATA)
|
||||
else if ((flags & SEC_HAS_CONTENTS) != 0)
|
||||
datasize += size;
|
||||
else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
|
||||
else
|
||||
bsssize += size;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
print_berkeley_format (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
|
@ -353,19 +395,21 @@ print_berkeley_format (abfd)
|
|||
if (files_seen++ == 0)
|
||||
#if 0
|
||||
/* Intel doesn't like bss/stk because they don't have core files. */
|
||||
puts ((radix == octal) ? "text\tdata\tbss/stk\toct\thex\tfilename" :
|
||||
"text\tdata\tbss/stk\tdec\thex\tfilename");
|
||||
puts ((radix == octal) ? " text\t data\tbss/stk\t oct\t hex\tfilename" :
|
||||
" text\t data\tbss/stk\t dec\t hex\tfilename");
|
||||
#else
|
||||
puts ((radix == octal) ? "text\tdata\tbss\toct\thex\tfilename" :
|
||||
"text\tdata\tbss\tdec\thex\tfilename");
|
||||
puts ((radix == octal) ? " text\t data\t bss\t oct\t hex\tfilename" :
|
||||
" text\t data\t bss\t dec\t hex\tfilename");
|
||||
#endif
|
||||
|
||||
total = textsize + datasize + bsssize;
|
||||
|
||||
lprint_number (7, textsize);
|
||||
lprint_number (7, datasize);
|
||||
lprint_number (7, bsssize);
|
||||
printf (((radix == octal) ? "%-7lo\t%-7lx\t" : "%-7lu\t%-7lx\t"),
|
||||
rprint_number (7, textsize);
|
||||
putchar ('\t');
|
||||
rprint_number (7, datasize);
|
||||
putchar ('\t');
|
||||
rprint_number (7, bsssize);
|
||||
printf (((radix == octal) ? "\t%7lo\t%7lx\t" : "\t%7lu\t%7lx\t"),
|
||||
(unsigned long) total, (unsigned long) total);
|
||||
|
||||
fputs (bfd_get_filename (abfd), stdout);
|
||||
|
@ -375,43 +419,81 @@ print_berkeley_format (abfd)
|
|||
|
||||
/* I REALLY miss lexical functions! */
|
||||
bfd_size_type svi_total = 0;
|
||||
bfd_vma svi_maxvma = 0;
|
||||
int svi_namelen = 0;
|
||||
int svi_vmalen = 0;
|
||||
int svi_sizelen = 0;
|
||||
|
||||
void
|
||||
static void
|
||||
sysv_internal_sizer (file, sec, ignore)
|
||||
bfd *file;
|
||||
sec_ptr sec;
|
||||
PTR ignore;
|
||||
{
|
||||
bfd_size_type size = bfd_section_size (file, sec);
|
||||
if (!bfd_is_abs_section (sec)
|
||||
&& !bfd_is_com_section (sec)
|
||||
&& !bfd_is_und_section (sec))
|
||||
{
|
||||
int namelen = strlen (bfd_section_name (file, sec));
|
||||
if (namelen > svi_namelen)
|
||||
svi_namelen = namelen;
|
||||
|
||||
svi_total += size;
|
||||
if (bfd_section_vma (file, sec) > svi_maxvma)
|
||||
svi_maxvma = bfd_section_vma (file, sec);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
sysv_internal_printer (file, sec, ignore)
|
||||
bfd *file;
|
||||
sec_ptr sec;
|
||||
PTR ignore;
|
||||
{
|
||||
bfd_size_type size = bfd_section_size (file, sec);
|
||||
if (sec != &bfd_abs_section
|
||||
if (!bfd_is_abs_section (sec)
|
||||
&& !bfd_is_com_section (sec)
|
||||
&& sec != &bfd_und_section)
|
||||
&& !bfd_is_und_section (sec))
|
||||
{
|
||||
svi_total += size;
|
||||
|
||||
printf ("%-12s", bfd_section_name (file, sec));
|
||||
rprint_number (8, size);
|
||||
printf (" ");
|
||||
rprint_number (8, bfd_section_vma (file, sec));
|
||||
printf ("%-*s ", svi_namelen, bfd_section_name (file, sec));
|
||||
rprint_number (svi_sizelen, size);
|
||||
printf (" ");
|
||||
rprint_number (svi_vmalen, bfd_section_vma (file, sec));
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
print_sysv_format (file)
|
||||
bfd *file;
|
||||
{
|
||||
/* size all of the columns */
|
||||
svi_total = 0;
|
||||
svi_maxvma = 0;
|
||||
svi_namelen = 0;
|
||||
bfd_map_over_sections (file, sysv_internal_sizer, (PTR) NULL);
|
||||
svi_vmalen = size_number ((bfd_size_type)svi_maxvma);
|
||||
if ((size_t) svi_vmalen < sizeof ("addr") - 1)
|
||||
svi_vmalen = sizeof ("addr")-1;
|
||||
|
||||
svi_sizelen = size_number (svi_total);
|
||||
if ((size_t) svi_sizelen < sizeof ("size") - 1)
|
||||
svi_sizelen = sizeof ("size")-1;
|
||||
|
||||
svi_total = 0;
|
||||
printf ("%s ", bfd_get_filename (file));
|
||||
if (bfd_my_archive (file))
|
||||
printf (" (ex %s)", bfd_get_filename (bfd_my_archive (file)));
|
||||
|
||||
puts (":\nsection\t\tsize\t addr");
|
||||
printf (":\n%-*s %*s %*s\n", svi_namelen, "section",
|
||||
svi_sizelen, "size", svi_vmalen, "addr");
|
||||
bfd_map_over_sections (file, sysv_internal_printer, (PTR) NULL);
|
||||
|
||||
printf ("Total ");
|
||||
rprint_number (8, svi_total);
|
||||
printf ("%-*s ", svi_namelen, "Total");
|
||||
rprint_number (svi_sizelen, svi_total);
|
||||
printf ("\n\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* srconv.c -- Sysroff conversion program
|
||||
Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 95, 96, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
|
@ -15,7 +15,8 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
/* Written by Steve Chamberlain (sac@cygnus.com)
|
||||
|
||||
|
@ -37,8 +38,10 @@
|
|||
#define PROGRAM_VERSION "1.5"
|
||||
/*#define FOOP1 1 */
|
||||
|
||||
static int sh;
|
||||
static int h8300;
|
||||
static int addrsize;
|
||||
static char *toolname;
|
||||
static char **rnames;
|
||||
|
||||
static void wr_cs ();
|
||||
static void walk_tree_scope ();
|
||||
static void wr_globals ();
|
||||
|
@ -171,12 +174,7 @@ writeINT (n, ptr, idx, size, file)
|
|||
int byte = *idx / 8;
|
||||
|
||||
if (size == -2)
|
||||
{
|
||||
if (sh)
|
||||
size = 4;
|
||||
else if (h8300)
|
||||
size = 2;
|
||||
}
|
||||
size = addrsize;
|
||||
else if (size == -1)
|
||||
size = 0;
|
||||
|
||||
|
@ -319,14 +317,14 @@ wr_un (ptr, sfile, first, nsecs)
|
|||
|
||||
un.spare1 = 0;
|
||||
|
||||
if (abfd->flags & EXEC_P)
|
||||
if (bfd_get_file_flags (abfd) & EXEC_P)
|
||||
un.format = FORMAT_LM;
|
||||
else
|
||||
un.format = FORMAT_OM;
|
||||
un.spare1 = 0;
|
||||
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
un.nsections = ptr->nsections - 1; /* Don't count the abs section */
|
||||
#else
|
||||
/*NEW - only count sections with size */
|
||||
|
@ -349,10 +347,7 @@ wr_un (ptr, sfile, first, nsecs)
|
|||
un.nextrefs++;
|
||||
}
|
||||
}
|
||||
if (sh)
|
||||
un.tool = "C_SH";
|
||||
else if (h8300)
|
||||
un.tool = "C_H8/300H";
|
||||
un.tool = toolname;
|
||||
un.tcd = DATE;
|
||||
un.linker = "L_GX00";
|
||||
un.lcd = DATE;
|
||||
|
@ -368,7 +363,7 @@ wr_hd (p)
|
|||
struct IT_hd hd;
|
||||
|
||||
hd.spare1 = 0;
|
||||
if (abfd->flags & EXEC_P)
|
||||
if (bfd_get_file_flags (abfd) & EXEC_P)
|
||||
{
|
||||
hd.mt = MTYPE_ABS_LM;
|
||||
}
|
||||
|
@ -381,17 +376,38 @@ wr_hd (p)
|
|||
hd.nu = p->nsources; /* Always one unit */
|
||||
hd.code = 0; /* Always ASCII */
|
||||
hd.ver = "0200"; /* Version 2.00 */
|
||||
switch (abfd->arch_info->arch)
|
||||
switch (bfd_get_arch (abfd))
|
||||
{
|
||||
case bfd_arch_h8300:
|
||||
hd.au = 8;
|
||||
hd.si = 0;
|
||||
hd.afl = 2;
|
||||
hd.spcsz = 32;
|
||||
hd.segsz = 0;
|
||||
hd.segsh = 0;
|
||||
hd.cpu = "H8300H";
|
||||
h8300 = 1;
|
||||
switch (bfd_get_mach (abfd))
|
||||
{
|
||||
case bfd_mach_h8300:
|
||||
hd.cpu = "H8300";
|
||||
hd.afl = 2;
|
||||
addrsize = 2;
|
||||
toolname = "C_H8/300";
|
||||
break;
|
||||
case bfd_mach_h8300h:
|
||||
hd.cpu = "H8300H";
|
||||
hd.afl = 4;
|
||||
addrsize = 4;
|
||||
toolname = "C_H8/300H";
|
||||
break;
|
||||
case bfd_mach_h8300s:
|
||||
hd.cpu = "H8300S";
|
||||
hd.afl = 4;
|
||||
addrsize = 4;
|
||||
toolname = "C_H8/300S";
|
||||
break;
|
||||
default:
|
||||
abort();
|
||||
}
|
||||
rnames = rname_h8300;
|
||||
break;
|
||||
case bfd_arch_sh:
|
||||
hd.au = 8;
|
||||
|
@ -401,13 +417,15 @@ wr_hd (p)
|
|||
hd.segsz = 0;
|
||||
hd.segsh = 0;
|
||||
hd.cpu = "SH";
|
||||
sh = 1;
|
||||
addrsize = 4;
|
||||
toolname = "C_SH";
|
||||
rnames = rname_sh;
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
|
||||
if (!abfd->flags & EXEC_P)
|
||||
if (! bfd_get_file_flags(abfd) & EXEC_P)
|
||||
{
|
||||
hd.ep = 0;
|
||||
}
|
||||
|
@ -422,8 +440,7 @@ wr_hd (p)
|
|||
|
||||
hd.os = "";
|
||||
hd.sys = "";
|
||||
hd.mn = strip_suffix (abfd->filename);
|
||||
|
||||
hd.mn = strip_suffix (bfd_get_filename (abfd));
|
||||
|
||||
sysroff_swap_hd_out (file, &hd);
|
||||
}
|
||||
|
@ -449,7 +466,7 @@ wr_ob (p, section)
|
|||
struct coff_ofile *p;
|
||||
struct coff_section *section;
|
||||
{
|
||||
int i;
|
||||
bfd_size_type i;
|
||||
int first = 1;
|
||||
unsigned char stuff[200];
|
||||
|
||||
|
@ -465,7 +482,7 @@ wr_ob (p, section)
|
|||
if (first)
|
||||
{
|
||||
ob.saf = 1;
|
||||
if (abfd->flags & EXEC_P)
|
||||
if (bfd_get_file_flags (abfd) & EXEC_P)
|
||||
ob.address = section->address;
|
||||
else
|
||||
ob.address = 0;
|
||||
|
@ -485,12 +502,12 @@ wr_ob (p, section)
|
|||
i += todo;
|
||||
}
|
||||
/* Now fill the rest with blanks */
|
||||
while (i < section->size)
|
||||
while (i < (bfd_size_type) section->size)
|
||||
{
|
||||
struct IT_ob ob;
|
||||
int todo = 200; /* Copy in 200 byte lumps */
|
||||
ob.spare = 0;
|
||||
if (i + todo > section->size)
|
||||
if (i + todo > (bfd_size_type) section->size)
|
||||
todo = section->size - i;
|
||||
ob.saf = 0;
|
||||
|
||||
|
@ -959,7 +976,7 @@ walk_tree_symbol (sfile, section, symbol, nest)
|
|||
{
|
||||
struct IT_dsy dsy;
|
||||
|
||||
dsy.spare2 = 0;
|
||||
memset(&dsy, 0, sizeof(dsy));
|
||||
dsy.nesting = nest;
|
||||
|
||||
switch (symbol->type->type)
|
||||
|
@ -1116,12 +1133,7 @@ walk_tree_symbol (sfile, section, symbol, nest)
|
|||
}
|
||||
|
||||
if (symbol->where->where == coff_where_register)
|
||||
{
|
||||
if (sh)
|
||||
dsy.reg = rname_sh[symbol->where->offset];
|
||||
else if (h8300)
|
||||
dsy.reg = rname_h8300[symbol->where->offset];
|
||||
}
|
||||
dsy.reg = rnames[symbol->where->offset];
|
||||
|
||||
switch (symbol->visible->type)
|
||||
{
|
||||
|
@ -1230,9 +1242,10 @@ wr_du (p, sfile, n)
|
|||
int j;
|
||||
unsigned int *lowest = (unsigned *) nints (p->nsections);
|
||||
unsigned int *highest = (unsigned *) nints (p->nsections);
|
||||
du.spare = 0;
|
||||
du.format = abfd->flags & EXEC_P ? 0 : 1;
|
||||
du.format = bfd_get_file_flags (abfd) & EXEC_P ? 0 : 1;
|
||||
du.optimized = 0;
|
||||
du.stackfrmt = 0;
|
||||
du.spare = 0;
|
||||
du.unit = n;
|
||||
du.sections = p->nsections - 1;
|
||||
du.san = (int *) xcalloc (sizeof (int), du.sections);
|
||||
|
@ -1275,7 +1288,7 @@ wr_du (p, sfile, n)
|
|||
}
|
||||
du.san[used] = i;
|
||||
du.length[used] = highest[i] - lowest[i];
|
||||
du.address[used] = abfd->flags & EXEC_P ? lowest[i] : 0;
|
||||
du.address[used] = bfd_get_file_flags (abfd) & EXEC_P ? lowest[i] : 0;
|
||||
if (debug)
|
||||
{
|
||||
printf (" section %6s 0x%08x..0x%08x\n",
|
||||
|
@ -1664,14 +1677,14 @@ int scount = 0;
|
|||
{
|
||||
/* Don't have a symbol set aside for this section, which means that nothing
|
||||
in this file does anything for the section. */
|
||||
sc.format = !(abfd->flags & EXEC_P);
|
||||
sc.format = !(bfd_get_file_flags (abfd) & EXEC_P);
|
||||
sc.addr = 0;
|
||||
sc.length = 0;
|
||||
name = info[i].sec->name;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (abfd->flags & EXEC_P)
|
||||
if (bfd_get_file_flags (abfd) & EXEC_P)
|
||||
{
|
||||
sc.format = 0;
|
||||
sc.addr = symbol->where->offset;
|
||||
|
@ -1713,11 +1726,15 @@ int scount = 0;
|
|||
{
|
||||
sc.contents = CONTENTS_CODE;
|
||||
}
|
||||
#if 0
|
||||
/* NEW */
|
||||
if (sc.length) {
|
||||
#endif
|
||||
sysroff_swap_sc_out (file, &sc);
|
||||
scount++;
|
||||
#if 0
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return scount;
|
||||
}
|
||||
|
@ -1869,14 +1886,14 @@ show_usage (file, status)
|
|||
FILE *file;
|
||||
int status;
|
||||
{
|
||||
fprintf (file, "Usage: %s [-dhVq] in-file [out-file]\n", program_name);
|
||||
fprintf (file, _("Usage: %s [-dhVq] in-file [out-file]\n"), program_name);
|
||||
exit (status);
|
||||
}
|
||||
|
||||
static void
|
||||
show_help ()
|
||||
{
|
||||
printf ("%s: Convert a COFF object file into a SYSROFF object file\n",
|
||||
printf (_("%s: Convert a COFF object file into a SYSROFF object file\n"),
|
||||
program_name);
|
||||
show_usage (stdout, 0);
|
||||
}
|
||||
|
@ -1924,7 +1941,7 @@ main (ac, av)
|
|||
show_help ();
|
||||
/*NOTREACHED */
|
||||
case 'V':
|
||||
printf ("GNU %s version %s\n", program_name, PROGRAM_VERSION);
|
||||
printf (_("GNU %s version %s\n"), program_name, PROGRAM_VERSION);
|
||||
exit (0);
|
||||
/*NOTREACHED */
|
||||
case 0:
|
||||
|
@ -1950,7 +1967,7 @@ main (ac, av)
|
|||
if (strcmp (input_file, output_file) == 0)
|
||||
{
|
||||
fprintf (stderr,
|
||||
"%s: input and output files must be different\n",
|
||||
_("%s: input and output files must be different\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -1961,7 +1978,7 @@ main (ac, av)
|
|||
|
||||
if (!input_file)
|
||||
{
|
||||
fprintf (stderr, "%s: no input file specified\n",
|
||||
fprintf (stderr, _("%s: no input file specified\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -2008,7 +2025,7 @@ main (ac, av)
|
|||
|
||||
if (!file)
|
||||
{
|
||||
fprintf (stderr, "%s: unable to open output file %s\n",
|
||||
fprintf (stderr, _("%s: unable to open output file %s\n"),
|
||||
program_name, output_file);
|
||||
exit (1);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* strings -- print the strings of printable characters in files
|
||||
Copyright (C) 1993, 94 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
|
||||
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
|
||||
|
@ -13,7 +13,8 @@
|
|||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
/* Usage: strings [options] file...
|
||||
|
||||
|
@ -49,12 +50,13 @@
|
|||
Written by Richard Stallman <rms@gnu.ai.mit.edu>
|
||||
and David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include <stdio.h>
|
||||
#include <getopt.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
#include "libiberty.h"
|
||||
|
||||
#ifdef isascii
|
||||
#define isgraphic(c) (isascii (c) && isprint (c))
|
||||
|
@ -67,7 +69,7 @@ extern int errno;
|
|||
#endif
|
||||
|
||||
/* The BFD section flags that identify an initialized data section. */
|
||||
#define DATA_FLAGS (SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS)
|
||||
#define DATA_FLAGS (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS)
|
||||
|
||||
/* Radix for printing addresses (must be 8, 10 or 16). */
|
||||
static int address_radix;
|
||||
|
@ -90,8 +92,6 @@ static boolean got_a_section;
|
|||
/* The BFD object file format. */
|
||||
static char *target;
|
||||
|
||||
extern char *program_version;
|
||||
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"all", no_argument, NULL, 'a'},
|
||||
|
@ -104,14 +104,16 @@ static struct option long_options[] =
|
|||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
static void strings_a_section PARAMS ((bfd *, asection *, PTR));
|
||||
static boolean strings_object_file PARAMS ((const char *));
|
||||
static boolean strings_file PARAMS ((char *file));
|
||||
static int integer_arg PARAMS ((char *s));
|
||||
static void print_strings PARAMS ((char *filename, FILE *stream,
|
||||
static void print_strings PARAMS ((const char *filename, FILE *stream,
|
||||
file_ptr address, int stop_point,
|
||||
int magiccount, char *magic));
|
||||
static void usage PARAMS ((FILE *stream, int status));
|
||||
|
||||
void
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
|
@ -121,6 +123,7 @@ main (argc, argv)
|
|||
boolean files_given = false;
|
||||
|
||||
program_name = argv[0];
|
||||
xmalloc_set_program_name (program_name);
|
||||
string_min = -1;
|
||||
print_addresses = false;
|
||||
print_filenames = false;
|
||||
|
@ -147,7 +150,7 @@ main (argc, argv)
|
|||
string_min = integer_arg (optarg);
|
||||
if (string_min < 1)
|
||||
{
|
||||
fprintf (stderr, "%s: invalid number %s\n",
|
||||
fprintf (stderr, _("%s: invalid number %s\n"),
|
||||
program_name, optarg);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -186,8 +189,8 @@ main (argc, argv)
|
|||
break;
|
||||
|
||||
case 'v':
|
||||
printf ("GNU %s version %s\n", program_name, program_version);
|
||||
exit (0);
|
||||
print_version ("strings");
|
||||
break;
|
||||
|
||||
case '?':
|
||||
usage (stderr, 1);
|
||||
|
@ -205,22 +208,32 @@ main (argc, argv)
|
|||
string_min = 4;
|
||||
|
||||
bfd_init ();
|
||||
set_default_bfd_target ();
|
||||
|
||||
for (; optind < argc; ++optind)
|
||||
if (optind >= argc)
|
||||
{
|
||||
if (!strcmp (argv[optind], "-"))
|
||||
datasection_only = false;
|
||||
else
|
||||
datasection_only = false;
|
||||
print_strings ("{standard input}", stdin, 0, 0, 0, (char *) NULL);
|
||||
files_given = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (; optind < argc; ++optind)
|
||||
{
|
||||
files_given = true;
|
||||
exit_status |= (strings_file (argv[optind]) == false);
|
||||
if (strcmp (argv[optind], "-") == 0)
|
||||
datasection_only = false;
|
||||
else
|
||||
{
|
||||
files_given = true;
|
||||
exit_status |= (strings_file (argv[optind]) == false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (files_given == false)
|
||||
usage (stderr, 1);
|
||||
|
||||
exit (exit_status);
|
||||
return (exit_status);
|
||||
}
|
||||
|
||||
/* Scan section SECT of the file ABFD, whose printable name is FILE.
|
||||
|
@ -228,11 +241,13 @@ main (argc, argv)
|
|||
set `got_a_section' and print the strings in it. */
|
||||
|
||||
static void
|
||||
strings_a_section (abfd, sect, file)
|
||||
strings_a_section (abfd, sect, filearg)
|
||||
bfd *abfd;
|
||||
asection *sect;
|
||||
PTR file;
|
||||
PTR filearg;
|
||||
{
|
||||
const char *file = (const char *) filearg;
|
||||
|
||||
if ((sect->flags & DATA_FLAGS) == DATA_FLAGS)
|
||||
{
|
||||
bfd_size_type sz = bfd_get_section_size_before_reloc (sect);
|
||||
|
@ -254,7 +269,7 @@ strings_a_section (abfd, sect, file)
|
|||
|
||||
static boolean
|
||||
strings_object_file (file)
|
||||
char *file;
|
||||
const char *file;
|
||||
{
|
||||
bfd *abfd = bfd_openr (file, target);
|
||||
|
||||
|
@ -274,7 +289,7 @@ strings_object_file (file)
|
|||
}
|
||||
|
||||
got_a_section = false;
|
||||
bfd_map_over_sections (abfd, strings_a_section, file);
|
||||
bfd_map_over_sections (abfd, strings_a_section, (PTR) file);
|
||||
|
||||
if (!bfd_close (abfd))
|
||||
{
|
||||
|
@ -299,7 +314,10 @@ strings_file (file)
|
|||
{
|
||||
FILE *stream;
|
||||
|
||||
stream = fopen (file, "r");
|
||||
stream = fopen (file, "rb");
|
||||
/* Not all systems permit "rb", so try "r" if it failed. */
|
||||
if (stream == NULL)
|
||||
stream = fopen (file, "r");
|
||||
if (stream == NULL)
|
||||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
|
@ -334,18 +352,18 @@ strings_file (file)
|
|||
|
||||
static void
|
||||
print_strings (filename, stream, address, stop_point, magiccount, magic)
|
||||
char *filename;
|
||||
const char *filename;
|
||||
FILE *stream;
|
||||
file_ptr address;
|
||||
int stop_point;
|
||||
int magiccount;
|
||||
char *magic;
|
||||
{
|
||||
int bufsize = 100;
|
||||
char *buf = (char *) xmalloc (bufsize);
|
||||
char *buf = (char *) xmalloc (string_min + 1);
|
||||
|
||||
while (1)
|
||||
{
|
||||
file_ptr start;
|
||||
int i;
|
||||
int c;
|
||||
|
||||
|
@ -353,6 +371,7 @@ print_strings (filename, stream, address, stop_point, magiccount, magic)
|
|||
tryline:
|
||||
if (stop_point && address >= stop_point)
|
||||
break;
|
||||
start = address;
|
||||
for (i = 0; i < string_min; i++)
|
||||
{
|
||||
if (magiccount)
|
||||
|
@ -365,7 +384,7 @@ print_strings (filename, stream, address, stop_point, magiccount, magic)
|
|||
if (stream == NULL)
|
||||
return;
|
||||
c = getc (stream);
|
||||
if (c < 0)
|
||||
if (c == EOF)
|
||||
return;
|
||||
}
|
||||
address++;
|
||||
|
@ -375,15 +394,32 @@ print_strings (filename, stream, address, stop_point, magiccount, magic)
|
|||
buf[i] = c;
|
||||
}
|
||||
|
||||
/* We found a run of `string_min' graphic characters.
|
||||
Now see if it is terminated with a NUL byte or a newline. */
|
||||
/* We found a run of `string_min' graphic characters. Print up
|
||||
to the next non-graphic character. */
|
||||
|
||||
if (print_filenames)
|
||||
printf ("%s: ", filename);
|
||||
if (print_addresses)
|
||||
switch (address_radix)
|
||||
{
|
||||
case 8:
|
||||
printf ("%7lo ", (unsigned long) start);
|
||||
break;
|
||||
|
||||
case 10:
|
||||
printf ("%7ld ", (long) start);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
printf ("%7lx ", (unsigned long) start);
|
||||
break;
|
||||
}
|
||||
|
||||
buf[i] = '\0';
|
||||
fputs (buf, stdout);
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (i == bufsize)
|
||||
{
|
||||
bufsize *= 2;
|
||||
buf = (char *) xrealloc (buf, bufsize);
|
||||
}
|
||||
if (magiccount)
|
||||
{
|
||||
magiccount--;
|
||||
|
@ -392,61 +428,17 @@ print_strings (filename, stream, address, stop_point, magiccount, magic)
|
|||
else
|
||||
{
|
||||
if (stream == NULL)
|
||||
return;
|
||||
break;
|
||||
c = getc (stream);
|
||||
if (c < 0)
|
||||
return;
|
||||
if (c == EOF)
|
||||
break;
|
||||
}
|
||||
address++;
|
||||
if (c == '\0' || c == '\n')
|
||||
break; /* It is; print this string. */
|
||||
if (!isgraphic (c))
|
||||
goto tryline; /* It isn't; give up on this string. */
|
||||
buf[i++] = c; /* The string continues; store it all. */
|
||||
if (! isgraphic (c))
|
||||
break;
|
||||
putchar (c);
|
||||
}
|
||||
|
||||
/* If we get here, the string is all graphics and properly terminated,
|
||||
so print it. It is all in `buf' and `i' is its length. */
|
||||
buf[i] = '\0';
|
||||
if (print_filenames)
|
||||
printf ("%s: ", filename);
|
||||
if (print_addresses)
|
||||
switch (address_radix)
|
||||
{
|
||||
case 8:
|
||||
printf ("%7lo ", (unsigned long) (address - i - 1));
|
||||
break;
|
||||
|
||||
case 10:
|
||||
printf ("%7ld ", (long) (address - i - 1));
|
||||
break;
|
||||
|
||||
case 16:
|
||||
printf ("%7lx ", (unsigned long) (address - i - 1));
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; (c = buf[i]) != '\0'; i++)
|
||||
switch (c)
|
||||
{
|
||||
case '\n':
|
||||
printf ("\\n");
|
||||
break;
|
||||
case '\t':
|
||||
printf ("\\t");
|
||||
break;
|
||||
case '\f':
|
||||
printf ("\\f");
|
||||
break;
|
||||
case '\b':
|
||||
printf ("\\b");
|
||||
break;
|
||||
case '\r':
|
||||
printf ("\\r");
|
||||
break;
|
||||
default:
|
||||
putchar (c);
|
||||
}
|
||||
putchar ('\n');
|
||||
}
|
||||
}
|
||||
|
@ -493,7 +485,7 @@ integer_arg (s)
|
|||
|
||||
if (*p)
|
||||
{
|
||||
fprintf (stderr, "%s: invalid integer argument %s\n", program_name, s);
|
||||
fprintf (stderr, _("%s: invalid integer argument %s\n"), program_name, s);
|
||||
exit (1);
|
||||
}
|
||||
return value;
|
||||
|
@ -504,10 +496,13 @@ usage (stream, status)
|
|||
FILE *stream;
|
||||
int status;
|
||||
{
|
||||
fprintf (stream, "\
|
||||
fprintf (stream, _("\
|
||||
Usage: %s [-afov] [-n min-len] [-min-len] [-t {o,x,d}] [-]\n\
|
||||
[--all] [--print-file-name] [--bytes=min-len] [--radix={o,x,d}]\n\
|
||||
[--target=bfdname] [--help] [--version] file...\n",
|
||||
[--target=bfdname] [--help] [--version] file...\n"),
|
||||
program_name);
|
||||
list_supported_targets (program_name, stream);
|
||||
if (status == 0)
|
||||
fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
|
||||
exit (status);
|
||||
}
|
||||
|
|
|
@ -1,21 +1,22 @@
|
|||
/* Sysroff object format dumper.
|
||||
Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994, 95, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
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 2 of the License, 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.
|
||||
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, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
|
||||
/* Written by Steve Chamberlain <sac@cygnus.com>.
|
||||
|
@ -23,19 +24,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|||
This program reads a SYSROFF object file and prints it in an
|
||||
almost human readable form to stdout. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <libiberty.h>
|
||||
#include <getopt.h>
|
||||
#include "sysroff.h"
|
||||
#include <stdlib.h>
|
||||
#include "sysdep.h"
|
||||
|
||||
#define PROGRAM_VERSION "1.0"
|
||||
static int h8300;
|
||||
static int sh;
|
||||
|
||||
static int dump = 1;
|
||||
static int segmented_p;
|
||||
static int code;
|
||||
static int addrsize = 4;
|
||||
static FILE *file;
|
||||
|
||||
static char *
|
||||
|
@ -43,7 +46,7 @@ xcalloc (a, b)
|
|||
int a;
|
||||
int b;
|
||||
{
|
||||
char *r = xmalloc (a, b);
|
||||
char *r = xmalloc (a * b);
|
||||
memset (r, 0, a * b);
|
||||
return r;
|
||||
}
|
||||
|
@ -130,7 +133,8 @@ fillup (ptr)
|
|||
}
|
||||
if (dump)
|
||||
dh (ptr, size);
|
||||
return size;
|
||||
|
||||
return size - 1;
|
||||
}
|
||||
|
||||
barray
|
||||
|
@ -168,7 +172,7 @@ getINT (ptr, idx, size, max)
|
|||
return 0;
|
||||
}
|
||||
if (size == -2)
|
||||
size = 4;
|
||||
size = addrsize;
|
||||
if (size == -1)
|
||||
size = 0;
|
||||
switch (size)
|
||||
|
@ -192,14 +196,17 @@ getINT (ptr, idx, size, max)
|
|||
}
|
||||
|
||||
int
|
||||
getBITS (ptr, idx, size)
|
||||
getBITS (ptr, idx, size, max)
|
||||
char *ptr;
|
||||
int *idx;
|
||||
int size;
|
||||
int size, max;
|
||||
{
|
||||
int byte = *idx / 8;
|
||||
int bit = *idx % 8;
|
||||
|
||||
if (byte >= max)
|
||||
return 0;
|
||||
|
||||
*idx += size;
|
||||
|
||||
return (ptr[byte] >> (8 - bit - size)) & ((1 << size) - 1);
|
||||
|
@ -305,6 +312,7 @@ getone (type)
|
|||
{
|
||||
struct IT_hd dummy;
|
||||
sysroff_swap_hd_in (&dummy);
|
||||
addrsize = dummy.afl;
|
||||
sysroff_print_hd_out (&dummy);
|
||||
}
|
||||
break;
|
||||
|
@ -484,6 +492,10 @@ opt (x)
|
|||
return getone (x);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/* This is no longer used. */
|
||||
|
||||
static void
|
||||
unit_info_list ()
|
||||
{
|
||||
|
@ -502,6 +514,12 @@ unit_info_list ()
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
/* This is no longer used. */
|
||||
|
||||
static void
|
||||
object_body_list ()
|
||||
{
|
||||
|
@ -514,6 +532,8 @@ object_body_list ()
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
must (x)
|
||||
int x;
|
||||
|
@ -541,7 +561,7 @@ tab (i, s)
|
|||
static void derived_type ();
|
||||
|
||||
static void
|
||||
symbol_info ()
|
||||
dump_symbol_info ()
|
||||
{
|
||||
tab (1, "SYMBOL INFO");
|
||||
while (opt (IT_dsy_CODE))
|
||||
|
@ -564,27 +584,27 @@ derived_type ()
|
|||
{
|
||||
if (opt (IT_dpp_CODE))
|
||||
{
|
||||
symbol_info ();
|
||||
dump_symbol_info ();
|
||||
must (IT_dpp_CODE);
|
||||
}
|
||||
else if (opt (IT_dfp_CODE))
|
||||
{
|
||||
symbol_info ();
|
||||
dump_symbol_info ();
|
||||
must (IT_dfp_CODE);
|
||||
}
|
||||
else if (opt (IT_den_CODE))
|
||||
{
|
||||
symbol_info ();
|
||||
dump_symbol_info ();
|
||||
must (IT_den_CODE);
|
||||
}
|
||||
else if (opt (IT_den_CODE))
|
||||
{
|
||||
symbol_info ();
|
||||
dump_symbol_info ();
|
||||
must (IT_den_CODE);
|
||||
}
|
||||
else if (opt (IT_dds_CODE))
|
||||
{
|
||||
symbol_info ();
|
||||
dump_symbol_info ();
|
||||
must (IT_dds_CODE);
|
||||
}
|
||||
else if (opt (IT_dar_CODE))
|
||||
|
@ -609,6 +629,10 @@ derived_type ()
|
|||
tab (-1, "");
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/* This is no longer used. */
|
||||
|
||||
static void
|
||||
program_structure ()
|
||||
{
|
||||
|
@ -617,12 +641,18 @@ program_structure ()
|
|||
{
|
||||
must (IT_dso_CODE);
|
||||
opt (IT_dss_CODE);
|
||||
symbol_info ();
|
||||
dump_symbol_info ();
|
||||
must (IT_dps_CODE);
|
||||
}
|
||||
tab (-1, "");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
/* This is no longer used. */
|
||||
|
||||
static void
|
||||
debug_list ()
|
||||
{
|
||||
|
@ -636,6 +666,8 @@ debug_list ()
|
|||
tab (-1, "");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
module ()
|
||||
{
|
||||
|
@ -687,14 +719,14 @@ show_usage (file, status)
|
|||
FILE *file;
|
||||
int status;
|
||||
{
|
||||
fprintf (file, "Usage: %s [-hV] in-file\n", program_name);
|
||||
fprintf (file, _("Usage: %s [-hV] in-file\n"), program_name);
|
||||
exit (status);
|
||||
}
|
||||
|
||||
static void
|
||||
show_help ()
|
||||
{
|
||||
printf ("%s: Print a human readable interpretation of a SYSROFF object file\n",
|
||||
printf (_("%s: Print a human readable interpretation of a SYSROFF object file\n"),
|
||||
program_name);
|
||||
show_usage (stdout, 0);
|
||||
}
|
||||
|
@ -724,7 +756,7 @@ main (ac, av)
|
|||
show_help ();
|
||||
/*NOTREACHED*/
|
||||
case 'V':
|
||||
printf ("GNU %s version %s\n", program_name, PROGRAM_VERSION);
|
||||
printf (_("GNU %s version %s\n"), program_name, PROGRAM_VERSION);
|
||||
exit (0);
|
||||
/*NOTREACHED*/
|
||||
case 0:
|
||||
|
@ -744,7 +776,7 @@ main (ac, av)
|
|||
|
||||
if (!input_file)
|
||||
{
|
||||
fprintf (stderr, "%s: no input file specified\n",
|
||||
fprintf (stderr, _("%s: no input file specified\n"),
|
||||
program_name);
|
||||
exit (1);
|
||||
}
|
||||
|
@ -752,7 +784,7 @@ main (ac, av)
|
|||
file = fopen (input_file, FOPEN_RB);
|
||||
if (!file)
|
||||
{
|
||||
fprintf (stderr, "%s: cannot open input file %s\n",
|
||||
fprintf (stderr, _("%s: cannot open input file %s\n"),
|
||||
program_name, input_file);
|
||||
exit (1);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* windres.c -- a program to manipulate Windows resources
|
||||
Copyright 1997 Free Software Foundation, Inc.
|
||||
Copyright 1997, 1998 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Cygnus Support.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
@ -44,6 +44,7 @@
|
|||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
|
||||
/* An enumeration of format types. */
|
||||
|
||||
|
@ -224,7 +225,7 @@ open_file_search (filename, mode, errmsg, real_filename)
|
|||
}
|
||||
}
|
||||
|
||||
fatal ("can't open %s `%s': %s", errmsg, filename, strerror (errno));
|
||||
fatal (_("can't open %s `%s': %s"), errmsg, filename, strerror (errno));
|
||||
|
||||
/* Return a value to avoid a compiler warning. */
|
||||
return NULL;
|
||||
|
@ -283,8 +284,50 @@ unicode_print (e, unicode, length)
|
|||
|
||||
++unicode;
|
||||
|
||||
if ((ch & 0x7f) == ch && isprint (ch))
|
||||
putc (ch, e);
|
||||
if ((ch & 0x7f) == ch)
|
||||
{
|
||||
if (ch == '\\')
|
||||
fputs ("\\", e);
|
||||
else if (isprint (ch))
|
||||
putc (ch, e);
|
||||
else
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case ESCAPE_A:
|
||||
fputs ("\\a", e);
|
||||
break;
|
||||
|
||||
case ESCAPE_B:
|
||||
fputs ("\\b", e);
|
||||
break;
|
||||
|
||||
case ESCAPE_F:
|
||||
fputs ("\\f", e);
|
||||
break;
|
||||
|
||||
case ESCAPE_N:
|
||||
fputs ("\\n", e);
|
||||
break;
|
||||
|
||||
case ESCAPE_R:
|
||||
fputs ("\\r", e);
|
||||
break;
|
||||
|
||||
case ESCAPE_T:
|
||||
fputs ("\\t", e);
|
||||
break;
|
||||
|
||||
case ESCAPE_V:
|
||||
fputs ("\\v", e);
|
||||
break;
|
||||
|
||||
default:
|
||||
fprintf (e, "\\%03o", (unsigned int) ch);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ((ch & 0xff) == ch)
|
||||
fprintf (e, "\\%03o", (unsigned int) ch);
|
||||
else
|
||||
|
@ -418,10 +461,17 @@ define_resource (resources, cids, ids, dupok)
|
|||
|
||||
if (*resources == NULL)
|
||||
{
|
||||
static unsigned long timeval;
|
||||
|
||||
/* Use the same timestamp for every resource created in a
|
||||
single run. */
|
||||
if (timeval == 0)
|
||||
timeval = time (NULL);
|
||||
|
||||
*resources = ((struct res_directory *)
|
||||
res_alloc (sizeof **resources));
|
||||
(*resources)->characteristics = 0;
|
||||
(*resources)->time = 0;
|
||||
(*resources)->time = timeval;
|
||||
(*resources)->major = 0;
|
||||
(*resources)->minor = 0;
|
||||
(*resources)->entries = NULL;
|
||||
|
@ -458,7 +508,7 @@ define_resource (resources, cids, ids, dupok)
|
|||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
res_ids_print (stderr, i, ids);
|
||||
fprintf (stderr, ": expected to be a directory\n");
|
||||
fprintf (stderr, _(": expected to be a directory\n"));
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
|
@ -470,7 +520,7 @@ define_resource (resources, cids, ids, dupok)
|
|||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
res_ids_print (stderr, cids, ids);
|
||||
fprintf (stderr, ": expected to be a leaf\n");
|
||||
fprintf (stderr, _(": expected to be a leaf\n"));
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
|
@ -479,9 +529,9 @@ define_resource (resources, cids, ids, dupok)
|
|||
if (dupok)
|
||||
return re->u.res;
|
||||
|
||||
fprintf (stderr, "%s: warning: ", program_name);
|
||||
fprintf (stderr, _("%s: warning: "), program_name);
|
||||
res_ids_print (stderr, cids, ids);
|
||||
fprintf (stderr, ": duplicate value\n");
|
||||
fprintf (stderr, _(": duplicate value\n"));
|
||||
}
|
||||
|
||||
re->u.res = ((struct res_resource *)
|
||||
|
@ -644,8 +694,8 @@ format_from_name (name)
|
|||
|
||||
if (m->name == NULL)
|
||||
{
|
||||
fprintf (stderr, "%s: unknown format type `%s'\n", program_name, name);
|
||||
fprintf (stderr, "%s: supported formats:", program_name);
|
||||
fprintf (stderr, _("%s: unknown format type `%s'\n"), program_name, name);
|
||||
fprintf (stderr, _("%s: supported formats:"), program_name);
|
||||
for (m = format_names; m->name != NULL; m++)
|
||||
fprintf (stderr, " %s", m->name);
|
||||
fprintf (stderr, "\n");
|
||||
|
@ -732,7 +782,7 @@ format_from_filename (filename, input)
|
|||
return RES_FORMAT_RC;
|
||||
|
||||
/* Otherwise, we give up. */
|
||||
fatal ("can not determine type of file `%s'; use the -I option",
|
||||
fatal (_("can not determine type of file `%s'; use the -I option"),
|
||||
filename);
|
||||
|
||||
/* Return something to silence the compiler warning. */
|
||||
|
@ -746,9 +796,9 @@ usage (stream, status)
|
|||
FILE *stream;
|
||||
int status;
|
||||
{
|
||||
fprintf (stream, "Usage: %s [options] [input-file] [output-file]\n",
|
||||
fprintf (stream, _("Usage: %s [options] [input-file] [output-file]\n"),
|
||||
program_name);
|
||||
fprintf (stream, "\
|
||||
fprintf (stream, _("\
|
||||
Options:\n\
|
||||
-i FILE, --input FILE Name input file\n\
|
||||
-o FILE, --output FILE Name output file\n\
|
||||
|
@ -760,21 +810,21 @@ Options:\n\
|
|||
--preprocessor PROGRAM Program to use to preprocess rc file\n\
|
||||
--include-dir DIR Include directory when preprocessing rc file\n\
|
||||
--define SYM[=VAL] Define SYM when preprocessing rc file\n\
|
||||
--language VAL Set language when reading rc file\n");
|
||||
--language VAL Set language when reading rc file\n"));
|
||||
#ifdef YYDEBUG
|
||||
fprintf (stream, "\
|
||||
--yydebug Turn on parser debugging\n");
|
||||
fprintf (stream, _("\
|
||||
--yydebug Turn on parser debugging\n"));
|
||||
#endif
|
||||
fprintf (stream, "\
|
||||
fprintf (stream, _("\
|
||||
--help Print this help message\n\
|
||||
--version Print version information\n");
|
||||
fprintf (stream, "\
|
||||
--version Print version information\n"));
|
||||
fprintf (stream, _("\
|
||||
FORMAT is one of rc, res, or coff, and is deduced from the file name\n\
|
||||
extension if not specified. A single file name is an input file.\n\
|
||||
No input-file is stdin, default rc. No output-file is stdout, default rc.\n");
|
||||
No input-file is stdin, default rc. No output-file is stdout, default rc.\n"));
|
||||
list_supported_targets (program_name, stream);
|
||||
if (status == 0)
|
||||
fprintf (stream, "Report bugs to bug-gnu-utils@prep.ai.mit.edu\n");
|
||||
fprintf (stream, _("Report bugs to bug-gnu-utils@gnu.org\n"));
|
||||
exit (status);
|
||||
}
|
||||
|
||||
|
@ -963,7 +1013,7 @@ main (argc, argv)
|
|||
}
|
||||
|
||||
if (resources == NULL)
|
||||
fatal ("no resources");
|
||||
fatal (_("no resources"));
|
||||
|
||||
/* Sort the resources. This is required for COFF, convenient for
|
||||
rc, and unimportant for res. */
|
||||
|
@ -997,7 +1047,7 @@ struct res_directory *
|
|||
read_res_file (filename)
|
||||
const char *filename;
|
||||
{
|
||||
fatal ("read_res_file unimplemented");
|
||||
fatal (_("read_res_file unimplemented"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1006,5 +1056,5 @@ write_res_file (filename, resources)
|
|||
const char *filename;
|
||||
const struct res_directory *resources;
|
||||
{
|
||||
fatal ("write_res_file unimplemented");
|
||||
fatal (_("write_res_file unimplemented"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue