forked from Imagelibrary/binutils-gdb
Compare commits
118 Commits
users/jema
...
gdb_5_1-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c819cbe5d3 | ||
|
|
40ad0c351e | ||
|
|
a8a4f89c62 | ||
|
|
7849c9dd8e | ||
|
|
3739b3303f | ||
|
|
67230682c4 | ||
|
|
38df2fc074 | ||
|
|
76af254b25 | ||
|
|
68f4792eec | ||
|
|
51850f42d2 | ||
|
|
be68037199 | ||
|
|
ac78cdc88d | ||
|
|
f3cc27d85e | ||
|
|
46a76ac4af | ||
|
|
d4825b1e03 | ||
|
|
ce8f86fd31 | ||
|
|
c5599c1ac8 | ||
|
|
c91171adad | ||
|
|
5a8a97a5a2 | ||
|
|
9744276968 | ||
|
|
0888bdbe91 | ||
|
|
887446f470 | ||
|
|
9061a35ed4 | ||
|
|
a07ef34607 | ||
|
|
8af8ea9407 | ||
|
|
4589cc1178 | ||
|
|
46f6149348 | ||
|
|
ce1c0423d8 | ||
|
|
f00f9bf546 | ||
|
|
d1f540779b | ||
|
|
98e0561b27 | ||
|
|
c92abdfd3e | ||
|
|
02f41ae2a0 | ||
|
|
61ae01deb6 | ||
|
|
a1464e876b | ||
|
|
25a24eb872 | ||
|
|
d6f78a0173 | ||
|
|
fccc511dda | ||
|
|
e7520555f2 | ||
|
|
2aedafe00b | ||
|
|
be172bfead | ||
|
|
d42688f43b | ||
|
|
bbea807ab4 | ||
|
|
cdd37fd81b | ||
|
|
5eed6fc8fd | ||
|
|
06daf47682 | ||
|
|
8acf75bf4d | ||
|
|
770e2d29c6 | ||
|
|
5f9ae39fea | ||
|
|
aa13b66e07 | ||
|
|
3f725dc306 | ||
|
|
651a3d3bd2 | ||
|
|
daafd1526b | ||
|
|
6f7d030dca | ||
|
|
2cad0dcfb0 | ||
|
|
500401816a | ||
|
|
185ae1844d | ||
|
|
e16cce925e | ||
|
|
dcf2346921 | ||
|
|
dc41f87dd1 | ||
|
|
c41b04e840 | ||
|
|
916747aab7 | ||
|
|
e80d914623 | ||
|
|
1306375669 | ||
|
|
6445ec4f05 | ||
|
|
9a7d07a670 | ||
|
|
6e12b9131a | ||
|
|
da825dc05d | ||
|
|
19e76be6a1 | ||
|
|
178a0d705d | ||
|
|
e02ceddd6d | ||
|
|
0d2bf6ae93 | ||
|
|
3f63b48a76 | ||
|
|
c5c9a6957e | ||
|
|
0a5d7ab28d | ||
|
|
e3bf0facc1 | ||
|
|
83ac78c06a | ||
|
|
57d5edf012 | ||
|
|
86c9f35dcf | ||
|
|
ff0351b45a | ||
|
|
bdbfae3be9 | ||
|
|
7a9032024f | ||
|
|
b8a6375048 | ||
|
|
8e9f4e55a6 | ||
|
|
fe603513f1 | ||
|
|
3123df11a1 | ||
|
|
c2e7429140 | ||
|
|
87dc03378a | ||
|
|
b174919216 | ||
|
|
b1fc178bec | ||
|
|
15a1b8bebf | ||
|
|
5e10630696 | ||
|
|
0116e2ed2a | ||
|
|
a87d7732a8 | ||
|
|
f8cd90fb9c | ||
|
|
d1984822f8 | ||
|
|
6501e46a92 | ||
|
|
567b554e81 | ||
|
|
fd353407e4 | ||
|
|
b7e1b32186 | ||
|
|
86aeb884af | ||
|
|
289fa7a793 | ||
|
|
abdb9ed2b5 | ||
|
|
3ad8615719 | ||
|
|
880282d8b0 | ||
|
|
77466cf990 | ||
|
|
55d40c3510 | ||
|
|
8c36dd3b82 | ||
|
|
60c34f75b1 | ||
|
|
becb108f58 | ||
|
|
51f0a7e932 | ||
|
|
66ed9c0a4d | ||
|
|
9b6c6c5413 | ||
|
|
378247c0e2 | ||
|
|
c125fc0c5c | ||
|
|
1a4a0cfa80 | ||
|
|
7dca4b7499 | ||
|
|
3221ea0d16 |
@@ -1,3 +1,12 @@
|
||||
2001-11-11 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
From Denis Joseph Barrow:
|
||||
* config.sub: Map s390 and s390x onto s390-ibm and s390x-ibm.
|
||||
|
||||
2001-10-03 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* gettext.m4: Test po/POTFILES.in exists before trying to read.
|
||||
|
||||
2001-07-26 DJ Delorie <dj@redhat.com>
|
||||
|
||||
* MAINTAINERS: Clarify libiberty merge rules and procedures.
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
2001-11-18 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* po/Make-in (distclean): Don't delete SRC-POTFILES.in or
|
||||
BLD-POTFILES.in. Work around bug in BFD's distclean.
|
||||
|
||||
2001-10-30 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* configure, op/SRC-POTFILES.in, po/bfd.pot: Regenerate.
|
||||
|
||||
2001-07-30 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
|
||||
|
||||
* libecoff.h (_bfd_ecoff_styp_to_sec_flags): Changed return type
|
||||
to match corresponding bfd_coff_backend data member.
|
||||
|
||||
2001-07-24 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* Makefile.am: Update dependencies with "make dep-am".
|
||||
|
||||
541
bfd/configure
vendored
541
bfd/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -340,7 +340,7 @@ extern PTR _bfd_ecoff_mkobject_hook PARAMS ((bfd *, PTR filehdr, PTR aouthdr));
|
||||
#define _bfd_ecoff_set_alignment_hook \
|
||||
((void (*) PARAMS ((bfd *, asection *, PTR))) bfd_void)
|
||||
extern boolean _bfd_ecoff_set_arch_mach_hook PARAMS ((bfd *abfd, PTR filehdr));
|
||||
extern flagword _bfd_ecoff_styp_to_sec_flags
|
||||
extern boolean _bfd_ecoff_styp_to_sec_flags
|
||||
PARAMS ((bfd *, PTR, const char *, asection *, flagword *));
|
||||
extern boolean _bfd_ecoff_slurp_symbol_table PARAMS ((bfd *abfd));
|
||||
|
||||
|
||||
@@ -203,9 +203,15 @@ mostlyclean:
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
# FIXME: cagney/2001-11-18: When configuring / building in the source
|
||||
# directory, the rule below would delete SRC-POTFILES.in and
|
||||
# BLD-POTFILES.in from that source directory. While a make rebuilds
|
||||
# these files it also puts them in the source directory and that can
|
||||
# be read-only.
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.in *.mo *.msg *.cat *.cat.m
|
||||
rm -f SRC-POTFILES BLD-POTFILES SRC-POTFILES.in BLD-POTFILES.in
|
||||
rm -f SRC-POTFILES BLD-POTFILES
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
aix386-core.c
|
||||
aout0.c
|
||||
aout32.c
|
||||
aout64.c
|
||||
aout-adobe.c
|
||||
aout-arm.c
|
||||
aout-cris.c
|
||||
aoutf1.h
|
||||
aout-ns32k.c
|
||||
aout-sparcle.c
|
||||
aout-target.h
|
||||
aout-tic30.c
|
||||
aout0.c
|
||||
aout32.c
|
||||
aout64.c
|
||||
aoutf1.h
|
||||
aoutx.h
|
||||
archive.c
|
||||
archures.c
|
||||
@@ -22,21 +22,17 @@ cf-i386lynx.c
|
||||
cf-m68klynx.c
|
||||
cf-sparclynx.c
|
||||
cisco-core.c
|
||||
coff64-rs6000.c
|
||||
coff-a29k.c
|
||||
coff-alpha.c
|
||||
coff-apollo.c
|
||||
coff-arm.c
|
||||
coff-aux.c
|
||||
coffcode.h
|
||||
coffgen.c
|
||||
coff-go32.c
|
||||
coff-h8300.c
|
||||
coff-h8500.c
|
||||
coff-i386.c
|
||||
coff-i860.c
|
||||
coff-i960.c
|
||||
cofflink.c
|
||||
coff-m68k.c
|
||||
coff-m88k.c
|
||||
coff-mips.c
|
||||
@@ -45,7 +41,6 @@ coff-sh.c
|
||||
coff-sparc.c
|
||||
coff-stgo32.c
|
||||
coff-svm68k.c
|
||||
coffswap.h
|
||||
coff-tic30.c
|
||||
coff-tic54x.c
|
||||
coff-tic80.c
|
||||
@@ -53,6 +48,11 @@ coff-u68k.c
|
||||
coff-w65.c
|
||||
coff-we32k.c
|
||||
coff-z8k.c
|
||||
coff64-rs6000.c
|
||||
coffcode.h
|
||||
coffgen.c
|
||||
cofflink.c
|
||||
coffswap.h
|
||||
corefile.c
|
||||
cpu-a29k.c
|
||||
cpu-alpha.c
|
||||
@@ -105,10 +105,14 @@ ecofflink.c
|
||||
ecoffswap.h
|
||||
efi-app-ia32.c
|
||||
efi-app-ia64.c
|
||||
elf-bfd.h
|
||||
elf-hppa.h
|
||||
elf-m10200.c
|
||||
elf-m10300.c
|
||||
elf.c
|
||||
elf32-arc.c
|
||||
elf32-arm.h
|
||||
elf32-avr.c
|
||||
elf32.c
|
||||
elf32-cris.c
|
||||
elf32-d10v.c
|
||||
elf32-d30v.c
|
||||
@@ -131,12 +135,12 @@ elf32-openrisc.c
|
||||
elf32-pj.c
|
||||
elf32-ppc.c
|
||||
elf32-s390.c
|
||||
elf32-sh.c
|
||||
elf32-sh-lin.c
|
||||
elf32-sh.c
|
||||
elf32-sparc.c
|
||||
elf32-v850.c
|
||||
elf32.c
|
||||
elf64-alpha.c
|
||||
elf64.c
|
||||
elf64-gen.c
|
||||
elf64-hppa.c
|
||||
elf64-hppa.h
|
||||
@@ -144,17 +148,13 @@ elf64-mips.c
|
||||
elf64-s390.c
|
||||
elf64-sparc.c
|
||||
elf64-x86-64.c
|
||||
elf64.c
|
||||
elfarm-nabi.c
|
||||
elfarm-oabi.c
|
||||
elf-bfd.h
|
||||
elf.c
|
||||
elfcode.h
|
||||
elfcore.h
|
||||
elf-hppa.h
|
||||
elflink.c
|
||||
elflink.h
|
||||
elf-m10200.c
|
||||
elf-m10300.c
|
||||
epoc-pe-arm.c
|
||||
epoc-pei-arm.c
|
||||
format.c
|
||||
@@ -201,16 +201,16 @@ merge.c
|
||||
mipsbsd.c
|
||||
netbsd.h
|
||||
newsos3.c
|
||||
nlm-target.h
|
||||
nlm.c
|
||||
nlm32-alpha.c
|
||||
nlm32.c
|
||||
nlm32-i386.c
|
||||
nlm32-ppc.c
|
||||
nlm32-sparc.c
|
||||
nlm32.c
|
||||
nlm64.c
|
||||
nlm.c
|
||||
nlmcode.h
|
||||
nlmswap.h
|
||||
nlm-target.h
|
||||
ns32k.h
|
||||
ns32knetbsd.c
|
||||
oasys.c
|
||||
@@ -220,20 +220,20 @@ pc532-mach.c
|
||||
pdp11.c
|
||||
pe-arm.c
|
||||
pe-i386.c
|
||||
pe-mcore.c
|
||||
pe-mips.c
|
||||
pe-ppc.c
|
||||
pe-sh.c
|
||||
pei-arm.c
|
||||
peicode.h
|
||||
pei-i386.c
|
||||
pei-mcore.c
|
||||
pei-mips.c
|
||||
pei-ppc.c
|
||||
pei-sh.c
|
||||
pe-mcore.c
|
||||
pe-mips.c
|
||||
pe-ppc.c
|
||||
pe-sh.c
|
||||
peicode.h
|
||||
ppcboot.c
|
||||
reloc16.c
|
||||
reloc.c
|
||||
reloc16.c
|
||||
riscix.c
|
||||
sco5-core.c
|
||||
section.c
|
||||
@@ -243,8 +243,8 @@ sparclinux.c
|
||||
sparclynx.c
|
||||
sparcnetbsd.c
|
||||
srec.c
|
||||
stabs.c
|
||||
stab-syms.c
|
||||
stabs.c
|
||||
sunos.c
|
||||
syms.c
|
||||
targets.c
|
||||
@@ -252,11 +252,11 @@ tekhex.c
|
||||
trad-core.c
|
||||
vaxnetbsd.c
|
||||
versados.c
|
||||
vms.c
|
||||
vms-gsd.c
|
||||
vms.h
|
||||
vms-hdr.c
|
||||
vms-misc.c
|
||||
vms-tir.c
|
||||
xcofflink.c
|
||||
vms.c
|
||||
vms.h
|
||||
xcoff-target.h
|
||||
xcofflink.c
|
||||
|
||||
566
bfd/po/bfd.pot
566
bfd/po/bfd.pot
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2001-06-13 12:48+0100\n"
|
||||
"POT-Creation-Date: 2001-10-30 20:55-0500\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -167,21 +167,6 @@ msgstr ""
|
||||
msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx."
|
||||
msgstr ""
|
||||
|
||||
#: coff-rs6000.c:2517 coff64-rs6000.c:1074
|
||||
#, c-format
|
||||
msgid "%s: unsupported relocation type 0x%02x"
|
||||
msgstr ""
|
||||
|
||||
#: coff-rs6000.c:2563 coff64-rs6000.c:1120
|
||||
#, c-format
|
||||
msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
|
||||
msgstr ""
|
||||
|
||||
#: coff-rs6000.c:2809 coff64-rs6000.c:1955
|
||||
#, c-format
|
||||
msgid "%s: symbol `%s' has unrecognized smclas %d"
|
||||
msgstr ""
|
||||
|
||||
#: coff-a29k.c:123
|
||||
msgid "Missing IHCONST"
|
||||
msgstr ""
|
||||
@@ -206,7 +191,7 @@ msgstr ""
|
||||
msgid "GP relative relocation used when GP not defined"
|
||||
msgstr ""
|
||||
|
||||
#: coff-alpha.c:1487 elf64-alpha.c:4045
|
||||
#: coff-alpha.c:1487 elf64-alpha.c:4047
|
||||
msgid "using multiple gp values"
|
||||
msgstr ""
|
||||
|
||||
@@ -243,7 +228,7 @@ msgstr ""
|
||||
msgid " consider relinking with --support-old-code enabled"
|
||||
msgstr ""
|
||||
|
||||
#: coff-arm.c:1732 coff-tic80.c:682 cofflink.c:2992
|
||||
#: coff-arm.c:1732 coff-tic80.c:682 cofflink.c:3007
|
||||
#, c-format
|
||||
msgid "%s: bad reloc address 0x%lx in section `%s'"
|
||||
msgstr ""
|
||||
@@ -341,6 +326,58 @@ msgstr ""
|
||||
msgid "Warning: Clearing the interworking flag of %s due to outside request"
|
||||
msgstr ""
|
||||
|
||||
#: coff-i960.c:136 coff-i960.c:485
|
||||
msgid "uncertain calling convention for non-COFF symbol"
|
||||
msgstr ""
|
||||
|
||||
#: coff-m68k.c:475 coff-mips.c:2432 elf32-m68k.c:2272
|
||||
msgid "unsupported reloc type"
|
||||
msgstr ""
|
||||
|
||||
#: coff-mips.c:875 elf32-mips.c:1439
|
||||
msgid "GP relative relocation when _gp not defined"
|
||||
msgstr ""
|
||||
|
||||
#. No other sections should appear in -membedded-pic
|
||||
#. code.
|
||||
#: coff-mips.c:2469
|
||||
msgid "reloc against unsupported section"
|
||||
msgstr ""
|
||||
|
||||
#: coff-mips.c:2477
|
||||
msgid "reloc not properly aligned"
|
||||
msgstr ""
|
||||
|
||||
#: coff-rs6000.c:2517 coff64-rs6000.c:1074
|
||||
#, c-format
|
||||
msgid "%s: unsupported relocation type 0x%02x"
|
||||
msgstr ""
|
||||
|
||||
#: coff-rs6000.c:2563 coff64-rs6000.c:1120
|
||||
#, c-format
|
||||
msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry"
|
||||
msgstr ""
|
||||
|
||||
#: coff-rs6000.c:2809 coff64-rs6000.c:1955
|
||||
#, c-format
|
||||
msgid "%s: symbol `%s' has unrecognized smclas %d"
|
||||
msgstr ""
|
||||
|
||||
#: coff-tic54x.c:263 coff-tic80.c:445
|
||||
#, c-format
|
||||
msgid "Unrecognized reloc type 0x%x"
|
||||
msgstr ""
|
||||
|
||||
#: coff-tic54x.c:376 coffcode.h:4868
|
||||
#, c-format
|
||||
msgid "%s: warning: illegal symbol index %ld in relocs"
|
||||
msgstr ""
|
||||
|
||||
#: coff-w65.c:369
|
||||
#, c-format
|
||||
msgid "ignoring reloc %s\n"
|
||||
msgstr ""
|
||||
|
||||
#: coffcode.h:1073
|
||||
#, c-format
|
||||
msgid "%s (%s): Section flag %s (0x%x) ignored"
|
||||
@@ -371,11 +408,6 @@ msgstr ""
|
||||
msgid "warning: %s: local symbol `%s' has no section"
|
||||
msgstr ""
|
||||
|
||||
#: coff-tic54x.c:376 coffcode.h:4868
|
||||
#, c-format
|
||||
msgid "%s: warning: illegal symbol index %ld in relocs"
|
||||
msgstr ""
|
||||
|
||||
#: coffcode.h:4906
|
||||
#, c-format
|
||||
msgid "%s: illegal relocation type %d at address 0x%lx"
|
||||
@@ -391,58 +423,26 @@ msgstr ""
|
||||
msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld"
|
||||
msgstr ""
|
||||
|
||||
#: coff-i960.c:136 coff-i960.c:485
|
||||
msgid "uncertain calling convention for non-COFF symbol"
|
||||
msgstr ""
|
||||
|
||||
#: cofflink.c:527 elflink.h:1651
|
||||
#: cofflink.c:527 elflink.h:1652
|
||||
#, c-format
|
||||
msgid "Warning: type of symbol `%s' changed from %d to %d in %s"
|
||||
msgstr ""
|
||||
|
||||
#: cofflink.c:2290
|
||||
#: cofflink.c:2305
|
||||
#, c-format
|
||||
msgid "%s: relocs in section `%s', but it has no contents"
|
||||
msgstr ""
|
||||
|
||||
#: cofflink.c:2629 coffswap.h:895
|
||||
#: cofflink.c:2644 coffswap.h:895
|
||||
#, c-format
|
||||
msgid "%s: %s: reloc overflow: 0x%lx > 0xffff"
|
||||
msgstr ""
|
||||
|
||||
#: cofflink.c:2638 coffswap.h:881
|
||||
#: cofflink.c:2653 coffswap.h:881
|
||||
#, c-format
|
||||
msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff"
|
||||
msgstr ""
|
||||
|
||||
#: coff-m68k.c:475 coff-mips.c:2432 elf32-m68k.c:2272
|
||||
msgid "unsupported reloc type"
|
||||
msgstr ""
|
||||
|
||||
#: coff-mips.c:875 elf32-mips.c:1435
|
||||
msgid "GP relative relocation when _gp not defined"
|
||||
msgstr ""
|
||||
|
||||
#. No other sections should appear in -membedded-pic
|
||||
#. code.
|
||||
#: coff-mips.c:2469
|
||||
msgid "reloc against unsupported section"
|
||||
msgstr ""
|
||||
|
||||
#: coff-mips.c:2477
|
||||
msgid "reloc not properly aligned"
|
||||
msgstr ""
|
||||
|
||||
#: coff-tic54x.c:263 coff-tic80.c:445
|
||||
#, c-format
|
||||
msgid "Unrecognized reloc type 0x%x"
|
||||
msgstr ""
|
||||
|
||||
#: coff-w65.c:369
|
||||
#, c-format
|
||||
msgid "ignoring reloc %s\n"
|
||||
msgstr ""
|
||||
|
||||
#: dwarf2.c:424
|
||||
msgid "Dwarf Error: Can't find .debug_abbrev section."
|
||||
msgstr ""
|
||||
@@ -560,16 +560,6 @@ msgid ""
|
||||
" Type: %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-arm.h:1191
|
||||
#, c-format
|
||||
msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'."
|
||||
msgstr ""
|
||||
|
||||
#: elf32-arm.h:1387
|
||||
#, c-format
|
||||
msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'."
|
||||
msgstr ""
|
||||
|
||||
#: elf-hppa.h:1369 elf-hppa.h:1402 elf32-arm.h:1877 elf32-ppc.c:3093
|
||||
#: elf32-s390.c:1442 elf32-sh.c:3107 elf64-s390.c:1431 elf64-x86-64.c:1296
|
||||
#, c-format
|
||||
@@ -585,7 +575,7 @@ msgstr ""
|
||||
|
||||
#: elf-m10200.c:455 elf-m10300.c:667 elf32-arm.h:1955 elf32-avr.c:846
|
||||
#: elf32-cris.c:1339 elf32-d10v.c:482 elf32-fr30.c:652 elf32-i860.c:1053
|
||||
#: elf32-m32r.c:1270 elf32-mips.c:7049 elf32-openrisc.c:453 elf32-v850.c:1685
|
||||
#: elf32-m32r.c:1270 elf32-mips.c:7057 elf32-openrisc.c:453 elf32-v850.c:1685
|
||||
msgid "internal error: unsupported relocation error"
|
||||
msgstr ""
|
||||
|
||||
@@ -600,6 +590,109 @@ msgstr ""
|
||||
msgid "internal error: unknown error"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:330
|
||||
#, c-format
|
||||
msgid "%s: invalid string offset %u >= %lu for section `%s'"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:590
|
||||
msgid ""
|
||||
"\n"
|
||||
"Program Header:\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:638
|
||||
msgid ""
|
||||
"\n"
|
||||
"Dynamic Section:\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:767
|
||||
msgid ""
|
||||
"\n"
|
||||
"Version definitions:\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:790
|
||||
msgid ""
|
||||
"\n"
|
||||
"Version References:\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:795
|
||||
#, c-format
|
||||
msgid " required from %s:\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:1385
|
||||
#, c-format
|
||||
msgid "%s: invalid link %lu for reloc section %s (index %u)"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:2146
|
||||
#, c-format
|
||||
msgid ""
|
||||
"creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = "
|
||||
"0x%.8lx\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:2749
|
||||
#, c-format
|
||||
msgid "%s: Not enough room for program headers (allocated %u, need %u)"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:2848
|
||||
#, c-format
|
||||
msgid "%s: Not enough room for program headers, try linking with -N"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:2974
|
||||
#, c-format
|
||||
msgid "Error: First section in segment (%s) starts at 0x%x"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:2977
|
||||
#, c-format
|
||||
msgid " whereas segment starts at 0x%x"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:3250
|
||||
#, c-format
|
||||
msgid "%s: warning: allocated section `%s' not in segment"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:3655
|
||||
#, c-format
|
||||
msgid "%s: symbol `%s' required but not present"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:3664
|
||||
#, c-format
|
||||
msgid ""
|
||||
"elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = "
|
||||
"0x%.8lx%s\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:3905
|
||||
#, c-format
|
||||
msgid "%s: warning: Empty loadable segment detected\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:5290
|
||||
#, c-format
|
||||
msgid "%s: unsupported relocation type %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-arm.h:1191
|
||||
#, c-format
|
||||
msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'."
|
||||
msgstr ""
|
||||
|
||||
#: elf32-arm.h:1387
|
||||
#, c-format
|
||||
msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'."
|
||||
msgstr ""
|
||||
|
||||
#: elf32-arm.h:1991
|
||||
#, c-format
|
||||
msgid ""
|
||||
@@ -681,7 +774,7 @@ msgstr ""
|
||||
|
||||
#. Ignore init flag - it may not be set, despite the flags field
|
||||
#. containing valid data.
|
||||
#: elf32-arm.h:2217 elf32-cris.c:2968 elf32-m68k.c:430 elf32-mips.c:2721
|
||||
#: elf32-arm.h:2217 elf32-cris.c:2968 elf32-m68k.c:430 elf32-mips.c:2728
|
||||
#, c-format
|
||||
msgid "private flags = %lx:"
|
||||
msgstr ""
|
||||
@@ -837,90 +930,90 @@ msgstr ""
|
||||
msgid "%s: Relocations in generic ELF (EM: %d)"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:633
|
||||
#: elf32-hppa.c:624
|
||||
#, c-format
|
||||
msgid "%s(%s+0x%lx): cannot find stub entry %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:694
|
||||
#: elf32-hppa.c:685
|
||||
#, c-format
|
||||
msgid "%s: cannot create stub entry %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:888
|
||||
#: elf32-hppa.c:879
|
||||
#, c-format
|
||||
msgid "%s(%s+0x%lx): cannot relocate %s, recompile with -ffunction-sections"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:901 elf32-hppa.c:1615
|
||||
#: elf32-hppa.c:892 elf32-hppa.c:1605
|
||||
#, c-format
|
||||
msgid "Could not find relocation section for %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:1046 elf32-hppa.c:3510
|
||||
#: elf32-hppa.c:1037 elf32-hppa.c:3514
|
||||
#, c-format
|
||||
msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:1386
|
||||
#: elf32-hppa.c:1377
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s: relocation %s can not be used when making a shared object; recompile "
|
||||
"with -fPIC"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:1406
|
||||
#: elf32-hppa.c:1397
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s: relocation %s should not be used when making a shared object; recompile "
|
||||
"with -fPIC"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:2811
|
||||
#: elf32-hppa.c:2815
|
||||
#, c-format
|
||||
msgid "%s: duplicate export stub %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:3394
|
||||
#: elf32-hppa.c:3398
|
||||
#, c-format
|
||||
msgid "%s(%s+0x%lx): fixing %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:4032
|
||||
#: elf32-hppa.c:4052
|
||||
#, c-format
|
||||
msgid "%s(%s+0x%lx): cannot handle %s for %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-hppa.c:4355
|
||||
#: elf32-hppa.c:4375
|
||||
msgid ".got section not immediately after .plt section"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-i386.c:280
|
||||
#: elf32-i386.c:278
|
||||
#, c-format
|
||||
msgid "%s: invalid relocation type %d"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-i386.c:577
|
||||
#: elf32-i386.c:572
|
||||
#, c-format
|
||||
msgid "%s(%s): bad symbol index: %d"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-i386.c:582
|
||||
#: elf32-i386.c:577
|
||||
#, c-format
|
||||
msgid "%s: bad symbol index: %d"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-i386.c:735 elf32-i386.c:1759
|
||||
#: elf32-i386.c:737 elf32-i386.c:1748
|
||||
#, c-format
|
||||
msgid "%s(%s): bad relocation section name `%s'"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-i386.c:740 elf32-i386.c:1764
|
||||
#: elf32-i386.c:742 elf32-i386.c:1754
|
||||
#, c-format
|
||||
msgid "%s: bad relocation section name `%s'"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-i386.c:1562
|
||||
#: elf32-i386.c:1839
|
||||
#, c-format
|
||||
msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'"
|
||||
msgstr ""
|
||||
@@ -929,7 +1022,7 @@ msgstr ""
|
||||
msgid "SDA relocation when _SDA_BASE_ not defined"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:3416 elf32-m32r.c:1001 elf32-ppc.c:2960 elf64-ia64.c:3416
|
||||
#: elf32-ia64.c:3424 elf32-m32r.c:1001 elf32-ppc.c:2960 elf64-ia64.c:3424
|
||||
#, c-format
|
||||
msgid "%s: unknown relocation type %d"
|
||||
msgstr ""
|
||||
@@ -971,141 +1064,141 @@ msgstr ""
|
||||
msgid "%s: Unknown relocation type %d\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:1594
|
||||
#: elf32-mips.c:1598
|
||||
msgid "32bits gp relative relocation occurs for an external symbol"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:1743
|
||||
#: elf32-mips.c:1747
|
||||
#, c-format
|
||||
msgid "Linking mips16 objects into %s format is not supported"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2608
|
||||
#: elf32-mips.c:2615
|
||||
#, c-format
|
||||
msgid "%s: linking PIC files with non-PIC files"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2618
|
||||
#: elf32-mips.c:2625
|
||||
#, c-format
|
||||
msgid "%s: linking abicalls files with non-abicalls files"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2647
|
||||
#: elf32-mips.c:2654
|
||||
#, c-format
|
||||
msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2656
|
||||
#: elf32-mips.c:2663
|
||||
#, c-format
|
||||
msgid "%s: ISA mismatch (%d) with previous modules (%d)"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2679
|
||||
#: elf32-mips.c:2686
|
||||
#, c-format
|
||||
msgid "%s: ABI mismatch: linking %s module with previous %s modules"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2693 elf32-ppc.c:1478 elf64-sparc.c:2997
|
||||
#: elf32-mips.c:2700 elf32-ppc.c:1478 elf64-sparc.c:2993
|
||||
#, c-format
|
||||
msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2724
|
||||
#: elf32-mips.c:2731
|
||||
msgid " [abi=O32]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2726
|
||||
#: elf32-mips.c:2733
|
||||
msgid " [abi=O64]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2728
|
||||
#: elf32-mips.c:2735
|
||||
msgid " [abi=EABI32]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2730
|
||||
#: elf32-mips.c:2737
|
||||
msgid " [abi=EABI64]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2732
|
||||
#: elf32-mips.c:2739
|
||||
msgid " [abi unknown]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2734
|
||||
#: elf32-mips.c:2741
|
||||
msgid " [abi=N32]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2736
|
||||
#: elf32-mips.c:2743
|
||||
msgid " [abi=64]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2738
|
||||
#: elf32-mips.c:2745
|
||||
msgid " [no abi set]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2741
|
||||
#: elf32-mips.c:2748
|
||||
msgid " [mips1]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2743
|
||||
#: elf32-mips.c:2750
|
||||
msgid " [mips2]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2745
|
||||
#: elf32-mips.c:2752
|
||||
msgid " [mips3]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2747
|
||||
#: elf32-mips.c:2754
|
||||
msgid " [mips4]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2749
|
||||
#: elf32-mips.c:2756
|
||||
msgid " [mips5]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2751
|
||||
#: elf32-mips.c:2758
|
||||
msgid " [mips32]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2753
|
||||
#: elf32-mips.c:2760
|
||||
msgid " [mips64]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2755
|
||||
#: elf32-mips.c:2762
|
||||
msgid " [unknown ISA]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2758
|
||||
#: elf32-mips.c:2765
|
||||
msgid " [32bitmode]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:2760
|
||||
#: elf32-mips.c:2767
|
||||
msgid " [not 32bitmode]"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:4428
|
||||
#: elf32-mips.c:4436
|
||||
msgid "static procedure (no name)"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:5045 elf64-alpha.c:4418
|
||||
#: elf32-mips.c:5053 elf64-alpha.c:4420
|
||||
#, c-format
|
||||
msgid "%s: illegal section name `%s'"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:5610
|
||||
#: elf32-mips.c:5618
|
||||
msgid "not enough GOT space for local GOT entries"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:6726
|
||||
#: elf32-mips.c:6734
|
||||
#, c-format
|
||||
msgid "%s: %s+0x%lx: jump to stub routine which is not jal"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:7715
|
||||
#: elf32-mips.c:7723
|
||||
#, c-format
|
||||
msgid "Malformed reloc detected for section %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-mips.c:7792
|
||||
#: elf32-mips.c:7800
|
||||
#, c-format
|
||||
msgid "%s: CALL16 reloc at 0x%lx not against global symbol"
|
||||
msgstr ""
|
||||
@@ -1193,17 +1286,17 @@ msgstr ""
|
||||
msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-sparc.c:1519 elf64-sparc.c:2263
|
||||
#: elf32-sparc.c:1538 elf64-sparc.c:2263
|
||||
#, c-format
|
||||
msgid "%s: probably compiled without -fPIC?"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-sparc.c:1976
|
||||
#: elf32-sparc.c:1991
|
||||
#, c-format
|
||||
msgid "%s: compiled for a 64 bit system and target is 32 bit"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-sparc.c:1990
|
||||
#: elf32-sparc.c:2005
|
||||
#, c-format
|
||||
msgid "%s: linking little endian files with big endian files"
|
||||
msgstr ""
|
||||
@@ -1279,7 +1372,7 @@ msgstr ""
|
||||
msgid "GPDISP relocation did not find ldah and lda instructions"
|
||||
msgstr ""
|
||||
|
||||
#: elf64-alpha.c:3055
|
||||
#: elf64-alpha.c:3057
|
||||
#, c-format
|
||||
msgid "%s: .got subsegment exceeds 64K (size %d)"
|
||||
msgstr ""
|
||||
@@ -1314,104 +1407,11 @@ msgstr ""
|
||||
msgid "Symbol `%s' has differing types: REGISTER in %s, %s in %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf64-sparc.c:2978
|
||||
#: elf64-sparc.c:2974
|
||||
#, c-format
|
||||
msgid "%s: linking UltraSPARC specific with HAL specific code"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:330
|
||||
#, c-format
|
||||
msgid "%s: invalid string offset %u >= %lu for section `%s'"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:590
|
||||
msgid ""
|
||||
"\n"
|
||||
"Program Header:\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:638
|
||||
msgid ""
|
||||
"\n"
|
||||
"Dynamic Section:\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:767
|
||||
msgid ""
|
||||
"\n"
|
||||
"Version definitions:\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:790
|
||||
msgid ""
|
||||
"\n"
|
||||
"Version References:\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:795
|
||||
#, c-format
|
||||
msgid " required from %s:\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:1385
|
||||
#, c-format
|
||||
msgid "%s: invalid link %lu for reloc section %s (index %u)"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:2146
|
||||
#, c-format
|
||||
msgid ""
|
||||
"creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = "
|
||||
"0x%.8lx\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:2749
|
||||
#, c-format
|
||||
msgid "%s: Not enough room for program headers (allocated %u, need %u)"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:2848
|
||||
#, c-format
|
||||
msgid "%s: Not enough room for program headers, try linking with -N"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:2974
|
||||
#, c-format
|
||||
msgid "Error: First section in segment (%s) starts at 0x%x"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:2977
|
||||
#, c-format
|
||||
msgid " whereas segment starts at 0x%x"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:3250
|
||||
#, c-format
|
||||
msgid "%s: warning: allocated section `%s' not in segment"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:3655
|
||||
#, c-format
|
||||
msgid "%s: symbol `%s' required but not present"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:3664
|
||||
#, c-format
|
||||
msgid ""
|
||||
"elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = "
|
||||
"0x%.8lx%s\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:3905
|
||||
#, c-format
|
||||
msgid "%s: warning: Empty loadable segment detected\n"
|
||||
msgstr ""
|
||||
|
||||
#: elf.c:5290
|
||||
#, c-format
|
||||
msgid "%s: unsupported relocation type %s"
|
||||
msgstr ""
|
||||
|
||||
#: elfcode.h:1085
|
||||
#, c-format
|
||||
msgid "%s: version count (%ld) does not match symbol count (%ld)"
|
||||
@@ -1422,46 +1422,46 @@ msgstr ""
|
||||
msgid "%s: Section %s is already to large to put hole of %ld bytes in"
|
||||
msgstr ""
|
||||
|
||||
#: elflink.h:1468
|
||||
#: elflink.h:1469
|
||||
#, c-format
|
||||
msgid "%s: %s: invalid version %u (max %d)"
|
||||
msgstr ""
|
||||
|
||||
#: elflink.h:1509
|
||||
#: elflink.h:1510
|
||||
#, c-format
|
||||
msgid "%s: %s: invalid needed version %d"
|
||||
msgstr ""
|
||||
|
||||
#: elflink.h:1629
|
||||
#: elflink.h:1630
|
||||
#, c-format
|
||||
msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s"
|
||||
msgstr ""
|
||||
|
||||
#: elflink.h:1875
|
||||
#: elflink.h:1876
|
||||
#, c-format
|
||||
msgid "%s: warning: unexpected redefinition of `%s'"
|
||||
msgstr ""
|
||||
|
||||
#: elflink.h:3676
|
||||
#: elflink.h:3674
|
||||
#, c-format
|
||||
msgid "warning: type and size of dynamic symbol `%s' are not defined"
|
||||
msgstr ""
|
||||
|
||||
#: elflink.h:3948
|
||||
#: elflink.h:3974
|
||||
#, c-format
|
||||
msgid "%s: undefined versioned symbol name %s"
|
||||
msgstr ""
|
||||
|
||||
#: elflink.h:4169 elflink.h:4177 elflink.h:5480 elflink.h:6420
|
||||
#: elflink.h:4201 elflink.h:4209 elflink.h:5533 elflink.h:6487
|
||||
msgid "Error: out of memory"
|
||||
msgstr ""
|
||||
|
||||
#: elflink.h:5258
|
||||
#: elflink.h:5311
|
||||
#, c-format
|
||||
msgid "%s: could not find output section %s for input section %s"
|
||||
msgstr ""
|
||||
|
||||
#: elflink.h:5661
|
||||
#: elflink.h:5719
|
||||
#, c-format
|
||||
msgid "%s: invalid section symbol index 0x%x (%s) ingored"
|
||||
msgstr ""
|
||||
@@ -1580,12 +1580,12 @@ msgstr ""
|
||||
msgid "%s: compiled for a little endian system and target is big endian"
|
||||
msgstr ""
|
||||
|
||||
#: linker.c:1808
|
||||
#: linker.c:1827
|
||||
#, c-format
|
||||
msgid "%s: indirect symbol `%s' to `%s' is a loop"
|
||||
msgstr ""
|
||||
|
||||
#: linker.c:2693
|
||||
#: linker.c:2712
|
||||
#, c-format
|
||||
msgid "Attempt to do relocateable link with %s input and %s output"
|
||||
msgstr ""
|
||||
@@ -1605,44 +1605,6 @@ msgstr ""
|
||||
msgid "Unhandled OSF/1 core file section type %d\n"
|
||||
msgstr ""
|
||||
|
||||
#. XXX code yet to be written.
|
||||
#: peicode.h:796
|
||||
#, c-format
|
||||
msgid "%s: Unhandled import type; %x"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:801
|
||||
#, c-format
|
||||
msgid "%s: Unrecognised import type; %x"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:815
|
||||
#, c-format
|
||||
msgid "%s: Unrecognised import name type; %x"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:1172
|
||||
#, c-format
|
||||
msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:1184
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s: Recognised but unhandled machine type (0x%x) in Import Library Format "
|
||||
"archive"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:1201
|
||||
#, c-format
|
||||
msgid "%s: size field is zero in Import Library Format header"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:1229
|
||||
#, c-format
|
||||
msgid "%s: string not null terminated in ILF object file."
|
||||
msgstr ""
|
||||
|
||||
#: pe-mips.c:654
|
||||
#, c-format
|
||||
msgid "%s: `ld -r' not supported with PE MIPS objects\n"
|
||||
@@ -1658,6 +1620,44 @@ msgstr ""
|
||||
msgid "%s: bad pair/reflo after refhi\n"
|
||||
msgstr ""
|
||||
|
||||
#. XXX code yet to be written.
|
||||
#: peicode.h:797
|
||||
#, c-format
|
||||
msgid "%s: Unhandled import type; %x"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:802
|
||||
#, c-format
|
||||
msgid "%s: Unrecognised import type; %x"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:816
|
||||
#, c-format
|
||||
msgid "%s: Unrecognised import name type; %x"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:1173
|
||||
#, c-format
|
||||
msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:1185
|
||||
#, c-format
|
||||
msgid ""
|
||||
"%s: Recognised but unhandled machine type (0x%x) in Import Library Format "
|
||||
"archive"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:1202
|
||||
#, c-format
|
||||
msgid "%s: size field is zero in Import Library Format header"
|
||||
msgstr ""
|
||||
|
||||
#: peicode.h:1230
|
||||
#, c-format
|
||||
msgid "%s: string not null terminated in ILF object file."
|
||||
msgstr ""
|
||||
|
||||
#: ppcboot.c:423
|
||||
msgid ""
|
||||
"\n"
|
||||
@@ -1715,7 +1715,7 @@ msgstr ""
|
||||
msgid "%s:%d: Unexpected character `%s' in S-record file\n"
|
||||
msgstr ""
|
||||
|
||||
#: syms.c:969
|
||||
#: syms.c:972
|
||||
msgid "Unsupported .stab relocation"
|
||||
msgstr ""
|
||||
|
||||
@@ -2045,69 +2045,69 @@ msgstr ""
|
||||
msgid "%s: loader reloc in read-only section %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:2046 elf64-ia64.c:2046
|
||||
#: elf32-ia64.c:2052 elf64-ia64.c:2052
|
||||
msgid "@pltoff reloc against local symbol"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:2104 elf64-ia64.c:2104
|
||||
#: elf32-ia64.c:2110 elf64-ia64.c:2110
|
||||
msgid "non-zero addend in @fptr reloc"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:3294 elf64-ia64.c:3294
|
||||
#: elf32-ia64.c:3302 elf64-ia64.c:3302
|
||||
#, c-format
|
||||
msgid "%s: short data segment overflowed (0x%lx >= 0x400000)"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:3305 elf64-ia64.c:3305
|
||||
#: elf32-ia64.c:3313 elf64-ia64.c:3313
|
||||
#, c-format
|
||||
msgid "%s: __gp does not cover short data segment"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:3575 elf64-ia64.c:3575
|
||||
#: elf32-ia64.c:3583 elf64-ia64.c:3583
|
||||
#, c-format
|
||||
msgid "%s: linking non-pic code in a shared library"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:3608 elf64-ia64.c:3608
|
||||
#: elf32-ia64.c:3616 elf64-ia64.c:3616
|
||||
#, c-format
|
||||
msgid "%s: @gprel relocation against dynamic symbol %s"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:3744 elf64-ia64.c:3744
|
||||
#: elf32-ia64.c:3754 elf64-ia64.c:3754
|
||||
#, c-format
|
||||
msgid "%s: dynamic relocation against speculation fixup"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:3752 elf64-ia64.c:3752
|
||||
#: elf32-ia64.c:3762 elf64-ia64.c:3762
|
||||
#, c-format
|
||||
msgid "%s: speculation fixup against undefined weak symbol"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:3935 elf64-ia64.c:3935
|
||||
#: elf32-ia64.c:3945 elf64-ia64.c:3945
|
||||
msgid "unsupported reloc"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:4232 elf64-ia64.c:4232
|
||||
#: elf32-ia64.c:4242 elf64-ia64.c:4242
|
||||
#, c-format
|
||||
msgid "%s: linking trap-on-NULL-dereference with non-trapping files"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:4241 elf64-ia64.c:4241
|
||||
#: elf32-ia64.c:4251 elf64-ia64.c:4251
|
||||
#, c-format
|
||||
msgid "%s: linking big-endian files with little-endian files"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:4250 elf64-ia64.c:4250
|
||||
#: elf32-ia64.c:4260 elf64-ia64.c:4260
|
||||
#, c-format
|
||||
msgid "%s: linking 64-bit files with 32-bit files"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:4259 elf64-ia64.c:4259
|
||||
#: elf32-ia64.c:4269 elf64-ia64.c:4269
|
||||
#, c-format
|
||||
msgid "%s: linking constant-gp files with non-constant-gp files"
|
||||
msgstr ""
|
||||
|
||||
#: elf32-ia64.c:4269 elf64-ia64.c:4269
|
||||
#: elf32-ia64.c:4279 elf64-ia64.c:4279
|
||||
#, c-format
|
||||
msgid "%s: linking auto-pic files with non-auto-pic files"
|
||||
msgstr ""
|
||||
|
||||
1443
binutils/ChangeLog
1443
binutils/ChangeLog
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,123 +0,0 @@
|
||||
========= Binutils Maintainers =========
|
||||
|
||||
This is the list of individuals responsible for maintenance and update
|
||||
of the GNU Binary Utilities project. This includes the linker (ld),
|
||||
the assembler (gas), the profiler (gprof), a whole suite of other
|
||||
programs (binutils) and the libraries that they use (bfd and
|
||||
opcodes). This project shares a common set of header files with the
|
||||
GCC and GDB projects (include), so maintainership of those files is
|
||||
shared amoungst the projects.
|
||||
|
||||
The home page for binutils is:
|
||||
|
||||
http://www.gnu.org/software/binutils/binutils.html
|
||||
|
||||
and patches should be sent to:
|
||||
|
||||
bug-gnu-utils@gnu.org
|
||||
|
||||
with "[Patch]" as part of the subject line. Note - patches to the
|
||||
top level configure.in and config.sub scripts should be sent to:
|
||||
|
||||
config-patches@gnu.org
|
||||
|
||||
and not to the binutils list.
|
||||
|
||||
--------- Blanket Write Privs ---------
|
||||
|
||||
The following people have permission to check patches into the
|
||||
repository without obtaining approval first:
|
||||
|
||||
Nick Clifton <nickc@redhat.com> (head maintainer)
|
||||
Richard Henderson <rth@redhat.com>
|
||||
Ian Taylor <ian@zembu.com>
|
||||
Jeff Law <law@redhat.com>
|
||||
Jim Wilson <wilson@redhat.com>
|
||||
DJ Delorie <dj@redhat.com>
|
||||
Alan Modra <amodra@bigpond.net.au>
|
||||
Michael Meissner <meissner@redhat.com>
|
||||
|
||||
--------- Maintainers ---------
|
||||
|
||||
Maintainers are individuals who are responsible for, and have
|
||||
permission to check in changes in, certain subsets of the code. Note
|
||||
that maintainers still need approval to check in changes outside of
|
||||
the immediate domain that they maintain.
|
||||
|
||||
If there is no maintainer for a given domain then the responsibility
|
||||
falls to the head maintainer (above). If there are several
|
||||
maintainers for a given domain then responsibility falls to the first
|
||||
maintainer. The first maintainer is free to devolve that
|
||||
responsibility among the other maintainers.
|
||||
|
||||
ARM Nick Clifton <nickc@redhat.com>
|
||||
AVR Denis Chertykov <denisc@overta.ru>
|
||||
CRIS Hans-Peter Nilsson <hp@axis.com>
|
||||
DWARF2 Jason Merrill <jason@redhat.com>
|
||||
HPPA elf32 Alan Modra <amodra@bigpond.net.au>
|
||||
IA64 Jim Wilson <wilson@redhat.com>
|
||||
x86_64 Jan Hubicka <jh@suse.cz>
|
||||
x86_64 Andreas Jaeger <aj@suse.de>
|
||||
i860 Jason Eckhardt <jle@redhat.com>
|
||||
ix86 Alan Modra <amodra@bigpond.net.au>
|
||||
ix86 COFF,PE DJ Delorie <dj@redhat.com>
|
||||
ix86 H.J.Lu <hjl@gnu.org>
|
||||
ix86 INTEL MODE Diego Novillo <dnovillo@redhat.com>
|
||||
M68HC11 M68HC12 Stephane Carrez <Stephane.Carrez@worldnet.fr>
|
||||
MN10300 Eric Christopher <echristo@redhat.com>
|
||||
MIPS Eric Christopher <echristo@redhat.com>
|
||||
M88k Ben Elliston <bje@redhat.com>
|
||||
PPC Geoff Keating <geoffk@redhat.com>
|
||||
SH J<>rn Rennecke <amylaar@redhat.com>
|
||||
SH Hans-Peter Nilsson <hp@bitrange.com>
|
||||
SPARC Jakub Jelinek <jakub@redhat.com>
|
||||
z8k Christian Groessler <cpg@aladdin.de>
|
||||
|
||||
--------- CGEN Maintainers -------------
|
||||
|
||||
CGEN is a tool for building, amongst other things, assemblers,
|
||||
disassemblers and simulators from a single description of a CPU.
|
||||
It creates files in several of the binutils directories, but it
|
||||
is mentioned here since there is a single group that maintains
|
||||
CGEN and the files that it creates.
|
||||
|
||||
If you have CGEN related problems you can send email to;
|
||||
|
||||
cgen@sources.redhat.com
|
||||
|
||||
The current CGEN maintainers are:
|
||||
|
||||
Doug Evans, Ben Elliston, Frank Eigler
|
||||
|
||||
--------- Write After Approval ---------
|
||||
|
||||
Individuals with "write after approval" have the ability to check in
|
||||
changes, but they must get approval for each change from someone in
|
||||
one of the above lists (blanket write or maintainers).
|
||||
|
||||
[It's a huge list, folks. You know who you are. If you have the
|
||||
*ability* to do binutils checkins, you're in this group. Just
|
||||
remember to get approval before checking anything in.]
|
||||
|
||||
------------- Obvious Fixes -------------
|
||||
|
||||
Fixes for obvious mistakes do not need approval, and can be checked in
|
||||
right away, but the patch should still be sent to the binutils list.
|
||||
The definition of obvious is a bit hazy, and if you are not sure, then
|
||||
you should seek approval first. Obvious fixes include fixes for
|
||||
spelling mistakes, blatantly incorrect code (where the correct code is
|
||||
also blatantly obvious), and so on. Obvious fixes should always be
|
||||
small, the larger they are, the more likely it is that they contain
|
||||
some un-obvious side effect or consequence.
|
||||
|
||||
--------- Branch Checkins ---------
|
||||
|
||||
If a patch is approved for check in to the mainline sources, it can
|
||||
also be checked into the current release branch. Normally however
|
||||
only bug fixes should be applied to the branch. New features, new
|
||||
ports, etc, should be restricted to the mainline. (Otherwise the
|
||||
burden of maintaining the branch in sync with the mainline becomes too
|
||||
great). If you are uncertain as to whether a patch is appropriate for
|
||||
the branch, ask the branch maintainer. This is:
|
||||
|
||||
Philip Blundell <philb@gnu.org>
|
||||
@@ -1,508 +0,0 @@
|
||||
## Process this file with automake to generate Makefile.in
|
||||
|
||||
## FIXME: Work around apparent bug in automake.
|
||||
INTLLIBS = @INTLLIBS@
|
||||
|
||||
AUTOMAKE_OPTIONS = cygnus dejagnu
|
||||
|
||||
SUBDIRS = doc po
|
||||
|
||||
tooldir = $(exec_prefix)/$(target_alias)
|
||||
|
||||
## These aren't set by automake, because they appear in
|
||||
## bfd/acinclude.m4, which is included by binutils/acinclude.m4, and
|
||||
## thus is not seen by automake.
|
||||
CC_FOR_BUILD = @CC_FOR_BUILD@
|
||||
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
|
||||
|
||||
YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bison/; else echo @YACC@; fi`
|
||||
YFLAGS = -d
|
||||
LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi`
|
||||
|
||||
WARN_CFLAGS = @WARN_CFLAGS@
|
||||
AM_CFLAGS = $(WARN_CFLAGS)
|
||||
|
||||
# these two are almost the same program
|
||||
AR_PROG=ar
|
||||
RANLIB_PROG=ranlib
|
||||
|
||||
# objcopy and strip should be the same program
|
||||
OBJCOPY_PROG=objcopy
|
||||
STRIP_PROG=strip-new
|
||||
|
||||
STRINGS_PROG=strings
|
||||
|
||||
READELF_PROG=readelf
|
||||
|
||||
# These should all be the same program too.
|
||||
SIZE_PROG=size
|
||||
NM_PROG=nm-new
|
||||
OBJDUMP_PROG=objdump
|
||||
|
||||
# This is the demangler, as a standalone program.
|
||||
# Note: This one is used as the installed name too, unlike the above.
|
||||
DEMANGLER_PROG=cxxfilt
|
||||
|
||||
ADDR2LINE_PROG=addr2line
|
||||
|
||||
NLMCONV_PROG=nlmconv
|
||||
DLLTOOL_PROG=dlltool
|
||||
WINDRES_PROG=windres
|
||||
DLLWRAP_PROG=dllwrap
|
||||
|
||||
SRCONV_PROG=srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT)
|
||||
|
||||
PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@
|
||||
|
||||
bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ $(ADDR2LINE_PROG) $(READELF_PROG) @BUILD_DLLWRAP@ @BUILD_MISC@
|
||||
|
||||
## We need a special rule to install the programs which are built with
|
||||
## -new, and to rename cxxfilt to c++filt.
|
||||
noinst_PROGRAMS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
|
||||
|
||||
EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(DLLWRAP_PROG)
|
||||
|
||||
# Stuff that goes in tooldir/ if appropriate
|
||||
TOOL_PROGS = nm-new strip-new ar ranlib dlltool
|
||||
|
||||
BASEDIR = $(srcdir)/..
|
||||
BFDDIR = $(BASEDIR)/bfd
|
||||
INCDIR = $(BASEDIR)/include
|
||||
|
||||
MKDEP = gcc -MM
|
||||
|
||||
INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(prefix)/share/locale\""
|
||||
|
||||
HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h \
|
||||
windres.h winduni.h
|
||||
|
||||
GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h
|
||||
|
||||
CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c \
|
||||
dlltool.c filemode.c ieee.c is-ranlib.c is-strip.c maybe-ranlib.c \
|
||||
maybe-strip.c nlmconv.c nm.c not-ranlib.c not-strip.c \
|
||||
objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c \
|
||||
stabs.c strings.c sysdump.c version.c wrstabs.c \
|
||||
windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c \
|
||||
resres.c dllwrap.c rename.c
|
||||
|
||||
GENERATED_CFILES = \
|
||||
underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
|
||||
defparse.c deflex.c nlmheader.c rcparse.c rclex.c
|
||||
|
||||
DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c
|
||||
WRITE_DEBUG_SRCS = $(DEBUG_SRCS) wrstabs.c
|
||||
|
||||
# Code shared by all the binutils.
|
||||
BULIBS = bucomm.c version.c filemode.c
|
||||
|
||||
BFDLIB = ../bfd/libbfd.la
|
||||
|
||||
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`
|
||||
RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \
|
||||
echo ${srcdir}/../dejagnu/runtest ; \
|
||||
else echo runtest ; fi`
|
||||
|
||||
CC_FOR_TARGET = ` \
|
||||
if [ -f $$r/../gcc/xgcc ] ; then \
|
||||
if [ -f $$r/../newlib/Makefile ] ; then \
|
||||
echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
|
||||
else \
|
||||
echo $$r/../gcc/xgcc -B$$r/../gcc/; \
|
||||
fi; \
|
||||
else \
|
||||
if [ "@host@" = "@target@" ] ; then \
|
||||
echo $(CC); \
|
||||
else \
|
||||
echo gcc | sed '$(transform)'; \
|
||||
fi; \
|
||||
fi`
|
||||
|
||||
check-DEJAGNU: site.exp
|
||||
srcdir=`cd $(srcdir) && pwd`; export srcdir; \
|
||||
r=`pwd`; export r; \
|
||||
EXPECT=$(EXPECT); export EXPECT; \
|
||||
if [ -f $(top_builddir)/../expect/expect ]; then \
|
||||
TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
|
||||
export TCL_LIBRARY; \
|
||||
fi; \
|
||||
runtest=$(RUNTEST); \
|
||||
if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
|
||||
$$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
|
||||
CC_FOR_TARGET="$(CC_FOR_TARGET)" \
|
||||
CFLAGS_FOR_TARGET="$(CFLAGS)" $(RUNTESTFLAGS); \
|
||||
else echo "WARNING: could not find \`runtest'" 1>&2; :;\
|
||||
fi
|
||||
|
||||
installcheck:
|
||||
/bin/sh $(srcdir)/sanity.sh $(bindir)
|
||||
|
||||
LDADD = $(BFDLIB) $(LIBIBERTY) $(INTLLIBS)
|
||||
|
||||
size_SOURCES = size.c $(BULIBS)
|
||||
|
||||
objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS)
|
||||
|
||||
strings_SOURCES = strings.c $(BULIBS)
|
||||
|
||||
readelf_SOURCES = readelf.c version.c unwind-ia64.c
|
||||
readelf_LDADD = $(INTLLIBS) $(LIBIBERTY)
|
||||
|
||||
strip_new_SOURCES = objcopy.c is-strip.c rename.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) $(INTLLIBS)
|
||||
|
||||
objdump.o:objdump.c
|
||||
$(COMPILE) -c $(OBJDUMP_DEFS) $(srcdir)/objdump.c
|
||||
|
||||
underscore.c: stamp-under ; @true
|
||||
|
||||
stamp-under: Makefile
|
||||
echo '/*WARNING: This file is automatically generated!*/' >underscore.t
|
||||
echo "int prepends_underscore = @UNDERSCORE@;" >>underscore.t
|
||||
$(SHELL) $(srcdir)/../move-if-change underscore.t underscore.c
|
||||
touch stamp-under
|
||||
|
||||
cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h
|
||||
$(COMPILE) -c -DMAIN -DVERSION='"$(VERSION)"' $(BASEDIR)/libiberty/cplus-dem.c
|
||||
|
||||
cxxfilt_SOURCES =
|
||||
cxxfilt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY) $(INTLLIBS)
|
||||
|
||||
ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c $(BULIBS)
|
||||
ar_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
ranlib_SOURCES = ar.c is-ranlib.c arparse.y arlex.l arsup.c rename.c $(BULIBS)
|
||||
ranlib_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
addr2line_SOURCES = addr2line.c $(BULIBS)
|
||||
|
||||
# The following is commented out for the conversion to automake.
|
||||
# This rule creates a single binary that switches between ar and ranlib
|
||||
# by looking at argv[0]. Use this kludge to save some disk space.
|
||||
# However, you have to install things by hand.
|
||||
# (That is after 'make install', replace the installed ranlib by a link to ar.)
|
||||
# Alternatively, you can install ranlib.sh as ranlib.
|
||||
# ar_with_ranlib: $(ADDL_DEPS) ar.o maybe-ranlib.o
|
||||
# $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
|
||||
# -rm -f $(RANLIB_PROG)
|
||||
# -ln $(AR_PROG) $(RANLIB_PROG)
|
||||
#
|
||||
# objcopy and strip in one binary that uses argv[0] to decide its action.
|
||||
#
|
||||
#objcopy_with_strip: $(ADDL_DEPS) objcopy.o maybe-strip.o
|
||||
# $(HLDENV) $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS)
|
||||
# -rm -f $(STRIP_PROG)
|
||||
# -ln $(OBJCOPY_PROG) $(STRIP_PROG)
|
||||
|
||||
sysroff.c: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info
|
||||
./sysinfo$(EXEEXT_FOR_BUILD) -c <$(srcdir)/sysroff.info >sysroff.c
|
||||
./sysinfo$(EXEEXT_FOR_BUILD) -i <$(srcdir)/sysroff.info >>sysroff.c
|
||||
./sysinfo$(EXEEXT_FOR_BUILD) -g <$(srcdir)/sysroff.info >>sysroff.c
|
||||
|
||||
sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sysroff.info
|
||||
./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
|
||||
|
||||
sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
|
||||
$(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
|
||||
|
||||
syslex.o: syslex.c sysinfo.h
|
||||
if [ -r syslex.c ]; then \
|
||||
$(CC_FOR_BUILD) -c -I. $(CFLAGS) syslex.c ; \
|
||||
else \
|
||||
$(CC_FOR_BUILD) -c -I. -I$(srcdir) $(CFLAGS) $(srcdir)/syslex.c ;\
|
||||
fi
|
||||
|
||||
sysinfo.o: sysinfo.c
|
||||
if [ -r sysinfo.c ]; then \
|
||||
$(CC_FOR_BUILD) -c -I. $(CFLAGS) sysinfo.c ; \
|
||||
else \
|
||||
$(CC_FOR_BUILD) -c -I. $(CFLAGS) $(srcdir)/sysinfo.c ; \
|
||||
fi
|
||||
|
||||
# We need these for parallel make.
|
||||
arparse.h: arparse.c
|
||||
defparse.h: defparse.c
|
||||
nlmheader.h: nlmheader.c
|
||||
rcparse.h: rcparse.c
|
||||
sysinfo.h: sysinfo.c
|
||||
|
||||
srconv_SOURCES = srconv.c coffgrok.c $(BULIBS)
|
||||
|
||||
dlltool_SOURCES = dlltool.c defparse.y deflex.l $(BULIBS)
|
||||
dlltool_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
dlltool.o:dlltool.c
|
||||
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/dlltool.c
|
||||
|
||||
rescoff.o:rescoff.c
|
||||
$(COMPILE) -c $(DLLTOOL_DEFS) $(srcdir)/rescoff.c
|
||||
|
||||
coffdump_SOURCES = coffdump.c coffgrok.c $(BULIBS)
|
||||
|
||||
sysdump_SOURCES = sysdump.c $(BULIBS)
|
||||
|
||||
# coff/sym.h and coff/ecoff.h won't be found by the automatic dependency
|
||||
# scripts, since they are only included conditionally.
|
||||
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
|
||||
|
||||
nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS)
|
||||
|
||||
windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \
|
||||
winduni.c resres.c $(BULIBS)
|
||||
windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS)
|
||||
|
||||
dllwrap_SOURCES = dllwrap.c version.c
|
||||
dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS)
|
||||
|
||||
|
||||
EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \
|
||||
syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c
|
||||
|
||||
diststuff: $(EXTRA_DIST) info
|
||||
|
||||
DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \
|
||||
site.exp site.bak
|
||||
|
||||
# Targets to rebuild dependencies in this Makefile.
|
||||
# Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
|
||||
DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
|
||||
rm -f DEP1
|
||||
$(MAKE) MKDEP="$(MKDEP)" DEP1
|
||||
sed -f dep.sed < DEP1 > DEPA
|
||||
echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA
|
||||
if grep ' /' DEPA > /dev/null 2> /dev/null; then \
|
||||
echo 'make DEP failed!'; exit 1; \
|
||||
else \
|
||||
mv -f DEPA $@; \
|
||||
fi
|
||||
|
||||
DEP1: $(CFILES) $(GENERATED_CFILES)
|
||||
echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2
|
||||
echo '# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.' >> DEP2
|
||||
$(MKDEP) $(INCLUDES) $(CFLAGS) $? >> DEP2
|
||||
mv -f DEP2 $@
|
||||
|
||||
dep.sed: dep-in.sed config.status
|
||||
objdir=`pwd`; \
|
||||
sed <$(srcdir)/dep-in.sed >dep.sed \
|
||||
-e 's!@INCDIR@!$(INCDIR)!' \
|
||||
-e 's!@BFDDIR@!$(BFDDIR)!' \
|
||||
-e 's!@SRCDIR@!$(srcdir)!' \
|
||||
-e "s!@OBJDIR@!$${objdir}!"
|
||||
|
||||
dep: DEP
|
||||
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
|
||||
cat DEP >> tmp-Makefile
|
||||
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile
|
||||
|
||||
dep-in: DEP
|
||||
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
|
||||
cat DEP >> tmp-Makefile.in
|
||||
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
|
||||
|
||||
dep-am: DEP
|
||||
sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
|
||||
cat DEP >> tmp-Makefile.am
|
||||
$(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
|
||||
|
||||
.PHONY: dep dep-in dep-am
|
||||
|
||||
###
|
||||
|
||||
MOSTLYCLEANFILES = sysinfo binutils.log binutils.sum abcdefgh*
|
||||
mostlyclean-local:
|
||||
-rm -rf tmpdir
|
||||
|
||||
CLEANFILES = dep.sed DEP DEPA DEP1 DEP2
|
||||
|
||||
.PHONY: install-exec-local
|
||||
|
||||
install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS)
|
||||
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
|
||||
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
else :; fi; \
|
||||
done
|
||||
$(mkinstalldirs) $(tooldir)/bin
|
||||
for i in $(TOOL_PROGS); do \
|
||||
if [ -f $$i$(EXEEXT) ]; then \
|
||||
j=`echo $$i | sed -e 's/-new//'`; \
|
||||
k=`echo $$j | sed '$(transform)'`; \
|
||||
if [ "$(bindir)/$$k$(EXEEXT)" != "$(tooldir)/bin/$$j$(EXEEXT)" ]; then \
|
||||
rm -f $(tooldir)/bin/$$j$(EXEEXT); \
|
||||
ln $(bindir)/$$k$(EXEEXT) $(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \
|
||||
|| $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(tooldir)/bin/$$j$(EXEEXT); \
|
||||
fi; \
|
||||
else true; \
|
||||
fi; \
|
||||
done
|
||||
|
||||
# What appears below is generated by a hacked mkdep using gcc -MM.
|
||||
|
||||
# DO NOT DELETE THIS LINE -- mkdep uses it.
|
||||
# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
|
||||
addr2line.o: addr2line.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
$(INCDIR)/getopt.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h
|
||||
ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
|
||||
$(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h $(INCDIR)/aout/ar.h $(BFDDIR)/libbfd.h \
|
||||
arsup.h $(INCDIR)/filenames.h
|
||||
arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
arsup.h $(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h $(INCDIR)/filenames.h
|
||||
bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
$(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h $(INCDIR)/filenames.h
|
||||
coffdump.o: coffdump.c coffgrok.h bucomm.h config.h \
|
||||
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h
|
||||
coffgrok.o: coffgrok.c bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \
|
||||
$(INCDIR)/bfdlink.h coffgrok.h
|
||||
debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h debug.h
|
||||
dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
$(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h $(INCDIR)/demangle.h $(INCDIR)/dyn-string.h \
|
||||
dlltool.h
|
||||
filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h
|
||||
ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/ieee.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h debug.h budbg.h $(INCDIR)/filenames.h
|
||||
is-ranlib.o: is-ranlib.c
|
||||
is-strip.o: is-strip.c
|
||||
maybe-ranlib.o: maybe-ranlib.c
|
||||
maybe-strip.o: maybe-strip.c
|
||||
nlmconv.o: nlmconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
$(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h $(BFDDIR)/libnlm.h $(INCDIR)/nlm/common.h \
|
||||
$(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmconv.h
|
||||
nm.o: nm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/progress.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ranlib.h \
|
||||
$(INCDIR)/demangle.h $(INCDIR)/libiberty.h
|
||||
not-ranlib.o: not-ranlib.c
|
||||
not-strip.o: not-strip.c
|
||||
objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
$(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h budbg.h \
|
||||
$(INCDIR)/filenames.h
|
||||
objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
$(INCDIR)/getopt.h $(INCDIR)/progress.h bucomm.h config.h \
|
||||
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/dis-asm.h \
|
||||
$(INCDIR)/libiberty.h $(INCDIR)/demangle.h debug.h \
|
||||
budbg.h $(INCDIR)/aout/aout64.h
|
||||
prdbg.o: prdbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h debug.h budbg.h
|
||||
rdcoff.o: rdcoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
$(INCDIR)/coff/internal.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \
|
||||
debug.h budbg.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
|
||||
rddbg.o: rddbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h debug.h budbg.h
|
||||
size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h
|
||||
srconv.o: srconv.c bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h sysroff.h coffgrok.h $(INCDIR)/coff/internal.h \
|
||||
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h sysroff.c
|
||||
stabs.o: stabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h $(INCDIR)/demangle.h debug.h \
|
||||
budbg.h $(INCDIR)/filenames.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
|
||||
strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h
|
||||
sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
sysroff.h sysroff.c
|
||||
version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h
|
||||
wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h debug.h budbg.h $(INCDIR)/aout/aout64.h \
|
||||
$(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
|
||||
windres.o: windres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
$(INCDIR)/getopt.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/obstack.h \
|
||||
windres.h winduni.h
|
||||
resrc.o: resrc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h windres.h winduni.h
|
||||
rescoff.o: rescoff.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h windres.h winduni.h $(INCDIR)/coff/internal.h \
|
||||
$(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h
|
||||
resbin.o: resbin.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h windres.h winduni.h
|
||||
winduni.o: winduni.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
winduni.h
|
||||
readelf.o: readelf.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
$(INCDIR)/elf/common.h $(INCDIR)/elf/external.h $(INCDIR)/elf/internal.h \
|
||||
$(INCDIR)/elf/dwarf2.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \
|
||||
$(INCDIR)/elf/v850.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/mips.h \
|
||||
$(INCDIR)/elf/alpha.h $(INCDIR)/elf/arm.h $(INCDIR)/elf/m68k.h \
|
||||
$(INCDIR)/elf/sparc.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/d10v.h \
|
||||
$(INCDIR)/elf/d30v.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/mn10200.h \
|
||||
$(INCDIR)/elf/mn10300.h $(INCDIR)/elf/hppa.h $(INCDIR)/elf/arc.h \
|
||||
$(INCDIR)/elf/fr30.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/i960.h \
|
||||
$(INCDIR)/elf/pj.h $(INCDIR)/elf/avr.h $(INCDIR)/elf/ia64.h \
|
||||
$(INCDIR)/elf/cris.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/x86-64.h \
|
||||
$(INCDIR)/elf/s390.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h unwind-ia64.h
|
||||
resres.o: resres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h windres.h winduni.h
|
||||
dllwrap.o: dllwrap.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
$(INCDIR)/libiberty.h bucomm.h config.h $(INCDIR)/bin-bugs.h \
|
||||
$(INCDIR)/fopen-same.h $(INCDIR)/dyn-string.h
|
||||
rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h
|
||||
underscore.o: underscore.c
|
||||
arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
arsup.h
|
||||
arlex.o: arlex.c $(INCDIR)/libiberty.h arparse.h
|
||||
sysroff.o: sysroff.c
|
||||
sysinfo.o: sysinfo.c
|
||||
syslex.o: syslex.c sysinfo.h
|
||||
defparse.o: defparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
dlltool.h
|
||||
deflex.o: deflex.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
|
||||
defparse.h dlltool.h
|
||||
nlmheader.o: nlmheader.c ../bfd/bfd.h bucomm.h config.h \
|
||||
$(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h \
|
||||
$(INCDIR)/nlm/internal.h nlmconv.h
|
||||
rcparse.o: rcparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h windres.h winduni.h
|
||||
rclex.o: rclex.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
|
||||
bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \
|
||||
$(INCDIR)/libiberty.h windres.h winduni.h rcparse.h
|
||||
# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
|
||||
1231
binutils/Makefile.in
1231
binutils/Makefile.in
File diff suppressed because it is too large
Load Diff
209
binutils/NEWS
209
binutils/NEWS
@@ -1,209 +0,0 @@
|
||||
-*- text -*-
|
||||
|
||||
* readelf: Support added for DWARF 2.1 extensions. Support added for
|
||||
displaying the contents of .debug.macinfo sections.
|
||||
|
||||
* New command line switches added to objcopy to allow symbols to be kept as
|
||||
global symbols, and also to specify files containing lists of such symbols.
|
||||
by Honda Hiroki.
|
||||
|
||||
* Support for OpenRISC by Johan Rydberg.
|
||||
|
||||
* New command line switch to objcopy -B (or --binary-architecture) which sets
|
||||
the architecture of the output file to the given argument. This option only
|
||||
makes sense, if the input target is binary. Otherwise it is ignored.
|
||||
By Stefan Geuken.
|
||||
|
||||
* Support for PDP-11 by Lars Brinkhoff.
|
||||
|
||||
Changes in binutils 2.11:
|
||||
|
||||
* Add support for ARM v5t and v5te architectures and Intel's XScale ARM
|
||||
extenstions.
|
||||
|
||||
* Add --srec-len and --srec-forceS3 command line switch to objcopy.
|
||||
By Luciano Gemme.
|
||||
|
||||
* Support for the MIPS32, by Anders Norlander.
|
||||
|
||||
* Support for the i860, by Jason Eckhardt.
|
||||
|
||||
* Support for CRIS (Axis Communications ETRAX series).
|
||||
|
||||
Changes in binutils 2.10:
|
||||
|
||||
* Support for 64-bit ELF on HPPA.
|
||||
|
||||
* New command line switch to objdump --file-start-context which shows the
|
||||
entire file contents up to the source line first encountered for a given
|
||||
file.
|
||||
|
||||
* New command line switch to objdump -M (or --disassembler-options) which takes
|
||||
a parameter which can then be interpreted on a per-target basis by the
|
||||
disassembler. Used by ARM targets to select register name sets, ISA, APCS or
|
||||
raw verions.
|
||||
|
||||
* objdump support for -mi386:intel which causes disassembly to be displayed
|
||||
with intel syntax.
|
||||
|
||||
* New program: readelf. This displays the contents of ELF format files,
|
||||
regardless of target machine.
|
||||
|
||||
* objcopy now takes --change-section-lma, --change-section-vma, and
|
||||
--change-section-address options. The old --adjust-section-vma option is
|
||||
equivalent to --change-section-address. The other --adjust-* options are now
|
||||
renamed to --change-*, although --adjust-* continues to work.
|
||||
|
||||
* objcopy has a --redefine-sym option that lets you rename symbols.
|
||||
|
||||
* objcopy now takes a -j/--only-section option to copy only the specified
|
||||
sections.
|
||||
|
||||
* dlltool now supports the IMPORTS command.
|
||||
|
||||
* dlltool now takes --export-all-symbols, --no-export-all-symbols,
|
||||
--exclude-symbols, and --no-default-excludes options.
|
||||
|
||||
Changes in binutils 2.9:
|
||||
|
||||
* Added windres program, which can be used to manipulate resources in WIN32
|
||||
files as used on Windows 95 and Windows NT.
|
||||
|
||||
* The objcopy --gap-fill and --pad-to options operate on the LMA rather than
|
||||
the VMA of the sections.
|
||||
|
||||
* Added S modifier to ar to not build a symbol table.
|
||||
|
||||
Changes in binutils 2.8:
|
||||
|
||||
* The objdump disassembly format has been changed, and hopefully improved. Use
|
||||
the new --prefix-addresses option to get the old format. There are also new
|
||||
--disassemble-zeroes and --no-show-raw-insn options which affect disassembler
|
||||
output.
|
||||
|
||||
* Formats may now be specified as configuration triplets. For example,
|
||||
objdump -b i386-pc-linux. The triplets are not passed through config.sub,
|
||||
so they must be in canonical form.
|
||||
|
||||
* Added new addr2line program. This uses the debugging information to convert
|
||||
an address into a file name and line number within a program.
|
||||
|
||||
* Added --change-leading-char argument to objcopy.
|
||||
|
||||
* Added --weaken argument to objcopy.
|
||||
|
||||
* objdump --dynamic-reloc now works on ELF executables and shared libraries.
|
||||
|
||||
* Added --adjust-vma option to objdump.
|
||||
|
||||
* Added -C/--demangle option to objdump.
|
||||
|
||||
* Added -p/--preserve-dates option to strip and objcopy.
|
||||
|
||||
Changes in binutils 2.7:
|
||||
|
||||
* Added --enable-shared and --enable-commonbfdlib options to configure.
|
||||
|
||||
* Added --debugging argument to objdump and objcopy.
|
||||
|
||||
* Added --defined-only argument to nm.
|
||||
|
||||
* Added --remove-leading-char argument to objcopy.
|
||||
|
||||
* The objdump --line-numbers option is now meaningful with --reloc.
|
||||
|
||||
* Added --line-numbers option to nm.
|
||||
|
||||
* Added --endian/-EB/-EL option to objdump.
|
||||
|
||||
* Added support for Alpha OpenVMS/AXP.
|
||||
|
||||
Changes in binutils 2.6:
|
||||
|
||||
* Added -N/--strip-symbol and -K/--keep-symbol arguments to strip and objcopy.
|
||||
|
||||
* Added several arguments to objcopy to provide some control over how the new
|
||||
file is laid out in memory. Also added binary output format to BFD to permit
|
||||
generating plain binary files.
|
||||
|
||||
* Added --start-address and --stop-address options to objdump.
|
||||
|
||||
* ar and ranlib now work on AIX. The tools are now built by default on AIX.
|
||||
|
||||
Changes in binutils 2.5:
|
||||
|
||||
* Changed objdump -dr to dump the relocs interspersed with the assembly
|
||||
listing, for a more useful listing of relocateable files.
|
||||
|
||||
* Changed objdump -d/--disassemble to only disassemble SEC_CODE sections.
|
||||
Added -D/--disassemble-all option to disassemble all sections.
|
||||
|
||||
* Added --size-sort option to nm.
|
||||
|
||||
* strip and objcopy should now be able to handle dynamically linked ELF
|
||||
executables.
|
||||
|
||||
Changes in binutils 2.4:
|
||||
|
||||
* Support for HP-PA (by Jeff Law), i386 Mach (by David Mackenzie), RS/6000 and
|
||||
PowerPC (except ar and ranlib; by Ian Taylor).
|
||||
|
||||
* Support for Irix 5.
|
||||
|
||||
* Programs `strip' and `objcopy' will not attempt to write dynamically linked
|
||||
ELF output files, since BFD currently can't create them properly.
|
||||
|
||||
Changes in binutils 2.3:
|
||||
|
||||
* A new --stabs argument has been added to objdump to dump stabs sections in
|
||||
ELF and COFF files.
|
||||
|
||||
* A new program, nlmconv, has been added. It can convert object files into
|
||||
Novell NetWare Loadable Modules.
|
||||
|
||||
* The strings program has been added.
|
||||
|
||||
Changes in binutils 2.2:
|
||||
|
||||
* The 'copy' program has been renamed to 'objcopy', for consistency with
|
||||
'objdump', and because 'copy' might more plausibly be used as a synonym for
|
||||
'cp'.
|
||||
|
||||
* The new stand-alone program c++filt is a filter that converts encoded
|
||||
(mangled) C++ assembly-level identifiers to user-level names. (Note: This
|
||||
may get moved to the gcc distribution.)
|
||||
|
||||
* nm -o on an archive now prefixes each line with the archive name, matching
|
||||
the output from BSD nm.
|
||||
|
||||
* ar (and ld) can now read (but not write) BSD4.4-style archives.
|
||||
|
||||
* New support for H8500, Z8000, and the Hitach SH.
|
||||
|
||||
* Dis-assembler interface changed to allow sharing with gdb.
|
||||
|
||||
* There is new Elf code, but it is not yet ready for general use.
|
||||
|
||||
* There is the beginnings of a test suite.
|
||||
|
||||
Changes in binutils 2.1:
|
||||
|
||||
* There is now support for writing ECOFF files, so ld and the other utilities
|
||||
should work on Risc/Ultrix and Irix. Please let us know how well this works.
|
||||
|
||||
* ar now automatically creates a symbol table (a __.SYMDEF member, in the BSD
|
||||
version), if there are any object files in the archive. So running ranlib is
|
||||
now redundant (unless the non-standard q command is used). This is required
|
||||
for Posix.2 conformance.
|
||||
|
||||
* The archive-reading code now reads both BSD-style and SYSV-style archives
|
||||
independently of the selected target format. This is to encourage people to
|
||||
switch to SYSV-format, which has a number of advantages.
|
||||
|
||||
* The strip and copy programs now have options to remove debug-symbols only
|
||||
and/or local symbols only. They now also support long options.
|
||||
|
||||
|
||||
Local variables:
|
||||
fill-column: 79
|
||||
End:
|
||||
204
binutils/README
204
binutils/README
@@ -1,204 +0,0 @@
|
||||
README for BINUTILS
|
||||
|
||||
These are the GNU binutils. These are utilities of use when dealing
|
||||
with binary files, either object files or executables. These tools
|
||||
consist of the linker (ld), the assembler (gas), and the profiler
|
||||
(gprof) each of which have their own sub-directory named after them.
|
||||
There is also a collection of other binary tools, including the
|
||||
disassembler (objdump) in this directory. These tools make use of a
|
||||
pair of libraries (bfd and opcodes) and a common set of header files
|
||||
(include).
|
||||
|
||||
There are README and NEWS files in most of the program sub-directories
|
||||
which give more information about those specific programs.
|
||||
|
||||
|
||||
Unpacking and Installation -- quick overview
|
||||
============================================
|
||||
|
||||
When you unpack the binutils archive file, you will get a directory
|
||||
called something like `binutils-XXX', where XXX is the number of the
|
||||
release. (Probably 2.11.2 or higher). This directory contains
|
||||
various files and sub-directories. Most of the files in the top
|
||||
directory are for information and for configuration. The actual
|
||||
source code is in sub-directories.
|
||||
|
||||
To build binutils, you can just do:
|
||||
|
||||
cd binutils-XXX
|
||||
./configure [options]
|
||||
make
|
||||
make install # copies the programs files into /usr/local/bin
|
||||
# by default.
|
||||
|
||||
This will configure and build all the libraries as well as the
|
||||
assembler, the binutils, and the linker.
|
||||
|
||||
If you have GNU make, we recommend building in a different directory:
|
||||
|
||||
mkdir objdir
|
||||
cd objdir
|
||||
../binutils-XXX/configure [options]
|
||||
make
|
||||
make install
|
||||
|
||||
This relies on the VPATH feature of GNU make.
|
||||
|
||||
By default, the binutils will be configured to support the system on
|
||||
which they are built. When doing cross development, use the --target
|
||||
configure option to specify a different target, eg:
|
||||
|
||||
./configure --target=foo-elf
|
||||
|
||||
The --enable-targets option adds support for more binary file formats
|
||||
besides the default. List them as the argument to --enable-targets,
|
||||
separated by commas. For example:
|
||||
|
||||
./configure --enable-targets=sun3,rs6000-aix,decstation
|
||||
|
||||
The name 'all' compiles in support for all valid BFD targets:
|
||||
|
||||
./configure --enable-targets=all
|
||||
|
||||
On 32-bit hosts though, this support will be restricted to 32-bit
|
||||
target unless the --enable-64-bit-bfd option is also used:
|
||||
|
||||
./configure --enable-64-bit-bfd --enable-targets=all
|
||||
|
||||
You can also specify the --enable-shared option when you run
|
||||
configure. This will build the BFD and opcodes libraries as shared
|
||||
libraries. You can use arguments with the --enable-shared option to
|
||||
indicate that only certain libraries should be built shared; for
|
||||
example, --enable-shared=bfd. The only potential shared libraries in
|
||||
a binutils release are bfd and opcodes.
|
||||
|
||||
The binutils will be linked against the shared libraries. The build
|
||||
step will attempt to place the correct library in the run-time search
|
||||
path for the binaries. However, in some cases, after you install the
|
||||
binaries, you may have to set an environment variable, normally
|
||||
LD_LIBRARY_PATH, so that the system can find the installed libbfd
|
||||
shared library.
|
||||
|
||||
To build under openVMS/AXP, see the file makefile.vms in the top level
|
||||
directory.
|
||||
|
||||
|
||||
If you don't have ar
|
||||
====================
|
||||
|
||||
If your system does not already have an 'ar' program, the normal
|
||||
binutils build process will not work. In this case, run configure as
|
||||
usual. Before running make, run this script:
|
||||
|
||||
#!/bin/sh
|
||||
MAKE_PROG="${MAKE-make}"
|
||||
MAKE="${MAKE_PROG} AR=true LINK=true"
|
||||
export MAKE
|
||||
${MAKE} $* all-libiberty
|
||||
${MAKE} $* all-intl
|
||||
${MAKE} $* all-bfd
|
||||
cd binutils
|
||||
MAKE="${MAKE_PROG}"
|
||||
export MAKE
|
||||
${MAKE} $* ar_DEPENDENCIES= ar_LDADD='../bfd/*.o `cat ../libiberty/required-list ../libiberty/needed-list | sed -e "s,\([^ ][^ ]*\),../libiberty/\1,g"` `if test -f ../intl/gettext.o; then echo '../intl/*.o'; fi`' ar
|
||||
|
||||
This script will build an ar program in binutils/ar. Move binutils/ar
|
||||
into a directory on your PATH. After doing this, you can run make as
|
||||
usual to build the complete binutils distribution. You do not need
|
||||
the ranlib program in order to build the distribution.
|
||||
|
||||
Porting
|
||||
=======
|
||||
|
||||
Binutils-2.11 supports many different architectures, but there
|
||||
are many more not supported, including some that were supported
|
||||
by earlier versions. We are hoping for volunteers to improve this
|
||||
situation.
|
||||
|
||||
The major effort in porting binutils to a new host and/or target
|
||||
architecture involves the BFD library. There is some documentation
|
||||
in ../bfd/doc. The file ../gdb/doc/gdbint.texinfo (distributed
|
||||
with gdb-4.x) may also be of help.
|
||||
|
||||
Reporting bugs
|
||||
==============
|
||||
|
||||
Send bug reports and patches to:
|
||||
|
||||
bug-gnu-utils@gnu.org.
|
||||
|
||||
Always mention the version number you are running; this is printed by
|
||||
running any of the binutils with the --version option. We appreciate
|
||||
reports about bugs, but we do not promise to fix them.
|
||||
|
||||
VMS
|
||||
===
|
||||
|
||||
This section was written by Klaus K"ampf <kkaempf@rmi.de>. It
|
||||
describes how to build and install the binutils on openVMS (Alpha and
|
||||
Vax). (The BFD library only supports reading Vax object files.)
|
||||
|
||||
Compiling the release:
|
||||
|
||||
To compile the gnu binary utilities and the gnu assembler, you'll
|
||||
need DEC C or GNU C for openVMS/Alpha. You'll need *both* compilers
|
||||
on openVMS/Vax.
|
||||
|
||||
Compiling with either DEC C or GNU C works on openVMS/Alpha only. Some
|
||||
of the opcodes and binutils files trap a bug in the DEC C optimizer,
|
||||
so these files must be compiled with /noopt.
|
||||
|
||||
Compiling on openVMS/Vax is a bit complicated, as the bfd library traps
|
||||
a bug in GNU C and the gnu assembler a bug in (my version of) DEC C.
|
||||
|
||||
I never tried compiling with VAX C.
|
||||
|
||||
|
||||
You further need GNU Make Version 3.76 or later. This is available
|
||||
at ftp.progis.de or any GNU archive site. The makefiles assume that
|
||||
gmake starts gnu make as a foreign command.
|
||||
|
||||
If you're compiling with DEC C or VAX C, you must run
|
||||
|
||||
$ @setup
|
||||
|
||||
before starting gnu-make. This isn't needed with GNU C.
|
||||
|
||||
On the Alpha you can choose the compiler by editing the toplevel
|
||||
makefile.vms. Either select CC=cc (for DEC C) or CC=gcc (for GNU C)
|
||||
|
||||
|
||||
Installing the release
|
||||
|
||||
Provided that your directory setup conforms to the GNU on openVMS
|
||||
standard, you already have a concealed device named 'GNU_ROOT'.
|
||||
In this case, a simple
|
||||
|
||||
$ gmake install
|
||||
|
||||
suffices to copy all programs and libraries to the proper directories.
|
||||
|
||||
Define the programs as foreign commands by adding these lines to your
|
||||
login.com:
|
||||
|
||||
$ gas :== $GNU_ROOT:[bin]as.exe
|
||||
$ size :== $GNU_ROOT:[bin]size.exe
|
||||
$ nm :== $GNU_ROOT:[bin]nm.exe
|
||||
$ objdump :== $GNU_ROOT:[bin]objdump.exe
|
||||
$ strings :== $GNU_ROOT:[bin]strings.exe
|
||||
|
||||
If you have a different directory setup, copy the binary utilities
|
||||
([.binutils]size.exe, [.binutils]nm.exe, [.binutils]objdump.exe,
|
||||
and [.binutils]strings.exe) and the gnu assembler and preprocessor
|
||||
([.gas]as.exe and [.gas]gasp.exe]) to a directory of your choice
|
||||
and define all programs as foreign commands.
|
||||
|
||||
|
||||
If you're satisfied with the compilation, you may want to remove
|
||||
unneeded objects and libraries:
|
||||
|
||||
$ gmake clean
|
||||
|
||||
|
||||
If you have any problems or questions about the binutils on VMS, feel
|
||||
free to mail me at kkaempf@rmi.de.
|
||||
@@ -1,32 +0,0 @@
|
||||
sinclude(../bfd/acinclude.m4)
|
||||
|
||||
dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4
|
||||
dnl The lines below arrange for aclocal not to bring libtool.m4
|
||||
dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
|
||||
dnl to add a definition of LIBTOOL to Makefile.in.
|
||||
ifelse(yes,no,[
|
||||
AC_DEFUN([AM_PROG_LIBTOOL],)
|
||||
AC_SUBST(LIBTOOL)
|
||||
])
|
||||
|
||||
dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4
|
||||
ifelse(yes,no,[
|
||||
AC_DEFUN([CY_WITH_NLS],)
|
||||
AC_SUBST(INTLLIBS)
|
||||
])
|
||||
|
||||
## Replacement for AC_PROG_LEX and AC_DECL_YYTEXT
|
||||
## by Alexandre Oliva <oliva@dcc.unicamp.br>
|
||||
|
||||
## We need to override the installed aclocal/lex.m4 because of a bug in
|
||||
## this definition in the recommended automake snapshot of 000227:
|
||||
## There were double-quotes around ``$missing_dir/missing flex'' which was
|
||||
## bad since aclocal wraps it in double-quotes.
|
||||
|
||||
dnl AM_PROG_LEX
|
||||
dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
|
||||
AC_DEFUN(AM_PROG_LEX,
|
||||
[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
|
||||
AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex])
|
||||
AC_PROG_LEX
|
||||
AC_DECL_YYTEXT])
|
||||
205
binutils/aclocal.m4
vendored
205
binutils/aclocal.m4
vendored
@@ -1,205 +0,0 @@
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4
|
||||
|
||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
sinclude(../bfd/acinclude.m4)
|
||||
|
||||
dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4
|
||||
dnl The lines below arrange for aclocal not to bring libtool.m4
|
||||
dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake
|
||||
dnl to add a definition of LIBTOOL to Makefile.in.
|
||||
ifelse(yes,no,[
|
||||
AC_DEFUN([AM_PROG_LIBTOOL],)
|
||||
AC_SUBST(LIBTOOL)
|
||||
])
|
||||
|
||||
dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4
|
||||
ifelse(yes,no,[
|
||||
AC_DEFUN([CY_WITH_NLS],)
|
||||
AC_SUBST(INTLLIBS)
|
||||
])
|
||||
|
||||
|
||||
|
||||
dnl AM_PROG_LEX
|
||||
dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
|
||||
AC_DEFUN(AM_PROG_LEX,
|
||||
[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
|
||||
AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex])
|
||||
AC_PROG_LEX
|
||||
AC_DECL_YYTEXT])
|
||||
|
||||
#serial 1
|
||||
# This test replaces the one in autoconf.
|
||||
# Currently this macro should have the same name as the autoconf macro
|
||||
# because gettext's gettext.m4 (distributed in the automake package)
|
||||
# still uses it. Otherwise, the use in gettext.m4 makes autoheader
|
||||
# give these diagnostics:
|
||||
# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
|
||||
# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
|
||||
|
||||
undefine([AC_ISC_POSIX])
|
||||
|
||||
AC_DEFUN(AC_ISC_POSIX,
|
||||
[
|
||||
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
|
||||
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
|
||||
]
|
||||
)
|
||||
|
||||
# Do all the work for Automake. This macro actually does too much --
|
||||
# some checks are only needed if your package does certain things.
|
||||
# But this isn't really a big deal.
|
||||
|
||||
# serial 1
|
||||
|
||||
dnl Usage:
|
||||
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
||||
|
||||
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||
PACKAGE=[$1]
|
||||
AC_SUBST(PACKAGE)
|
||||
VERSION=[$2]
|
||||
AC_SUBST(VERSION)
|
||||
dnl test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
ifelse([$3],,
|
||||
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
||||
AC_REQUIRE([AM_SANITY_CHECK])
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])
|
||||
dnl FIXME This is truly gross.
|
||||
missing_dir=`cd $ac_aux_dir && pwd`
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
||||
|
||||
#
|
||||
# Check to make sure that the build environment is sane.
|
||||
#
|
||||
|
||||
AC_DEFUN(AM_SANITY_CHECK,
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftestfile
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||
if test "[$]*" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftestfile`
|
||||
fi
|
||||
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
||||
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "[$]2" = conftestfile
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
rm -f conftest*
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
||||
dnl The program must properly implement --version.
|
||||
AC_DEFUN(AM_MISSING_PROG,
|
||||
[AC_MSG_CHECKING(for working $2)
|
||||
# Run test in a subshell; some versions of sh will print an error if
|
||||
# an executable is not found, even if stderr is redirected.
|
||||
# Redirect stdin to placate older versions of autoconf. Sigh.
|
||||
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
||||
$1=$2
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
$1="$3/missing $2"
|
||||
AC_MSG_RESULT(missing)
|
||||
fi
|
||||
AC_SUBST($1)])
|
||||
|
||||
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||
|
||||
AC_DEFUN(AM_CONFIG_HEADER,
|
||||
[AC_PREREQ([2.12])
|
||||
AC_CONFIG_HEADER([$1])
|
||||
dnl When config.status generates a header, we must update the stamp-h file.
|
||||
dnl This file resides in the same directory as the config header
|
||||
dnl that is generated. We must strip everything past the first ":",
|
||||
dnl and everything past the last "/".
|
||||
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
||||
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
||||
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
||||
<<am_indx=1
|
||||
for am_file in <<$1>>; do
|
||||
case " <<$>>CONFIG_HEADERS " in
|
||||
*" <<$>>am_file "*<<)>>
|
||||
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
||||
;;
|
||||
esac
|
||||
am_indx=`expr "<<$>>am_indx" + 1`
|
||||
done<<>>dnl>>)
|
||||
changequote([,]))])
|
||||
|
||||
# Add --enable-maintainer-mode option to configure.
|
||||
# From Jim Meyering
|
||||
|
||||
# serial 1
|
||||
|
||||
AC_DEFUN(AM_MAINTAINER_MODE,
|
||||
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
||||
dnl maintainer-mode is disabled by default
|
||||
AC_ARG_ENABLE(maintainer-mode,
|
||||
[ --enable-maintainer-mode enable make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer],
|
||||
USE_MAINTAINER_MODE=$enableval,
|
||||
USE_MAINTAINER_MODE=no)
|
||||
AC_MSG_RESULT($USE_MAINTAINER_MODE)
|
||||
AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
|
||||
MAINT=$MAINTAINER_MODE_TRUE
|
||||
AC_SUBST(MAINT)dnl
|
||||
]
|
||||
)
|
||||
|
||||
# Define a conditional.
|
||||
|
||||
AC_DEFUN(AM_CONDITIONAL,
|
||||
[AC_SUBST($1_TRUE)
|
||||
AC_SUBST($1_FALSE)
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi])
|
||||
|
||||
@@ -1,346 +0,0 @@
|
||||
/* addr2line.c -- convert addresses to line number and function name
|
||||
Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Contributed by Ulrich Lauther <Ulrich.Lauther@mchp.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@mchp.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", optional_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[=style]]\n\
|
||||
[--basenames] [--functions] [addr addr ...]\n"),
|
||||
program_name);
|
||||
list_supported_targets (program_name, stream);
|
||||
if (status == 0)
|
||||
fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO);
|
||||
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 ATTRIBUTE_UNUSED;
|
||||
{
|
||||
bfd_vma vma;
|
||||
bfd_size_type size;
|
||||
|
||||
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;
|
||||
|
||||
size = bfd_get_section_size_before_reloc (section);
|
||||
if (pc >= vma + size)
|
||||
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 == NULL || *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 && filename != NULL)
|
||||
{
|
||||
char *h;
|
||||
|
||||
h = strrchr (filename, '/');
|
||||
if (h != NULL)
|
||||
filename = h + 1;
|
||||
}
|
||||
|
||||
printf ("%s:%u\n", filename ? 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;
|
||||
{
|
||||
const char *filename;
|
||||
char *target;
|
||||
int c;
|
||||
|
||||
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
|
||||
setlocale (LC_MESSAGES, "");
|
||||
#endif
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
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;
|
||||
if (optarg != NULL)
|
||||
{
|
||||
enum demangling_styles style;
|
||||
|
||||
style = cplus_demangle_name_to_style (optarg);
|
||||
if (style == unknown_demangling)
|
||||
fatal (_("unknown demangling style `%s'"),
|
||||
optarg);
|
||||
|
||||
cplus_demangle_set_style (style);
|
||||
}
|
||||
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;
|
||||
}
|
||||
1450
binutils/ar.c
1450
binutils/ar.c
File diff suppressed because it is too large
Load Diff
@@ -1,87 +0,0 @@
|
||||
%{
|
||||
/* arlex.l - Strange script language lexer */
|
||||
|
||||
/* Copyright 1992, 1997, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
|
||||
/* Contributed by Steve Chamberlain
|
||||
sac@cygnus.com
|
||||
|
||||
*/
|
||||
#define DONTDECLARE_MALLOC
|
||||
#include <ansidecl.h>
|
||||
#include "libiberty.h"
|
||||
#include "arparse.h"
|
||||
|
||||
int linenumber;
|
||||
%}
|
||||
|
||||
%a 10000
|
||||
%o 25000
|
||||
|
||||
%%
|
||||
|
||||
"ADDLIB" { return ADDLIB; }
|
||||
"ADDMOD" { return ADDMOD; }
|
||||
"CLEAR" { return CLEAR; }
|
||||
"CREATE" { return CREATE; }
|
||||
"DELETE" { return DELETE; }
|
||||
"DIRECTORY" { return DIRECTORY; }
|
||||
"END" { return END; }
|
||||
"EXTRACT" { return EXTRACT; }
|
||||
"FULLDIR" { return FULLDIR; }
|
||||
"HELP" { return HELP; }
|
||||
"LIST" { return LIST; }
|
||||
"OPEN" { return OPEN; }
|
||||
"REPLACE" { return REPLACE; }
|
||||
"VERBOSE" { return VERBOSE; }
|
||||
"SAVE" { return SAVE; }
|
||||
"addlib" { return ADDLIB; }
|
||||
"addmod" { return ADDMOD; }
|
||||
"clear" { return CLEAR; }
|
||||
"create" { return CREATE; }
|
||||
"delete" { return DELETE; }
|
||||
"directory" { return DIRECTORY; }
|
||||
"end" { return END; }
|
||||
"extract" { return EXTRACT; }
|
||||
"fulldir" { return FULLDIR; }
|
||||
"help" { return HELP; }
|
||||
"list" { return LIST; }
|
||||
"open" { return OPEN; }
|
||||
"replace" { return REPLACE; }
|
||||
"verbose" { return VERBOSE; }
|
||||
"save" { return SAVE; }
|
||||
"+\n" { linenumber ++; }
|
||||
"(" { return '('; }
|
||||
")" { return ')'; }
|
||||
"," { return ','; }
|
||||
[A-Za-z0-9/$:.\-\_]+ {
|
||||
yylval.name = xstrdup (yytext);
|
||||
return FILENAME;
|
||||
}
|
||||
"*".* { }
|
||||
";".* { }
|
||||
" " { }
|
||||
"\n" { linenumber ++; return NEWLINE; }
|
||||
|
||||
%%
|
||||
#ifndef yywrap
|
||||
/* Needed for lex, though not flex. */
|
||||
int yywrap() { return 1; }
|
||||
#endif
|
||||
@@ -1,202 +0,0 @@
|
||||
%{
|
||||
/* arparse.y - Stange script language parser */
|
||||
|
||||
/* Copyright 1992, 1993, 1995, 1997, 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
|
||||
/* Contributed by Steve Chamberlain
|
||||
sac@cygnus.com
|
||||
|
||||
*/
|
||||
#define DONTDECLARE_MALLOC
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
#include "arsup.h"
|
||||
extern int verbose;
|
||||
extern int yylex PARAMS ((void));
|
||||
static int yyerror PARAMS ((const char *));
|
||||
%}
|
||||
|
||||
%union {
|
||||
char *name;
|
||||
struct list *list ;
|
||||
|
||||
};
|
||||
|
||||
%token NEWLINE
|
||||
%token VERBOSE
|
||||
%token <name> FILENAME
|
||||
%token ADDLIB
|
||||
%token LIST
|
||||
%token ADDMOD
|
||||
%token CLEAR
|
||||
%token CREATE
|
||||
%token DELETE
|
||||
%token DIRECTORY
|
||||
%token END
|
||||
%token EXTRACT
|
||||
%token FULLDIR
|
||||
%token HELP
|
||||
%token QUIT
|
||||
%token REPLACE
|
||||
%token SAVE
|
||||
%token OPEN
|
||||
|
||||
%type <list> modulelist
|
||||
%type <list> modulename
|
||||
%type <name> optional_filename
|
||||
%%
|
||||
|
||||
start:
|
||||
{ prompt(); } session
|
||||
;
|
||||
|
||||
session:
|
||||
session command_line
|
||||
|
|
||||
;
|
||||
|
||||
command_line:
|
||||
command NEWLINE { prompt(); }
|
||||
|
||||
command:
|
||||
open_command
|
||||
| create_command
|
||||
| verbose_command
|
||||
| directory_command
|
||||
| addlib_command
|
||||
| clear_command
|
||||
| addmod_command
|
||||
| save_command
|
||||
| extract_command
|
||||
| replace_command
|
||||
| delete_command
|
||||
| list_command
|
||||
| END { ar_end(); return 0; }
|
||||
| error
|
||||
| FILENAME { yyerror("foo"); }
|
||||
|
|
||||
;
|
||||
|
||||
|
||||
extract_command:
|
||||
EXTRACT modulename
|
||||
{ ar_extract($2); }
|
||||
;
|
||||
|
||||
replace_command:
|
||||
REPLACE modulename
|
||||
{ ar_replace($2); }
|
||||
;
|
||||
|
||||
clear_command:
|
||||
CLEAR
|
||||
{ ar_clear(); }
|
||||
;
|
||||
|
||||
delete_command:
|
||||
DELETE modulename
|
||||
{ ar_delete($2); }
|
||||
;
|
||||
addmod_command:
|
||||
ADDMOD modulename
|
||||
{ ar_addmod($2); }
|
||||
;
|
||||
|
||||
list_command:
|
||||
LIST
|
||||
{ ar_list(); }
|
||||
;
|
||||
|
||||
save_command:
|
||||
SAVE
|
||||
{ ar_save(); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
open_command:
|
||||
OPEN FILENAME
|
||||
{ ar_open($2,0); }
|
||||
;
|
||||
|
||||
create_command:
|
||||
CREATE FILENAME
|
||||
{ ar_open($2,1); }
|
||||
;
|
||||
|
||||
|
||||
addlib_command:
|
||||
ADDLIB FILENAME modulelist
|
||||
{ ar_addlib($2,$3); }
|
||||
;
|
||||
directory_command:
|
||||
DIRECTORY FILENAME modulelist optional_filename
|
||||
{ ar_directory($2, $3, $4); }
|
||||
;
|
||||
|
||||
|
||||
|
||||
optional_filename:
|
||||
FILENAME
|
||||
{ $$ = $1; }
|
||||
| { $$ = 0; }
|
||||
;
|
||||
|
||||
modulelist:
|
||||
'(' modulename ')'
|
||||
{ $$ = $2; }
|
||||
|
|
||||
{ $$ = 0; }
|
||||
;
|
||||
|
||||
modulename:
|
||||
modulename optcomma FILENAME
|
||||
{ struct list *n = (struct list *) malloc(sizeof(struct list));
|
||||
n->next = $1;
|
||||
n->name = $3;
|
||||
$$ = n;
|
||||
}
|
||||
| { $$ = 0; }
|
||||
;
|
||||
|
||||
|
||||
optcomma:
|
||||
','
|
||||
|
|
||||
;
|
||||
|
||||
|
||||
verbose_command:
|
||||
VERBOSE
|
||||
{ verbose = !verbose; }
|
||||
;
|
||||
|
||||
|
||||
%%
|
||||
|
||||
static int
|
||||
yyerror (x)
|
||||
const char *x ATTRIBUTE_UNUSED;
|
||||
{
|
||||
extern int linenumber;
|
||||
|
||||
printf (_("Syntax error in archive script, line %d\n"), linenumber + 1);
|
||||
return 0;
|
||||
}
|
||||
460
binutils/arsup.c
460
binutils/arsup.c
@@ -1,460 +0,0 @@
|
||||
/* arsup.c - Archive support for MRI compatibility
|
||||
Copyright 1992, 1994, 1995, 1996, 1997, 2000
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
|
||||
/* Contributed by Steve Chamberlain
|
||||
sac@cygnus.com
|
||||
|
||||
This file looks after requests from arparse.y, to provide the MRI
|
||||
style librarian command syntax + 1 word LIST
|
||||
|
||||
*/
|
||||
|
||||
#include "bfd.h"
|
||||
#include "arsup.h"
|
||||
#include "libiberty.h"
|
||||
#include "bucomm.h"
|
||||
#include "filenames.h"
|
||||
|
||||
static void map_over_list
|
||||
PARAMS ((bfd *, void (*function) (bfd *, bfd *), struct list *));
|
||||
static void ar_directory_doer PARAMS ((bfd *, bfd *));
|
||||
static void ar_addlib_doer PARAMS ((bfd *, bfd *));
|
||||
|
||||
extern int verbose;
|
||||
|
||||
static void
|
||||
map_over_list (arch, function, list)
|
||||
bfd *arch;
|
||||
void (*function) PARAMS ((bfd *, bfd *));
|
||||
struct list *list;
|
||||
{
|
||||
bfd *head;
|
||||
|
||||
if (list == NULL)
|
||||
{
|
||||
bfd *next;
|
||||
|
||||
head = arch->next;
|
||||
while (head != NULL)
|
||||
{
|
||||
next = head->next;
|
||||
function (head, (bfd *) NULL);
|
||||
head = next;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
struct list *ptr;
|
||||
|
||||
/* This may appear to be a baroque way of accomplishing what we
|
||||
want. however we have to iterate over the filenames in order
|
||||
to notice where a filename is requested but does not exist in
|
||||
the archive. Ditto mapping over each file each time -- we
|
||||
want to hack multiple references. */
|
||||
for (ptr = list; ptr; ptr = ptr->next)
|
||||
{
|
||||
boolean found = false;
|
||||
bfd *prev = arch;
|
||||
|
||||
for (head = arch->next; head; head = head->next)
|
||||
{
|
||||
if (head->filename != NULL
|
||||
&& FILENAME_CMP (ptr->name, head->filename) == 0)
|
||||
{
|
||||
found = true;
|
||||
function (head, prev);
|
||||
}
|
||||
prev = head;
|
||||
}
|
||||
if (! found)
|
||||
fprintf (stderr, _("No entry %s in archive.\n"), ptr->name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FILE *outfile;
|
||||
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
ar_directory_doer (abfd, ignore)
|
||||
bfd *abfd;
|
||||
bfd *ignore ATTRIBUTE_UNUSED;
|
||||
{
|
||||
print_arelt_descr(outfile, abfd, verbose);
|
||||
}
|
||||
|
||||
void
|
||||
ar_directory (ar_name, list, output)
|
||||
char *ar_name;
|
||||
struct list *list;
|
||||
char *output;
|
||||
{
|
||||
bfd *arch;
|
||||
|
||||
arch = open_inarch (ar_name, (char *) NULL);
|
||||
if (output)
|
||||
{
|
||||
outfile = fopen(output,"w");
|
||||
if (outfile == 0)
|
||||
{
|
||||
outfile = stdout;
|
||||
fprintf (stderr,_("Can't open file %s\n"), output);
|
||||
output = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
outfile = stdout;
|
||||
|
||||
map_over_list (arch, ar_directory_doer, list);
|
||||
|
||||
bfd_close (arch);
|
||||
|
||||
if (output)
|
||||
fclose (outfile);
|
||||
}
|
||||
|
||||
void
|
||||
DEFUN_VOID(prompt)
|
||||
{
|
||||
extern int interactive;
|
||||
if (interactive)
|
||||
{
|
||||
printf("AR >");
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
maybequit ()
|
||||
{
|
||||
if (! interactive)
|
||||
xexit (9);
|
||||
}
|
||||
|
||||
|
||||
bfd *obfd;
|
||||
char *real_name ;
|
||||
void
|
||||
DEFUN(ar_open,(name, t),
|
||||
char *name AND
|
||||
int t)
|
||||
|
||||
{
|
||||
char *tname = (char *) xmalloc (strlen (name) + 10);
|
||||
real_name = name;
|
||||
/* Prepend tmp- to the beginning, to avoid file-name clashes after
|
||||
truncation on filesystems with limited namespaces (DOS). */
|
||||
sprintf(tname, "tmp-%s", name);
|
||||
obfd = bfd_openw(tname, NULL);
|
||||
|
||||
if (!obfd) {
|
||||
fprintf(stderr,_("%s: Can't open output archive %s\n"), program_name,
|
||||
tname);
|
||||
|
||||
maybequit();
|
||||
}
|
||||
else {
|
||||
if (!t) {
|
||||
bfd **ptr;
|
||||
bfd *element;
|
||||
bfd *ibfd;
|
||||
ibfd = bfd_openr(name, NULL);
|
||||
if (!ibfd) {
|
||||
fprintf(stderr,_("%s: Can't open input archive %s\n"),
|
||||
program_name, name);
|
||||
maybequit();
|
||||
return;
|
||||
}
|
||||
if (bfd_check_format(ibfd, bfd_archive) != true) {
|
||||
fprintf(stderr,_("%s: file %s is not an archive\n"), program_name,
|
||||
name);
|
||||
maybequit();
|
||||
return;
|
||||
}
|
||||
ptr = &(obfd->archive_head);
|
||||
element = bfd_openr_next_archived_file(ibfd, NULL);
|
||||
|
||||
while (element) {
|
||||
*ptr = element;
|
||||
ptr = &element->next;
|
||||
element = bfd_openr_next_archived_file(ibfd, element);
|
||||
}
|
||||
}
|
||||
|
||||
bfd_set_format(obfd, bfd_archive);
|
||||
|
||||
obfd->has_armap = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ar_addlib_doer (abfd, prev)
|
||||
bfd *abfd;
|
||||
bfd *prev;
|
||||
{
|
||||
/* Add this module to the output bfd */
|
||||
if (prev != NULL)
|
||||
prev->next = abfd->next;
|
||||
abfd->next = obfd->archive_head;
|
||||
obfd->archive_head = abfd;
|
||||
}
|
||||
|
||||
void
|
||||
ar_addlib (name, list)
|
||||
char *name;
|
||||
struct list *list;
|
||||
{
|
||||
if (obfd == NULL)
|
||||
{
|
||||
fprintf (stderr, _("%s: no output archive specified yet\n"), program_name);
|
||||
maybequit ();
|
||||
}
|
||||
else
|
||||
{
|
||||
bfd *arch;
|
||||
|
||||
arch = open_inarch (name, (char *) NULL);
|
||||
if (arch != NULL)
|
||||
map_over_list (arch, ar_addlib_doer, list);
|
||||
|
||||
/* Don't close the bfd, since it will make the elements disasppear */
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
DEFUN(ar_addmod, (list),
|
||||
struct list *list)
|
||||
{
|
||||
if (!obfd) {
|
||||
fprintf(stderr, _("%s: no open output archive\n"), program_name);
|
||||
maybequit();
|
||||
}
|
||||
else
|
||||
{
|
||||
while (list) {
|
||||
bfd *abfd = bfd_openr(list->name, NULL);
|
||||
if (!abfd) {
|
||||
fprintf(stderr,_("%s: can't open file %s\n"), program_name,
|
||||
list->name);
|
||||
maybequit();
|
||||
}
|
||||
else {
|
||||
abfd->next = obfd->archive_head;
|
||||
obfd->archive_head = abfd;
|
||||
}
|
||||
list = list->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
DEFUN_VOID(ar_clear)
|
||||
{
|
||||
if (obfd)
|
||||
obfd->archive_head = 0;
|
||||
}
|
||||
|
||||
void
|
||||
DEFUN(ar_delete, (list),
|
||||
struct list *list)
|
||||
{
|
||||
if (!obfd) {
|
||||
fprintf(stderr, _("%s: no open output archive\n"), program_name);
|
||||
maybequit();
|
||||
}
|
||||
else
|
||||
{
|
||||
while (list) {
|
||||
/* Find this name in the archive */
|
||||
bfd *member = obfd->archive_head;
|
||||
bfd **prev = &(obfd->archive_head);
|
||||
int found = 0;
|
||||
while (member) {
|
||||
if (FILENAME_CMP(member->filename, list->name) == 0) {
|
||||
*prev = member->next;
|
||||
found = 1;
|
||||
}
|
||||
else {
|
||||
prev = &(member->next);
|
||||
}
|
||||
member = member->next;
|
||||
}
|
||||
if (!found) {
|
||||
fprintf(stderr,_("%s: can't find module file %s\n"), program_name,
|
||||
list->name);
|
||||
maybequit();
|
||||
}
|
||||
list = list->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DEFUN_VOID(ar_save)
|
||||
{
|
||||
|
||||
if (!obfd) {
|
||||
fprintf(stderr, _("%s: no open output archive\n"), program_name);
|
||||
maybequit();
|
||||
}
|
||||
else {
|
||||
char *ofilename = xstrdup (bfd_get_filename (obfd));
|
||||
bfd_close(obfd);
|
||||
|
||||
rename (ofilename, real_name);
|
||||
obfd = 0;
|
||||
free(ofilename);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
DEFUN(ar_replace, (list),
|
||||
struct list *list)
|
||||
{
|
||||
if (!obfd) {
|
||||
fprintf(stderr, _("%s: no open output archive\n"), program_name);
|
||||
maybequit();
|
||||
}
|
||||
else
|
||||
{
|
||||
while (list) {
|
||||
/* Find this name in the archive */
|
||||
bfd *member = obfd->archive_head;
|
||||
bfd **prev = &(obfd->archive_head);
|
||||
int found = 0;
|
||||
while (member)
|
||||
{
|
||||
if (FILENAME_CMP(member->filename, list->name) == 0)
|
||||
{
|
||||
/* Found the one to replace */
|
||||
bfd *abfd = bfd_openr(list->name, 0);
|
||||
if (!abfd)
|
||||
{
|
||||
fprintf(stderr, _("%s: can't open file %s\n"), program_name, list->name);
|
||||
maybequit();
|
||||
}
|
||||
else {
|
||||
*prev = abfd;
|
||||
abfd->next = member->next;
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
prev = &(member->next);
|
||||
}
|
||||
member = member->next;
|
||||
}
|
||||
if (!found) {
|
||||
bfd *abfd = bfd_openr(list->name, 0);
|
||||
fprintf(stderr,_("%s: can't find module file %s\n"), program_name,
|
||||
list->name);
|
||||
if (!abfd)
|
||||
{
|
||||
fprintf(stderr, _("%s: can't open file %s\n"), program_name, list->name);
|
||||
maybequit();
|
||||
}
|
||||
else
|
||||
{
|
||||
*prev = abfd;
|
||||
}
|
||||
}
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* And I added this one */
|
||||
void
|
||||
DEFUN_VOID(ar_list)
|
||||
{
|
||||
if (!obfd)
|
||||
{
|
||||
fprintf(stderr, _("%s: no open output archive\n"), program_name);
|
||||
maybequit();
|
||||
}
|
||||
else {
|
||||
bfd *abfd;
|
||||
outfile = stdout;
|
||||
verbose =1 ;
|
||||
printf(_("Current open archive is %s\n"), bfd_get_filename (obfd));
|
||||
for (abfd = obfd->archive_head;
|
||||
abfd != (bfd *)NULL;
|
||||
abfd = abfd->next)
|
||||
{
|
||||
ar_directory_doer (abfd, (bfd *) NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
DEFUN_VOID(ar_end)
|
||||
{
|
||||
if (obfd)
|
||||
{
|
||||
fclose((FILE *)(obfd->iostream));
|
||||
unlink(bfd_get_filename (obfd));
|
||||
}
|
||||
}
|
||||
void
|
||||
DEFUN(ar_extract,(list),
|
||||
struct list *list)
|
||||
{
|
||||
if (!obfd)
|
||||
{
|
||||
|
||||
fprintf(stderr, _("%s: no open archive\n"), program_name);
|
||||
maybequit();
|
||||
}
|
||||
else
|
||||
{
|
||||
while (list) {
|
||||
/* Find this name in the archive */
|
||||
bfd *member = obfd->archive_head;
|
||||
int found = 0;
|
||||
while (member && !found)
|
||||
{
|
||||
if (FILENAME_CMP(member->filename, list->name) == 0)
|
||||
{
|
||||
extract_file(member);
|
||||
found = 1;
|
||||
}
|
||||
|
||||
member = member->next;
|
||||
}
|
||||
if (!found) {
|
||||
bfd_openr(list->name, 0);
|
||||
fprintf(stderr,_("%s: can't find module file %s\n"), program_name,
|
||||
list->name);
|
||||
|
||||
}
|
||||
list = list->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
/* arsup.h - archive support header file
|
||||
Copyright 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
struct list {
|
||||
char *name;
|
||||
struct list *next;
|
||||
};
|
||||
|
||||
void
|
||||
maybequit PARAMS ((void));
|
||||
|
||||
void
|
||||
prompt PARAMS ((void));
|
||||
|
||||
void
|
||||
ar_clear PARAMS ((void));
|
||||
|
||||
void
|
||||
ar_replace PARAMS ((struct list *));
|
||||
|
||||
void
|
||||
ar_delete PARAMS ((struct list *));
|
||||
|
||||
void
|
||||
ar_save PARAMS ((void));
|
||||
|
||||
void
|
||||
ar_list PARAMS ((void));
|
||||
|
||||
void
|
||||
ar_open PARAMS ((char *, int));
|
||||
|
||||
void
|
||||
ar_directory PARAMS ((char *, struct list *, char *));
|
||||
|
||||
void
|
||||
ar_addmod PARAMS ((struct list *));
|
||||
|
||||
void
|
||||
ar_addlib PARAMS ((char *, struct list *));
|
||||
|
||||
void
|
||||
ar_end PARAMS ((void));
|
||||
|
||||
void
|
||||
ar_extract PARAMS ((struct list *));
|
||||
|
||||
bfd *
|
||||
open_inarch PARAMS ((const char *archive_filename, const char *));
|
||||
|
||||
int
|
||||
yyparse PARAMS ((void));
|
||||
|
||||
/* Functions from ar.c */
|
||||
|
||||
void
|
||||
extract_file PARAMS ((bfd * abfd));
|
||||
|
||||
extern int interactive;
|
||||
@@ -1,275 +0,0 @@
|
||||
/* bucomm.c -- Bin Utils COMmon code.
|
||||
Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
/* We might put this in a library someday so it could be dynamically
|
||||
loaded, but for now it's not necessary. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "libiberty.h"
|
||||
#include "bucomm.h"
|
||||
#include "filenames.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <time.h> /* ctime, maybe time_t */
|
||||
|
||||
#ifndef HAVE_TIME_T_IN_TIME_H
|
||||
#ifndef HAVE_TIME_T_IN_TYPES_H
|
||||
typedef long time_t;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Error reporting */
|
||||
|
||||
char *program_name;
|
||||
|
||||
void
|
||||
bfd_nonfatal (string)
|
||||
CONST char *string;
|
||||
{
|
||||
CONST char *errmsg = bfd_errmsg (bfd_get_error ());
|
||||
|
||||
if (string)
|
||||
fprintf (stderr, "%s: %s: %s\n", program_name, string, errmsg);
|
||||
else
|
||||
fprintf (stderr, "%s: %s\n", program_name, errmsg);
|
||||
}
|
||||
|
||||
void
|
||||
bfd_fatal (string)
|
||||
CONST char *string;
|
||||
{
|
||||
bfd_nonfatal (string);
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
void
|
||||
report (format, args)
|
||||
const char * format;
|
||||
va_list args;
|
||||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
vfprintf (stderr, format, args);
|
||||
putc ('\n', stderr);
|
||||
}
|
||||
|
||||
#ifdef ANSI_PROTOTYPES
|
||||
void
|
||||
fatal (const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start (args, format);
|
||||
report (format, args);
|
||||
va_end (args);
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
void
|
||||
non_fatal (const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start (args, format);
|
||||
report (format, args);
|
||||
va_end (args);
|
||||
}
|
||||
#else
|
||||
void
|
||||
fatal (va_alist)
|
||||
va_dcl
|
||||
{
|
||||
char *Format;
|
||||
va_list args;
|
||||
|
||||
va_start (args);
|
||||
Format = va_arg (args, char *);
|
||||
report (Format, args);
|
||||
va_end (args);
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
void
|
||||
non_fatal (va_alist)
|
||||
va_dcl
|
||||
{
|
||||
char *Format;
|
||||
va_list args;
|
||||
|
||||
va_start (args);
|
||||
Format = va_arg (args, char *);
|
||||
report (Format, args);
|
||||
va_end (args);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Set the default BFD target based on the configured target. Doing
|
||||
this permits the binutils to be configured for a particular target,
|
||||
and linked against a shared BFD library which was configured for a
|
||||
different target. */
|
||||
|
||||
void
|
||||
set_default_bfd_target ()
|
||||
{
|
||||
/* The macro TARGET is defined by Makefile. */
|
||||
const char *target = TARGET;
|
||||
|
||||
if (! bfd_set_default_target (target))
|
||||
fatal (_("can't set BFD default target to `%s': %s"),
|
||||
target, bfd_errmsg (bfd_get_error ()));
|
||||
}
|
||||
|
||||
/* After a false return from bfd_check_format_matches with
|
||||
bfd_get_error () == bfd_error_file_ambiguously_recognized, print
|
||||
the possible matching targets. */
|
||||
|
||||
void
|
||||
list_matching_formats (p)
|
||||
char **p;
|
||||
{
|
||||
fprintf (stderr, _("%s: Matching formats:"), program_name);
|
||||
while (*p)
|
||||
fprintf (stderr, " %s", *p++);
|
||||
fputc ('\n', stderr);
|
||||
}
|
||||
|
||||
/* List the supported targets. */
|
||||
|
||||
void
|
||||
list_supported_targets (name, f)
|
||||
const char *name;
|
||||
FILE *f;
|
||||
{
|
||||
extern const bfd_target *const *bfd_target_vector;
|
||||
int t;
|
||||
|
||||
if (name == NULL)
|
||||
fprintf (f, _("Supported targets:"));
|
||||
else
|
||||
fprintf (f, _("%s: supported targets:"), name);
|
||||
for (t = 0; bfd_target_vector[t] != NULL; t++)
|
||||
fprintf (f, " %s", bfd_target_vector[t]->name);
|
||||
fprintf (f, "\n");
|
||||
}
|
||||
|
||||
/* Display the archive header for an element as if it were an ls -l listing:
|
||||
|
||||
Mode User\tGroup\tSize\tDate Name */
|
||||
|
||||
void
|
||||
print_arelt_descr (file, abfd, verbose)
|
||||
FILE *file;
|
||||
bfd *abfd;
|
||||
boolean verbose;
|
||||
{
|
||||
struct stat buf;
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
if (bfd_stat_arch_elt (abfd, &buf) == 0)
|
||||
{
|
||||
char modebuf[11];
|
||||
char timebuf[40];
|
||||
time_t when = buf.st_mtime;
|
||||
CONST char *ctime_result = (CONST char *) ctime (&when);
|
||||
|
||||
/* POSIX format: skip weekday and seconds from ctime output. */
|
||||
sprintf (timebuf, "%.12s %.4s", ctime_result + 4, ctime_result + 20);
|
||||
|
||||
mode_string (buf.st_mode, modebuf);
|
||||
modebuf[10] = '\0';
|
||||
/* POSIX 1003.2/D11 says to skip first character (entry type). */
|
||||
fprintf (file, "%s %ld/%ld %6ld %s ", modebuf + 1,
|
||||
(long) buf.st_uid, (long) buf.st_gid,
|
||||
(long) buf.st_size, timebuf);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf (file, "%s\n", bfd_get_filename (abfd));
|
||||
}
|
||||
|
||||
/* Return the name of a temporary file in the same directory as FILENAME. */
|
||||
|
||||
char *
|
||||
make_tempname (filename)
|
||||
char *filename;
|
||||
{
|
||||
static char template[] = "stXXXXXX";
|
||||
char *tmpname;
|
||||
char *slash = strrchr (filename, '/');
|
||||
|
||||
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
|
||||
{
|
||||
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
|
||||
char *bslash = strrchr (filename, '\\');
|
||||
if (slash == NULL || (bslash != NULL && bslash > slash))
|
||||
slash = bslash;
|
||||
if (slash == NULL && filename[0] != '\0' && filename[1] == ':')
|
||||
slash = filename + 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (slash != (char *) NULL)
|
||||
{
|
||||
char c;
|
||||
|
||||
c = *slash;
|
||||
*slash = 0;
|
||||
tmpname = xmalloc (strlen (filename) + sizeof (template) + 2);
|
||||
strcpy (tmpname, filename);
|
||||
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
|
||||
/* If tmpname is "X:", appending a slash will make it a root
|
||||
directory on drive X, which is NOT the same as the current
|
||||
directory on drive X. */
|
||||
if (tmpname[1] == ':' && tmpname[2] == '\0')
|
||||
strcat (tmpname, ".");
|
||||
#endif
|
||||
strcat (tmpname, "/");
|
||||
strcat (tmpname, template);
|
||||
mktemp (tmpname);
|
||||
*slash = c;
|
||||
}
|
||||
else
|
||||
{
|
||||
tmpname = xmalloc (sizeof (template));
|
||||
strcpy (tmpname, template);
|
||||
mktemp (tmpname);
|
||||
}
|
||||
return tmpname;
|
||||
}
|
||||
|
||||
/* Parse a string into a VMA, with a fatal error if it can't be
|
||||
parsed. */
|
||||
|
||||
bfd_vma
|
||||
parse_vma (s, arg)
|
||||
const char *s;
|
||||
const char *arg;
|
||||
{
|
||||
bfd_vma ret;
|
||||
const char *end;
|
||||
|
||||
ret = bfd_scan_vma (s, &end, 0);
|
||||
|
||||
if (*end != '\0')
|
||||
fatal (_("%s: bad number: %s"), arg, s);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
/* bucomm.h -- binutils common include file.
|
||||
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
#ifndef _BUCOMM_H
|
||||
#define _BUCOMM_H
|
||||
|
||||
#include "ansidecl.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "bin-bugs.h"
|
||||
|
||||
#ifdef ANSI_PROTOTYPES
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
#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
|
||||
|
||||
#ifdef NEED_DECLARATION_ENVIRON
|
||||
extern char **environ;
|
||||
#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
|
||||
|
||||
#if defined(__GNUC__) && !defined(C_ALLOCA)
|
||||
# undef alloca
|
||||
# define alloca __builtin_alloca
|
||||
#else
|
||||
# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA)
|
||||
# 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 HAVE_LOCALE_H
|
||||
# include <locale.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
|
||||
# define gettext(Msgid) (Msgid)
|
||||
# define dgettext(Domainname, Msgid) (Msgid)
|
||||
# define dcgettext(Domainname, Msgid, Category) (Msgid)
|
||||
# define textdomain(Domainname) while (0) /* nothing */
|
||||
# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
|
||||
# define _(String) (String)
|
||||
# define N_(String) (String)
|
||||
#endif
|
||||
|
||||
/* bucomm.c */
|
||||
void bfd_nonfatal PARAMS ((const char *));
|
||||
|
||||
void bfd_fatal PARAMS ((const char *)) ATTRIBUTE_NORETURN;
|
||||
|
||||
void report PARAMS ((const char *, va_list));
|
||||
|
||||
void fatal PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
|
||||
|
||||
void non_fatal PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
|
||||
|
||||
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 *));
|
||||
|
||||
/* rename.c */
|
||||
extern void set_times PARAMS ((const char *, const struct stat *));
|
||||
|
||||
extern int smart_rename PARAMS ((const char *, const char *, int));
|
||||
|
||||
/* libiberty */
|
||||
PTR xmalloc PARAMS ((size_t));
|
||||
|
||||
PTR xrealloc PARAMS ((PTR, size_t));
|
||||
|
||||
#endif /* _BUCOMM_H */
|
||||
@@ -1,58 +0,0 @@
|
||||
/* budbg.c -- Interfaces to the generic debugging information routines.
|
||||
Copyright 1995, 1996 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor <ian@cygnus.com>.
|
||||
|
||||
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 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. */
|
||||
|
||||
#ifndef BUDBG_H
|
||||
#define BUDBG_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Routine used to read generic debugging information. */
|
||||
|
||||
extern PTR read_debugging_info PARAMS ((bfd *, asymbol **, long));
|
||||
|
||||
/* Routine used to print generic debugging information. */
|
||||
|
||||
extern boolean print_debugging_info PARAMS ((FILE *, PTR));
|
||||
|
||||
/* Routines used to read and write stabs information. */
|
||||
|
||||
extern PTR start_stab PARAMS ((PTR, bfd *, boolean, asymbol **, long));
|
||||
|
||||
extern boolean finish_stab PARAMS ((PTR, PTR));
|
||||
|
||||
extern boolean parse_stab PARAMS ((PTR, PTR, int, int, bfd_vma, const char *));
|
||||
|
||||
extern boolean write_stabs_in_sections_debugging_info
|
||||
PARAMS ((bfd *, PTR, bfd_byte **, bfd_size_type *, bfd_byte **,
|
||||
bfd_size_type *));
|
||||
|
||||
/* Routines used to read and write IEEE debugging information. */
|
||||
|
||||
extern boolean parse_ieee
|
||||
PARAMS ((PTR, bfd *, const bfd_byte *, bfd_size_type));
|
||||
|
||||
extern boolean write_ieee_debugging_info PARAMS ((bfd *, PTR));
|
||||
|
||||
/* Routine used to read COFF debugging information. */
|
||||
|
||||
extern boolean parse_coff PARAMS ((bfd *, asymbol **, long, PTR));
|
||||
|
||||
#endif
|
||||
@@ -1,539 +0,0 @@
|
||||
/* Coff file dumper.
|
||||
Copyright 1994, 1995, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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>
|
||||
|
||||
This module reads a type tree generated by coffgrok and prints
|
||||
it out so we can test the grokker.
|
||||
*/
|
||||
|
||||
#include <bfd.h>
|
||||
#include <getopt.h>
|
||||
#include <libiberty.h>
|
||||
|
||||
#include "coffgrok.h"
|
||||
#include "bucomm.h"
|
||||
|
||||
#define PROGRAM_VERSION "1.0"
|
||||
|
||||
static int atnl;
|
||||
static void dump_coff_scope ();
|
||||
|
||||
static void
|
||||
tab (x)
|
||||
int x;
|
||||
{
|
||||
static int indent;
|
||||
int i;
|
||||
|
||||
if (atnl)
|
||||
{
|
||||
if (x < 0)
|
||||
{
|
||||
printf (")");
|
||||
indent += x;
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("\n");
|
||||
atnl = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (x == -1)
|
||||
{
|
||||
for (i = 0; i < indent; i++)
|
||||
printf (" ");
|
||||
|
||||
indent += x;
|
||||
printf (")");
|
||||
return;
|
||||
}
|
||||
|
||||
indent += x;
|
||||
|
||||
for (i = 0; i < indent; i++)
|
||||
printf (" ");
|
||||
|
||||
if (x)
|
||||
{
|
||||
printf ("(");
|
||||
}
|
||||
}
|
||||
|
||||
static void nl ()
|
||||
{
|
||||
atnl = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
dump_coff_lines (p)
|
||||
struct coff_line *p;
|
||||
{
|
||||
int i;
|
||||
int online = 0;
|
||||
tab(1);
|
||||
printf(_("#lines %d "),p->nlines);
|
||||
for (i = 0; i < p->nlines; i++)
|
||||
{
|
||||
printf("(%d 0x%x)", p->lines[i], p->addresses[i]);
|
||||
online++;
|
||||
if (online > 6)
|
||||
{
|
||||
nl();
|
||||
tab(0);
|
||||
online = 0;
|
||||
}
|
||||
}
|
||||
nl();
|
||||
tab(-1);
|
||||
}
|
||||
|
||||
static void
|
||||
dump_coff_type (p)
|
||||
struct coff_type *p;
|
||||
{
|
||||
tab (1);
|
||||
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 ();
|
||||
dump_coff_type (p->u.pointer.points_to);
|
||||
break;
|
||||
case coff_array_type:
|
||||
printf ("array [%d] of", p->u.array.dim);
|
||||
nl ();
|
||||
dump_coff_type (p->u.array.array_of);
|
||||
break;
|
||||
case coff_function_type:
|
||||
printf ("function returning");
|
||||
nl ();
|
||||
dump_coff_type (p->u.function.function_returns);
|
||||
dump_coff_lines (p->u.function.lines);
|
||||
printf ("arguments");
|
||||
nl ();
|
||||
dump_coff_scope (p->u.function.parameters);
|
||||
tab (0);
|
||||
printf ("code");
|
||||
nl ();
|
||||
dump_coff_scope (p->u.function.code);
|
||||
tab(0);
|
||||
break;
|
||||
case coff_structdef_type:
|
||||
printf ("structure definition");
|
||||
nl ();
|
||||
dump_coff_scope (p->u.astructdef.elements);
|
||||
break;
|
||||
case coff_structref_type:
|
||||
if (!p->u.aenumref.ref)
|
||||
printf ("structure ref to UNKNOWN struct");
|
||||
else
|
||||
printf ("structure ref to %s", p->u.aenumref.ref->name);
|
||||
break;
|
||||
case coff_enumref_type:
|
||||
printf ("enum ref to %s", p->u.astructref.ref->name);
|
||||
break;
|
||||
case coff_enumdef_type:
|
||||
printf ("enum definition");
|
||||
nl ();
|
||||
dump_coff_scope (p->u.aenumdef.elements);
|
||||
break;
|
||||
case coff_basic_type:
|
||||
switch (p->u.basic)
|
||||
{
|
||||
case T_NULL:
|
||||
printf ("NULL");
|
||||
break;
|
||||
case T_VOID:
|
||||
printf ("VOID");
|
||||
break;
|
||||
case T_CHAR:
|
||||
printf ("CHAR");
|
||||
break;
|
||||
case T_SHORT:
|
||||
printf ("SHORT");
|
||||
break;
|
||||
case T_INT:
|
||||
printf ("INT ");
|
||||
break;
|
||||
case T_LONG:
|
||||
printf ("LONG");
|
||||
break;
|
||||
case T_FLOAT:
|
||||
printf ("FLOAT");
|
||||
break;
|
||||
case T_DOUBLE:
|
||||
printf ("DOUBLE");
|
||||
break;
|
||||
case T_STRUCT:
|
||||
printf ("STRUCT");
|
||||
break;
|
||||
case T_UNION:
|
||||
printf ("UNION");
|
||||
break;
|
||||
case T_ENUM:
|
||||
printf ("ENUM");
|
||||
break;
|
||||
case T_MOE:
|
||||
printf ("MOE ");
|
||||
break;
|
||||
case T_UCHAR:
|
||||
printf ("UCHAR");
|
||||
break;
|
||||
case T_USHORT:
|
||||
printf ("USHORT");
|
||||
break;
|
||||
case T_UINT:
|
||||
printf ("UINT");
|
||||
break;
|
||||
case T_ULONG:
|
||||
printf ("ULONG");
|
||||
break;
|
||||
case T_LNGDBL:
|
||||
printf ("LNGDBL");
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
nl ();
|
||||
tab (-1);
|
||||
}
|
||||
|
||||
static void
|
||||
dump_coff_where (p)
|
||||
struct coff_where *p;
|
||||
{
|
||||
tab (1);
|
||||
switch (p->where)
|
||||
{
|
||||
case coff_where_stack:
|
||||
printf ("Stack offset %x", p->offset);
|
||||
break;
|
||||
case coff_where_memory:
|
||||
printf ("Memory section %s+%x", p->section->name, p->offset);
|
||||
break;
|
||||
case coff_where_register:
|
||||
printf ("Register %d", p->offset);
|
||||
break;
|
||||
case coff_where_member_of_struct:
|
||||
printf ("Struct Member offset %x", p->offset);
|
||||
break;
|
||||
case coff_where_member_of_enum:
|
||||
printf ("Enum Member offset %x", p->offset);
|
||||
break;
|
||||
case coff_where_unknown:
|
||||
printf ("Undefined symbol");
|
||||
break;
|
||||
case coff_where_strtag:
|
||||
printf ("STRTAG");
|
||||
case coff_where_entag:
|
||||
printf ("ENTAG");
|
||||
break;
|
||||
case coff_where_typedef:
|
||||
printf ("TYPEDEF");
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
nl ();
|
||||
tab (-1);
|
||||
}
|
||||
|
||||
static void
|
||||
dump_coff_visible (p)
|
||||
struct coff_visible *p;
|
||||
{
|
||||
tab (1);
|
||||
switch (p->type)
|
||||
{
|
||||
case coff_vis_ext_def:
|
||||
printf ("coff_vis_ext_def");
|
||||
break;
|
||||
case coff_vis_ext_ref:
|
||||
printf ("coff_vis_ext_ref");
|
||||
break;
|
||||
case coff_vis_int_def:
|
||||
printf ("coff_vis_int_def");
|
||||
break;
|
||||
case coff_vis_common:
|
||||
printf ("coff_vis_common");
|
||||
break;
|
||||
case coff_vis_auto:
|
||||
printf ("coff_vis_auto");
|
||||
break;
|
||||
case coff_vis_autoparam:
|
||||
printf ("coff_vis_autoparam");
|
||||
break;
|
||||
case coff_vis_regparam:
|
||||
printf ("coff_vis_regparam");
|
||||
break;
|
||||
case coff_vis_register:
|
||||
printf ("coff_vis_register");
|
||||
break;
|
||||
case coff_vis_tag:
|
||||
printf ("coff_vis_tag");
|
||||
break;
|
||||
case coff_vis_member_of_struct:
|
||||
printf ("coff_vis_member_of_struct");
|
||||
break;
|
||||
case coff_vis_member_of_enum:
|
||||
printf ("coff_vis_member_of_enum");
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
nl ();
|
||||
tab (-1);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
dump_coff_symbol (p)
|
||||
struct coff_symbol *p;
|
||||
{
|
||||
tab (1);
|
||||
printf ("List of symbols");
|
||||
nl ();
|
||||
while (p)
|
||||
{
|
||||
tab (1);
|
||||
tab (1);
|
||||
printf ("Symbol %s, tag %d, number %d", p->name, p->tag, p->number);
|
||||
nl ();
|
||||
tab (-1);
|
||||
tab (1);
|
||||
printf ("Type");
|
||||
nl ();
|
||||
dump_coff_type (p->type);
|
||||
tab (-1);
|
||||
tab (1);
|
||||
printf ("Where");
|
||||
dump_coff_where (p->where);
|
||||
tab (-1);
|
||||
tab (1);
|
||||
printf ("Visible");
|
||||
dump_coff_visible (p->visible);
|
||||
tab (-1);
|
||||
p = p->next;
|
||||
tab (-1);
|
||||
}
|
||||
tab (-1);
|
||||
}
|
||||
|
||||
static void
|
||||
dump_coff_scope (p)
|
||||
struct coff_scope *p;
|
||||
{
|
||||
if (p) {
|
||||
tab (1);
|
||||
printf ("List of blocks %lx ",(unsigned long) p);
|
||||
|
||||
if (p->sec) {
|
||||
printf( " %s %x..%x", p->sec->name,p->offset, p->offset + p->size -1);
|
||||
}
|
||||
nl ();
|
||||
tab (0);
|
||||
printf ("*****************");
|
||||
nl ();
|
||||
while (p)
|
||||
{
|
||||
tab (0);
|
||||
printf ("vars %d", p->nvars);
|
||||
nl ();
|
||||
dump_coff_symbol (p->vars_head);
|
||||
printf ("blocks");
|
||||
nl ();
|
||||
dump_coff_scope (p->list_head);
|
||||
nl ();
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
tab (0);
|
||||
printf ("*****************");
|
||||
nl ();
|
||||
tab (-1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dump_coff_sfile (p)
|
||||
struct coff_sfile *p;
|
||||
{
|
||||
tab (1);
|
||||
printf ("List of source files");
|
||||
nl ();
|
||||
while (p)
|
||||
{
|
||||
tab (0);
|
||||
printf ("Source file %s", p->name);
|
||||
nl ();
|
||||
dump_coff_scope (p->scope);
|
||||
p = p->next;
|
||||
}
|
||||
tab (-1);
|
||||
}
|
||||
|
||||
static void
|
||||
dump_coff_section(ptr)
|
||||
struct coff_section *ptr;
|
||||
{
|
||||
int i;
|
||||
tab(1);
|
||||
printf("section %s %d %d address %x size %x number %d nrelocs %d",
|
||||
ptr->name, ptr->code, ptr->data, ptr->address,ptr->size, ptr->number, ptr->nrelocs);
|
||||
nl();
|
||||
|
||||
for (i = 0; i < ptr->nrelocs; i++)
|
||||
{
|
||||
tab(0);
|
||||
printf("(%x %s %x)",
|
||||
ptr->relocs[i].offset,
|
||||
ptr->relocs[i].symbol->name,
|
||||
ptr->relocs[i].addend);
|
||||
nl();
|
||||
}
|
||||
tab(-1);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
coff_dump (ptr)
|
||||
struct coff_ofile *ptr;
|
||||
{
|
||||
int i;
|
||||
printf ("Coff dump");
|
||||
nl ();
|
||||
printf ("#souces %d", ptr->nsources);
|
||||
nl ();
|
||||
dump_coff_sfile (ptr->source_head);
|
||||
for (i = 0; i < ptr->nsections; i++)
|
||||
dump_coff_section(ptr->sections + i);
|
||||
}
|
||||
|
||||
|
||||
|
||||
char * program_name;
|
||||
|
||||
static void
|
||||
show_usage (file, status)
|
||||
FILE *file;
|
||||
int status;
|
||||
{
|
||||
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"),
|
||||
program_name);
|
||||
show_usage (stdout, 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (ac, av)
|
||||
int ac;
|
||||
char *av[];
|
||||
{
|
||||
bfd *abfd;
|
||||
struct coff_ofile *tree;
|
||||
char **matching;
|
||||
char *input_file = NULL;
|
||||
int opt;
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{ "help", no_argument, 0, 'h' },
|
||||
{ "version", no_argument, 0, 'V' },
|
||||
{ NULL, no_argument, 0, 0 }
|
||||
};
|
||||
|
||||
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
|
||||
setlocale (LC_MESSAGES, "");
|
||||
#endif
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
program_name = av[0];
|
||||
xmalloc_set_program_name (program_name);
|
||||
|
||||
while ((opt = getopt_long (ac, av, "hV", long_options,
|
||||
(int *) NULL))
|
||||
!= EOF)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
case 'h':
|
||||
show_help ();
|
||||
/*NOTREACHED*/
|
||||
case 'V':
|
||||
printf (_("GNU %s version %s\n"), program_name, PROGRAM_VERSION);
|
||||
exit (0);
|
||||
/*NOTREACHED*/
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
show_usage (stderr, 1);
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
}
|
||||
|
||||
if (optind < ac)
|
||||
{
|
||||
input_file = av[optind];
|
||||
}
|
||||
|
||||
if (!input_file)
|
||||
{
|
||||
fatal (_("no input file specified"));
|
||||
}
|
||||
abfd = bfd_openr (input_file, 0);
|
||||
|
||||
if (!abfd)
|
||||
bfd_fatal (input_file);
|
||||
|
||||
if (! bfd_check_format_matches (abfd, bfd_object, &matching))
|
||||
{
|
||||
bfd_nonfatal (input_file);
|
||||
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
|
||||
{
|
||||
list_matching_formats (matching);
|
||||
free (matching);
|
||||
}
|
||||
exit (1);
|
||||
}
|
||||
|
||||
tree = coff_grok (abfd);
|
||||
|
||||
coff_dump(tree);
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -1,737 +0,0 @@
|
||||
/* coffgrok.c
|
||||
Copyright 1994, 1995, 1997, 1998, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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)
|
||||
|
||||
This module reads a coff file and builds a really simple type tree
|
||||
which can be read by other programs. The first application is a
|
||||
coff->sysroff converter. It can be tested with coffdump.c.
|
||||
|
||||
*/
|
||||
|
||||
#include <bfd.h>
|
||||
#include "bucomm.h"
|
||||
|
||||
#include "coff/internal.h"
|
||||
#include "../bfd/libcoff.h"
|
||||
#include "coffgrok.h"
|
||||
int lofile = 1;
|
||||
static struct coff_scope *top_scope;
|
||||
static struct coff_scope *file_scope;
|
||||
static struct coff_ofile *ofile;
|
||||
|
||||
struct coff_symbol *last_function_symbol;
|
||||
struct coff_type *last_function_type;
|
||||
struct coff_type *last_struct;
|
||||
struct coff_type *last_enum;
|
||||
struct coff_sfile *cur_sfile;
|
||||
|
||||
static struct coff_symbol **tindex;
|
||||
|
||||
|
||||
static asymbol **syms;
|
||||
static long symcount;
|
||||
|
||||
#define N(x) ((x)->_n._n_nptr[1])
|
||||
|
||||
static struct coff_ptr_struct *rawsyms;
|
||||
static int rawcount;
|
||||
static bfd *abfd;
|
||||
extern char *xcalloc ();
|
||||
#define PTR_SIZE 4
|
||||
#define SHORT_SIZE 2
|
||||
#define INT_SIZE 4
|
||||
#define LONG_SIZE 4
|
||||
#define FLOAT_SIZE 4
|
||||
#define DOUBLE_SIZE 8
|
||||
|
||||
#define INDEXOF(p) ((struct coff_ptr_struct *)(p)-(rawsyms))
|
||||
|
||||
static struct coff_scope *
|
||||
empty_scope ()
|
||||
{
|
||||
struct coff_scope *l;
|
||||
l = (struct coff_scope *) (xcalloc (sizeof (struct coff_scope), 1));
|
||||
return l;
|
||||
}
|
||||
|
||||
static struct coff_symbol *
|
||||
empty_symbol ()
|
||||
{
|
||||
return (struct coff_symbol *) (xcalloc (sizeof (struct coff_symbol), 1));
|
||||
}
|
||||
|
||||
/*int l;*/
|
||||
static void
|
||||
push_scope (link)
|
||||
int link;
|
||||
{
|
||||
struct coff_scope *n = empty_scope ();
|
||||
if (link)
|
||||
{
|
||||
if (top_scope)
|
||||
{
|
||||
if (top_scope->list_tail)
|
||||
{
|
||||
top_scope->list_tail->next = n;
|
||||
}
|
||||
else
|
||||
{
|
||||
top_scope->list_head = n;
|
||||
}
|
||||
top_scope->list_tail = n;
|
||||
}
|
||||
}
|
||||
n->parent = top_scope;
|
||||
|
||||
top_scope = n;
|
||||
}
|
||||
|
||||
static void
|
||||
pop_scope ()
|
||||
{
|
||||
top_scope = top_scope->parent;
|
||||
}
|
||||
|
||||
static void
|
||||
do_sections_p1 (head)
|
||||
struct coff_ofile *head;
|
||||
{
|
||||
asection *section;
|
||||
int idx;
|
||||
struct coff_section *all = (struct coff_section *) (xcalloc (abfd->section_count + 1,
|
||||
sizeof (struct coff_section)));
|
||||
head->nsections = abfd->section_count + 1;
|
||||
head->sections = all;
|
||||
|
||||
for (idx = 0, section = abfd->sections; section; section = section->next, idx++)
|
||||
{
|
||||
long relsize;
|
||||
int i = section->target_index;
|
||||
arelent **relpp;
|
||||
long relcount;
|
||||
|
||||
relsize = bfd_get_reloc_upper_bound (abfd, section);
|
||||
if (relsize < 0)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
if (relsize == 0)
|
||||
continue;
|
||||
relpp = (arelent **) xmalloc (relsize);
|
||||
relcount = bfd_canonicalize_reloc (abfd, section, relpp, syms);
|
||||
if (relcount < 0)
|
||||
bfd_fatal (bfd_get_filename (abfd));
|
||||
|
||||
head->sections[i].name = (char *) (section->name);
|
||||
head->sections[i].code = section->flags & SEC_CODE;
|
||||
head->sections[i].data = section->flags & SEC_DATA;
|
||||
if (strcmp (section->name, ".bss") == 0)
|
||||
head->sections[i].data = 1;
|
||||
head->sections[i].address = section->lma;
|
||||
head->sections[i].size = section->_raw_size;
|
||||
head->sections[i].number = idx;
|
||||
head->sections[i].nrelocs = section->reloc_count;
|
||||
head->sections[i].relocs =
|
||||
(struct coff_reloc *) (xcalloc (section->reloc_count,
|
||||
sizeof (struct coff_reloc)));
|
||||
head->sections[i].bfd_section = section;
|
||||
}
|
||||
head->sections[0].name = "ABSOLUTE";
|
||||
head->sections[0].code = 0;
|
||||
head->sections[0].data = 0;
|
||||
head->sections[0].address = 0;
|
||||
head->sections[0].size = 0;
|
||||
head->sections[0].number = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
do_sections_p2 (head)
|
||||
struct coff_ofile *head;
|
||||
{
|
||||
asection *section;
|
||||
for (section = abfd->sections; section; section = section->next)
|
||||
{
|
||||
unsigned int j;
|
||||
|
||||
for (j = 0; j < section->reloc_count; j++)
|
||||
{
|
||||
int idx;
|
||||
int i = section->target_index;
|
||||
struct coff_reloc *r = head->sections[i].relocs + j;
|
||||
arelent *sr = section->relocation + j;
|
||||
r->offset = sr->address;
|
||||
r->addend = sr->addend;
|
||||
idx = ((coff_symbol_type *) (sr->sym_ptr_ptr[0]))->native - rawsyms;
|
||||
r->symbol = tindex[idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static struct coff_where *
|
||||
do_where (i)
|
||||
int i;
|
||||
{
|
||||
struct internal_syment *sym = &rawsyms[i].u.syment;
|
||||
struct coff_where *where =
|
||||
(struct coff_where *) (xmalloc (sizeof (struct coff_where)));
|
||||
where->offset = sym->n_value;
|
||||
|
||||
if (sym->n_scnum == -1)
|
||||
sym->n_scnum = 0;
|
||||
|
||||
switch (sym->n_sclass)
|
||||
{
|
||||
case C_FIELD:
|
||||
where->where = coff_where_member_of_struct;
|
||||
where->offset = sym->n_value / 8;
|
||||
where->bitoffset = sym->n_value % 8;
|
||||
where->bitsize = rawsyms[i + 1].u.auxent.x_sym.x_misc.x_lnsz.x_size;
|
||||
break;
|
||||
case C_MOE:
|
||||
where->where = coff_where_member_of_enum;
|
||||
break;
|
||||
case C_MOS:
|
||||
case C_MOU:
|
||||
where->where = coff_where_member_of_struct;
|
||||
break;
|
||||
case C_AUTO:
|
||||
case C_ARG:
|
||||
where->where = coff_where_stack;
|
||||
break;
|
||||
case C_EXT:
|
||||
case C_STAT:
|
||||
case C_EXTDEF:
|
||||
case C_LABEL:
|
||||
where->where = coff_where_memory;
|
||||
where->section = &ofile->sections[sym->n_scnum];
|
||||
break;
|
||||
case C_REG:
|
||||
case C_REGPARM:
|
||||
where->where = coff_where_register;
|
||||
break;
|
||||
case C_ENTAG:
|
||||
where->where = coff_where_entag;
|
||||
break;
|
||||
case C_STRTAG:
|
||||
case C_UNTAG:
|
||||
where->where = coff_where_strtag;
|
||||
break;
|
||||
case C_TPDEF:
|
||||
where->where = coff_where_typedef;
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
break;
|
||||
}
|
||||
return where;
|
||||
}
|
||||
|
||||
static
|
||||
struct coff_line *
|
||||
do_lines (i, name)
|
||||
int i;
|
||||
char *name ATTRIBUTE_UNUSED;
|
||||
{
|
||||
struct coff_line *res = (struct coff_line *) xcalloc (sizeof (struct coff_line), 1);
|
||||
asection *s;
|
||||
unsigned int l;
|
||||
|
||||
/* Find out if this function has any line numbers in the table */
|
||||
for (s = abfd->sections; s; s = s->next)
|
||||
{
|
||||
for (l = 0; l < s->lineno_count; l++)
|
||||
{
|
||||
if (s->lineno[l].line_number == 0)
|
||||
{
|
||||
if (rawsyms + i == ((coff_symbol_type *) (&(s->lineno[l].u.sym[0])))->native)
|
||||
{
|
||||
/* These lines are for this function - so count them and stick them on */
|
||||
int c = 0;
|
||||
/* Find the linenumber of the top of the function, since coff linenumbers
|
||||
are relative to the start of the function. */
|
||||
int start_line = rawsyms[i + 3].u.auxent.x_sym.x_misc.x_lnsz.x_lnno;
|
||||
|
||||
l++;
|
||||
for (c = 0; s->lineno[l + c + 1].line_number; c++)
|
||||
;
|
||||
|
||||
/* Add two extra records, one for the prologue and one for the epilogue */
|
||||
c += 1;
|
||||
res->nlines = c;
|
||||
res->lines = (int *) (xcalloc (sizeof (int), c));
|
||||
res->addresses = (int *) (xcalloc (sizeof (int), c));
|
||||
res->lines[0] = start_line;
|
||||
res->addresses[0] = rawsyms[i].u.syment.n_value - s->vma;
|
||||
for (c = 0; s->lineno[l + c + 1].line_number; c++)
|
||||
{
|
||||
res->lines[c + 1] = s->lineno[l + c].line_number + start_line - 1;
|
||||
res->addresses[c + 1] = s->lineno[l + c].u.offset;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static
|
||||
struct coff_type *
|
||||
do_type (i)
|
||||
int i;
|
||||
{
|
||||
struct internal_syment *sym = &rawsyms[i].u.syment;
|
||||
union internal_auxent *aux = &rawsyms[i + 1].u.auxent;
|
||||
struct coff_type *res =
|
||||
(struct coff_type *) xmalloc (sizeof (struct coff_type));
|
||||
int type = sym->n_type;
|
||||
int which_dt = 0;
|
||||
int dimind = 0;
|
||||
|
||||
res->type = coff_basic_type;
|
||||
res->u.basic = type & 0xf;
|
||||
|
||||
switch (type & 0xf)
|
||||
{
|
||||
case T_NULL:
|
||||
case T_VOID:
|
||||
if (sym->n_numaux && sym->n_sclass == C_STAT)
|
||||
{
|
||||
/* This is probably a section definition */
|
||||
res->type = coff_secdef_type;
|
||||
res->size = aux->x_scn.x_scnlen;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (type == 0)
|
||||
{
|
||||
/* Don't know what this is, let's make it a simple int */
|
||||
res->size = INT_SIZE;
|
||||
res->u.basic = T_UINT;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Else it could be a function or pointer to void */
|
||||
res->size = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
break;
|
||||
case T_UCHAR:
|
||||
case T_CHAR:
|
||||
res->size = 1;
|
||||
break;
|
||||
case T_USHORT:
|
||||
case T_SHORT:
|
||||
res->size = SHORT_SIZE;
|
||||
break;
|
||||
case T_UINT:
|
||||
case T_INT:
|
||||
res->size = INT_SIZE;
|
||||
break;
|
||||
case T_ULONG:
|
||||
case T_LONG:
|
||||
res->size = LONG_SIZE;
|
||||
break;
|
||||
case T_FLOAT:
|
||||
res->size = FLOAT_SIZE;
|
||||
break;
|
||||
case T_DOUBLE:
|
||||
res->size = DOUBLE_SIZE;
|
||||
break;
|
||||
case T_STRUCT:
|
||||
case T_UNION:
|
||||
if (sym->n_numaux)
|
||||
{
|
||||
if (aux->x_sym.x_tagndx.p)
|
||||
{
|
||||
/* Refering to a struct defined elsewhere */
|
||||
res->type = coff_structref_type;
|
||||
res->u.astructref.ref = tindex[INDEXOF (aux->x_sym.x_tagndx.p)];
|
||||
res->size = res->u.astructref.ref ?
|
||||
res->u.astructref.ref->type->size : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A definition of a struct */
|
||||
last_struct = res;
|
||||
res->type = coff_structdef_type;
|
||||
res->u.astructdef.elements = empty_scope ();
|
||||
res->u.astructdef.idx = 0;
|
||||
res->u.astructdef.isstruct = (type & 0xf) == T_STRUCT;
|
||||
res->size = aux->x_sym.x_misc.x_lnsz.x_size;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No auxents - it's anonynmous */
|
||||
res->type = coff_structref_type;
|
||||
res->u.astructref.ref = 0;
|
||||
res->size = 0;
|
||||
}
|
||||
break;
|
||||
case T_ENUM:
|
||||
if (aux->x_sym.x_tagndx.p)
|
||||
{
|
||||
/* Refering to a enum defined elsewhere */
|
||||
res->type = coff_enumref_type;
|
||||
res->u.aenumref.ref = tindex[INDEXOF (aux->x_sym.x_tagndx.p)];
|
||||
res->size = res->u.aenumref.ref->type->size;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A definition of an enum */
|
||||
last_enum = res;
|
||||
res->type = coff_enumdef_type;
|
||||
res->u.aenumdef.elements = empty_scope ();
|
||||
res->size = aux->x_sym.x_misc.x_lnsz.x_size;
|
||||
}
|
||||
break;
|
||||
case T_MOE:
|
||||
break;
|
||||
}
|
||||
|
||||
for (which_dt = 5; which_dt >= 0; which_dt--)
|
||||
{
|
||||
switch ((type >> ((which_dt * 2) + 4)) & 0x3)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case DT_ARY:
|
||||
{
|
||||
struct coff_type *ptr = ((struct coff_type *)
|
||||
xmalloc (sizeof (struct coff_type)));
|
||||
int els = (dimind < DIMNUM
|
||||
? aux->x_sym.x_fcnary.x_ary.x_dimen[dimind]
|
||||
: 0);
|
||||
++dimind;
|
||||
ptr->type = coff_array_type;
|
||||
ptr->size = els * res->size;
|
||||
ptr->u.array.dim = els;
|
||||
ptr->u.array.array_of = res;
|
||||
res = ptr;
|
||||
break;
|
||||
}
|
||||
case DT_PTR:
|
||||
{
|
||||
struct coff_type *ptr =
|
||||
(struct coff_type *) xmalloc (sizeof (struct coff_type));
|
||||
ptr->size = PTR_SIZE;
|
||||
ptr->type = coff_pointer_type;
|
||||
ptr->u.pointer.points_to = res;
|
||||
res = ptr;
|
||||
break;
|
||||
}
|
||||
case DT_FCN:
|
||||
{
|
||||
struct coff_type *ptr
|
||||
= (struct coff_type *) xmalloc (sizeof (struct coff_type));
|
||||
ptr->size = 0;
|
||||
ptr->type = coff_function_type;
|
||||
ptr->u.function.function_returns = res;
|
||||
ptr->u.function.parameters = empty_scope ();
|
||||
ptr->u.function.lines = do_lines (i, sym->_n._n_nptr[1]);
|
||||
ptr->u.function.code = 0;
|
||||
last_function_type = ptr;
|
||||
res = ptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static struct coff_visible *
|
||||
do_visible (i)
|
||||
int i;
|
||||
{
|
||||
struct internal_syment *sym = &rawsyms[i].u.syment;
|
||||
struct coff_visible *visible =
|
||||
(struct coff_visible *) (xmalloc (sizeof (struct coff_visible)));
|
||||
enum coff_vis_type t;
|
||||
switch (sym->n_sclass)
|
||||
{
|
||||
case C_MOS:
|
||||
case C_MOU:
|
||||
case C_FIELD:
|
||||
t = coff_vis_member_of_struct;
|
||||
break;
|
||||
case C_MOE:
|
||||
t = coff_vis_member_of_enum;
|
||||
break;
|
||||
|
||||
case C_REGPARM:
|
||||
t = coff_vis_regparam;
|
||||
break;
|
||||
|
||||
case C_REG:
|
||||
t = coff_vis_register;
|
||||
break;
|
||||
case C_STRTAG:
|
||||
case C_UNTAG:
|
||||
case C_ENTAG:
|
||||
case C_TPDEF:
|
||||
t = coff_vis_tag;
|
||||
break;
|
||||
case C_AUTOARG:
|
||||
case C_ARG:
|
||||
t = coff_vis_autoparam;
|
||||
break;
|
||||
case C_AUTO:
|
||||
|
||||
|
||||
t = coff_vis_auto;
|
||||
break;
|
||||
case C_LABEL:
|
||||
case C_STAT:
|
||||
t = coff_vis_int_def;
|
||||
break;
|
||||
case C_EXT:
|
||||
if (sym->n_scnum == N_UNDEF)
|
||||
{
|
||||
if (sym->n_value)
|
||||
t = coff_vis_common;
|
||||
else
|
||||
t = coff_vis_ext_ref;
|
||||
}
|
||||
else
|
||||
t = coff_vis_ext_def;
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
break;
|
||||
|
||||
}
|
||||
visible->type = t;
|
||||
return visible;
|
||||
}
|
||||
|
||||
static int
|
||||
do_define (i, b)
|
||||
int i;
|
||||
struct coff_scope *b;
|
||||
{
|
||||
static int symbol_index;
|
||||
struct internal_syment *sym = &rawsyms[i].u.syment;
|
||||
|
||||
/* Define a symbol and attach to block b */
|
||||
struct coff_symbol *s = empty_symbol ();
|
||||
|
||||
s->number = ++symbol_index;
|
||||
s->name = sym->_n._n_nptr[1];
|
||||
s->sfile = cur_sfile;
|
||||
/* Glue onto the ofile list */
|
||||
if (lofile >= 0)
|
||||
{
|
||||
if (ofile->symbol_list_tail)
|
||||
ofile->symbol_list_tail->next_in_ofile_list = s;
|
||||
else
|
||||
ofile->symbol_list_head = s;
|
||||
ofile->symbol_list_tail = s;
|
||||
/* And the block list */
|
||||
}
|
||||
if (b->vars_tail)
|
||||
b->vars_tail->next = s;
|
||||
else
|
||||
b->vars_head = s;
|
||||
|
||||
b->vars_tail = s;
|
||||
b->nvars++;
|
||||
s->type = do_type (i);
|
||||
s->where = do_where (i);
|
||||
s->visible = do_visible (i);
|
||||
|
||||
tindex[i] = s;
|
||||
|
||||
/* We remember the lowest address in each section for each source file */
|
||||
|
||||
if (s->where->where == coff_where_memory
|
||||
&& s->type->type == coff_secdef_type)
|
||||
{
|
||||
struct coff_isection *is = cur_sfile->section + s->where->section->number;
|
||||
|
||||
if (!is->init)
|
||||
{
|
||||
is->low = s->where->offset;
|
||||
is->high = s->where->offset + s->type->size;
|
||||
is->init = 1;
|
||||
is->parent = s->where->section;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (s->type->type == coff_function_type)
|
||||
last_function_symbol = s;
|
||||
|
||||
return i + sym->n_numaux + 1;
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
struct coff_ofile *
|
||||
doit ()
|
||||
{
|
||||
int i;
|
||||
int infile = 0;
|
||||
struct coff_ofile *head =
|
||||
(struct coff_ofile *) xmalloc (sizeof (struct coff_ofile));
|
||||
ofile = head;
|
||||
head->source_head = 0;
|
||||
head->source_tail = 0;
|
||||
head->nsources = 0;
|
||||
head->symbol_list_tail = 0;
|
||||
head->symbol_list_head = 0;
|
||||
do_sections_p1 (head);
|
||||
push_scope (1);
|
||||
|
||||
for (i = 0; i < rawcount;)
|
||||
{
|
||||
struct internal_syment *sym = &rawsyms[i].u.syment;
|
||||
switch (sym->n_sclass)
|
||||
{
|
||||
case C_FILE:
|
||||
{
|
||||
/* new source file announced */
|
||||
struct coff_sfile *n =
|
||||
(struct coff_sfile *) xmalloc (sizeof (struct coff_sfile));
|
||||
n->section = (struct coff_isection *) xcalloc (sizeof (struct coff_isection), abfd->section_count + 1);
|
||||
cur_sfile = n;
|
||||
n->name = sym->_n._n_nptr[1];
|
||||
n->next = 0;
|
||||
|
||||
if (infile)
|
||||
{
|
||||
pop_scope ();
|
||||
}
|
||||
infile = 1;
|
||||
push_scope (1);
|
||||
file_scope = n->scope = top_scope;
|
||||
|
||||
if (head->source_tail)
|
||||
head->source_tail->next = n;
|
||||
else
|
||||
head->source_head = n;
|
||||
head->source_tail = n;
|
||||
head->nsources++;
|
||||
i += sym->n_numaux + 1;
|
||||
}
|
||||
break;
|
||||
case C_FCN:
|
||||
{
|
||||
char *name = sym->_n._n_nptr[1];
|
||||
if (name[1] == 'b')
|
||||
{
|
||||
/* Function start */
|
||||
push_scope (0);
|
||||
last_function_type->u.function.code = top_scope;
|
||||
top_scope->sec = ofile->sections + sym->n_scnum;
|
||||
top_scope->offset = sym->n_value;
|
||||
}
|
||||
else
|
||||
{
|
||||
top_scope->size = sym->n_value - top_scope->offset + 1;
|
||||
pop_scope ();
|
||||
|
||||
}
|
||||
i += sym->n_numaux + 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case C_BLOCK:
|
||||
{
|
||||
char *name = sym->_n._n_nptr[1];
|
||||
if (name[1] == 'b')
|
||||
{
|
||||
/* Block start */
|
||||
push_scope (1);
|
||||
top_scope->sec = ofile->sections + sym->n_scnum;
|
||||
top_scope->offset = sym->n_value;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
top_scope->size = sym->n_value - top_scope->offset + 1;
|
||||
pop_scope ();
|
||||
}
|
||||
i += sym->n_numaux + 1;
|
||||
}
|
||||
break;
|
||||
case C_REGPARM:
|
||||
case C_ARG:
|
||||
i = do_define (i, last_function_symbol->type->u.function.parameters);
|
||||
break;
|
||||
case C_MOS:
|
||||
case C_MOU:
|
||||
case C_FIELD:
|
||||
i = do_define (i, last_struct->u.astructdef.elements);
|
||||
break;
|
||||
case C_MOE:
|
||||
i = do_define (i, last_enum->u.aenumdef.elements);
|
||||
break;
|
||||
case C_STRTAG:
|
||||
case C_ENTAG:
|
||||
case C_UNTAG:
|
||||
/* Various definition */
|
||||
i = do_define (i, top_scope);
|
||||
break;
|
||||
case C_EXT:
|
||||
case C_LABEL:
|
||||
i = do_define (i, file_scope);
|
||||
break;
|
||||
case C_STAT:
|
||||
case C_TPDEF:
|
||||
case C_AUTO:
|
||||
case C_REG:
|
||||
i = do_define (i, top_scope);
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
case C_EOS:
|
||||
i += sym->n_numaux + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
do_sections_p2 (head);
|
||||
return head;
|
||||
}
|
||||
|
||||
struct coff_ofile *
|
||||
coff_grok (inabfd)
|
||||
bfd *inabfd;
|
||||
{
|
||||
long storage;
|
||||
struct coff_ofile *p;
|
||||
abfd = inabfd;
|
||||
storage = bfd_get_symtab_upper_bound (abfd);
|
||||
|
||||
if (storage < 0)
|
||||
bfd_fatal (abfd->filename);
|
||||
|
||||
syms = (asymbol **) xmalloc (storage);
|
||||
symcount = bfd_canonicalize_symtab (abfd, syms);
|
||||
if (symcount < 0)
|
||||
bfd_fatal (abfd->filename);
|
||||
rawsyms = obj_raw_syments (abfd);
|
||||
rawcount = obj_raw_syment_count (abfd);;
|
||||
tindex = (struct coff_symbol **) (xcalloc (sizeof (struct coff_symbol *), rawcount));
|
||||
|
||||
p = doit ();
|
||||
return p;
|
||||
}
|
||||
@@ -1,225 +0,0 @@
|
||||
/* coffgrok.h
|
||||
Copyright 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
#define T_NULL 0
|
||||
#define T_VOID 1 /* function argument (only used by compiler) */
|
||||
#define T_CHAR 2 /* character */
|
||||
#define T_SHORT 3 /* short integer */
|
||||
#define T_INT 4 /* integer */
|
||||
#define T_LONG 5 /* long integer */
|
||||
#define T_FLOAT 6 /* floating point */
|
||||
#define T_DOUBLE 7 /* double word */
|
||||
#define T_STRUCT 8 /* structure */
|
||||
#define T_UNION 9 /* union */
|
||||
#define T_ENUM 10 /* enumeration */
|
||||
#define T_MOE 11 /* member of enumeration*/
|
||||
#define T_UCHAR 12 /* unsigned character */
|
||||
#define T_USHORT 13 /* unsigned short */
|
||||
#define T_UINT 14 /* unsigned integer */
|
||||
#define T_ULONG 15 /* unsigned long */
|
||||
#define T_LNGDBL 16 /* long double */
|
||||
|
||||
|
||||
struct coff_reloc
|
||||
{
|
||||
int offset;
|
||||
struct coff_symbol *symbol;
|
||||
int addend;
|
||||
};
|
||||
|
||||
struct coff_section
|
||||
{
|
||||
char *name;
|
||||
int code;
|
||||
int data;
|
||||
int address;
|
||||
int number; /* 0..n, .text = 0 */
|
||||
int nrelocs;
|
||||
int size;
|
||||
struct coff_reloc *relocs;
|
||||
struct sec *bfd_section;
|
||||
};
|
||||
|
||||
struct coff_ofile
|
||||
{
|
||||
int nsources;
|
||||
struct coff_sfile *source_head;
|
||||
struct coff_sfile *source_tail;
|
||||
int nsections;
|
||||
struct coff_section *sections;
|
||||
struct coff_symbol *symbol_list_head;
|
||||
struct coff_symbol *symbol_list_tail;
|
||||
};
|
||||
|
||||
struct coff_isection {
|
||||
int low;
|
||||
int high;
|
||||
int init;
|
||||
struct coff_section *parent;
|
||||
};
|
||||
|
||||
struct coff_sfile
|
||||
{
|
||||
char *name;
|
||||
struct coff_scope *scope;
|
||||
struct coff_sfile *next;
|
||||
|
||||
/* Vector which maps where in each output section
|
||||
the input file has it's data */
|
||||
struct coff_isection *section;
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct coff_type
|
||||
{
|
||||
int size;
|
||||
enum
|
||||
{
|
||||
coff_pointer_type, coff_function_type, coff_array_type, coff_structdef_type, coff_basic_type,
|
||||
coff_structref_type, coff_enumref_type, coff_enumdef_type, coff_secdef_type
|
||||
} type;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
int address;
|
||||
int size;
|
||||
} asecdef;
|
||||
|
||||
struct
|
||||
{
|
||||
int isstruct;
|
||||
struct coff_scope *elements;
|
||||
int idx;
|
||||
}
|
||||
astructdef;
|
||||
struct
|
||||
{
|
||||
struct coff_symbol *ref;
|
||||
} astructref;
|
||||
|
||||
struct
|
||||
{
|
||||
struct coff_scope *elements;
|
||||
int idx;
|
||||
} aenumdef;
|
||||
struct
|
||||
{
|
||||
struct coff_symbol *ref;
|
||||
} aenumref;
|
||||
|
||||
struct
|
||||
{
|
||||
struct coff_type *points_to;
|
||||
} pointer;
|
||||
struct
|
||||
{
|
||||
int dim;
|
||||
struct coff_type *array_of;
|
||||
} array;
|
||||
|
||||
struct
|
||||
{
|
||||
struct coff_type *function_returns;
|
||||
struct coff_scope *parameters;
|
||||
struct coff_scope *code;
|
||||
struct coff_line *lines;
|
||||
} function;
|
||||
int basic; /* One of T_VOID.. T_UINT */
|
||||
} u;
|
||||
};
|
||||
|
||||
|
||||
struct coff_line
|
||||
{
|
||||
int nlines;
|
||||
int *lines;
|
||||
int *addresses;
|
||||
};
|
||||
|
||||
|
||||
struct coff_scope
|
||||
{
|
||||
struct coff_section *sec; /* What section */
|
||||
int offset; /* where */
|
||||
int size; /* How big */
|
||||
struct coff_scope *parent; /* one up */
|
||||
|
||||
struct coff_scope *next; /*next along */
|
||||
|
||||
int nvars;
|
||||
|
||||
struct coff_symbol *vars_head; /* symbols */
|
||||
struct coff_symbol *vars_tail;
|
||||
|
||||
struct coff_scope *list_head; /* children */
|
||||
struct coff_scope *list_tail;
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct coff_visible
|
||||
{
|
||||
enum coff_vis_type
|
||||
{
|
||||
coff_vis_ext_def,
|
||||
coff_vis_ext_ref,
|
||||
coff_vis_int_def,
|
||||
coff_vis_common,
|
||||
coff_vis_auto,
|
||||
coff_vis_register,
|
||||
coff_vis_tag,
|
||||
coff_vis_member_of_struct,
|
||||
coff_vis_member_of_enum,
|
||||
coff_vis_autoparam,
|
||||
coff_vis_regparam,
|
||||
} type;
|
||||
};
|
||||
|
||||
struct coff_where
|
||||
{
|
||||
enum
|
||||
{
|
||||
coff_where_stack, coff_where_memory, coff_where_register, coff_where_unknown,
|
||||
coff_where_strtag, coff_where_member_of_struct,
|
||||
coff_where_member_of_enum, coff_where_entag, coff_where_typedef
|
||||
|
||||
} where;
|
||||
int offset;
|
||||
int bitoffset;
|
||||
int bitsize;
|
||||
struct coff_section *section;
|
||||
};
|
||||
|
||||
struct coff_symbol
|
||||
{
|
||||
char *name;
|
||||
int tag;
|
||||
struct coff_type *type;
|
||||
struct coff_where *where;
|
||||
struct coff_visible *visible;
|
||||
struct coff_symbol *next;
|
||||
struct coff_symbol *next_in_ofile_list; /* For the ofile list */
|
||||
int number;
|
||||
int er_number;
|
||||
struct coff_sfile *sfile;
|
||||
};
|
||||
|
||||
struct coff_ofile *coff_grok();
|
||||
@@ -1,189 +0,0 @@
|
||||
/* config.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#undef inline
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if lex declares yytext as a char * by default, not a char[]. */
|
||||
#undef YYTEXT_POINTER
|
||||
|
||||
/* Define if you have the __argz_count function. */
|
||||
#undef HAVE___ARGZ_COUNT
|
||||
|
||||
/* Define if you have the __argz_next function. */
|
||||
#undef HAVE___ARGZ_NEXT
|
||||
|
||||
/* Define if you have the __argz_stringify function. */
|
||||
#undef HAVE___ARGZ_STRINGIFY
|
||||
|
||||
/* Define if you have the dcgettext function. */
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define if you have the munmap function. */
|
||||
#undef HAVE_MUNMAP
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define if you have the sbrk function. */
|
||||
#undef HAVE_SBRK
|
||||
|
||||
/* Define if you have the setenv function. */
|
||||
#undef HAVE_SETENV
|
||||
|
||||
/* Define if you have the setlocale function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define if you have the setmode function. */
|
||||
#undef HAVE_SETMODE
|
||||
|
||||
/* Define if you have the stpcpy function. */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
/* Define if you have the strchr function. */
|
||||
#undef HAVE_STRCHR
|
||||
|
||||
/* Define if you have the utimes function. */
|
||||
#undef HAVE_UTIMES
|
||||
|
||||
/* Define if you have the <argz.h> header file. */
|
||||
#undef HAVE_ARGZ_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <nl_types.h> header file. */
|
||||
#undef HAVE_NL_TYPES_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the <values.h> header file. */
|
||||
#undef HAVE_VALUES_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define if you have the stpcpy function */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define if your locale.h file contains LC_MESSAGES. */
|
||||
#undef HAVE_LC_MESSAGES
|
||||
|
||||
/* Define to 1 if NLS is requested */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
|
||||
#undef HAVE_GETTEXT
|
||||
|
||||
/* Does the platform use an executable suffix? */
|
||||
#undef HAVE_EXECUTABLE_SUFFIX
|
||||
|
||||
/* Suffix used for executables, if any. */
|
||||
#undef EXECUTABLE_SUFFIX
|
||||
|
||||
/* Is the type time_t defined in <time.h>? */
|
||||
#undef HAVE_TIME_T_IN_TIME_H
|
||||
|
||||
/* Is the type time_t defined in <sys/types.h>? */
|
||||
#undef HAVE_TIME_T_IN_TYPES_H
|
||||
|
||||
/* Does <utime.h> define struct utimbuf? */
|
||||
#undef HAVE_GOOD_UTIME_H
|
||||
|
||||
/* Define if fprintf is not declared in system header files. */
|
||||
#undef NEED_DECLARATION_FPRINTF
|
||||
|
||||
/* Define if strstr is not declared in system header files. */
|
||||
#undef NEED_DECLARATION_STRSTR
|
||||
|
||||
/* Define if sbrk is not declared in system header files. */
|
||||
#undef NEED_DECLARATION_SBRK
|
||||
|
||||
/* Define if getenv is not declared in system header files. */
|
||||
#undef NEED_DECLARATION_GETENV
|
||||
|
||||
/* Define if environ is not declared in system header files. */
|
||||
#undef NEED_DECLARATION_ENVIRON
|
||||
|
||||
/* Use b modifier when opening binary files? */
|
||||
#undef USE_BINARY_FOPEN
|
||||
|
||||
/* Configured target name. */
|
||||
#undef TARGET
|
||||
|
||||
5942
binutils/configure
vendored
5942
binutils/configure
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,76 +0,0 @@
|
||||
$!
|
||||
$! This file configures binutils for use with openVMS/Alpha
|
||||
$! We do not use the configure script, since we do not have /bin/sh
|
||||
$! to execute it.
|
||||
$!
|
||||
$! Written by Klaus K"ampf (kkaempf@rmi.de)
|
||||
$!
|
||||
$arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2
|
||||
$arch = f$element(arch_indx,"|","|VAX|Alpha|")
|
||||
$!
|
||||
$!
|
||||
$! Generate config.h
|
||||
$!
|
||||
$ create []config.h
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.in. Generated automatically from configure.in by autoheader. */
|
||||
/* Is the type time_t defined in <time.h>? */
|
||||
#define HAVE_TIME_T_IN_TIME_H 1
|
||||
/* Is the type time_t defined in <sys/types.h>? */
|
||||
#define HAVE_TIME_T_IN_TYPES_H 1
|
||||
/* Does <utime.h> define struct utimbuf? */
|
||||
#define HAVE_GOOD_UTIME_H 1
|
||||
/* Whether fprintf must be declared even if <stdio.h> is included. */
|
||||
#define NEED_DECLARATION_FPRINTF 1
|
||||
/* Whether sbrk must be declared even if <unistd.h> is included. */
|
||||
#undef NEED_DECLARATION_SBRK
|
||||
/* Do we need to use the b modifier when opening binary files? */
|
||||
/* #undef USE_BINARY_FOPEN */
|
||||
/* Define if you have the sbrk function. */
|
||||
/* #undef HAVE_SBRK 1 */
|
||||
/* Define if you have the utimes function. */
|
||||
#define HAVE_UTIMES 1
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#define HAVE_SYS_FILE_H 1
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
$ write sys$output "Generated `config.h'"
|
||||
$!
|
||||
$!
|
||||
$! Edit VERSION in makefile.vms-in
|
||||
$!
|
||||
$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
|
||||
[]makefile.vms-in /output=[]makefile.vms
|
||||
$DECK
|
||||
!
|
||||
! Get VERSION from configure.in
|
||||
!
|
||||
mfile := CREATE_BUFFER("mfile", "CONFIGURE.IN");
|
||||
rang := CREATE_RANGE(BEGINNING_OF(mfile), END_OF(mfile));
|
||||
match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(binutils, ', FORWARD, EXACT, rang);
|
||||
IF match_pos <> 0 THEN;
|
||||
POSITION(BEGINNING_OF(match_pos));
|
||||
ERASE(match_pos);
|
||||
vers := CURRENT_LINE-")";
|
||||
ELSE;
|
||||
vers := "unknown";
|
||||
ENDIF;
|
||||
|
||||
file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
|
||||
rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
|
||||
match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang);
|
||||
POSITION(BEGINNING_OF(match_pos));
|
||||
ERASE(match_pos);
|
||||
COPY_TEXT(vers);
|
||||
WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
|
||||
QUIT
|
||||
$ EOD
|
||||
$ write sys$output "Created `makefile.vms'"
|
||||
@@ -1,295 +0,0 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
AC_PREREQ(2.13)
|
||||
AC_INIT(ar.c)
|
||||
|
||||
AC_CANONICAL_SYSTEM
|
||||
AC_ISC_POSIX
|
||||
|
||||
changequote(,)dnl
|
||||
BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
|
||||
changequote([,])dnl
|
||||
AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION})
|
||||
|
||||
AM_PROG_LIBTOOL
|
||||
|
||||
AC_ARG_ENABLE(targets,
|
||||
[ --enable-targets alternative target configurations],
|
||||
[case "${enableval}" in
|
||||
yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
|
||||
;;
|
||||
no) enable_targets= ;;
|
||||
*) enable_targets=$enableval ;;
|
||||
esac])dnl
|
||||
AC_ARG_ENABLE(commonbfdlib,
|
||||
[ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
|
||||
[case "${enableval}" in
|
||||
yes) commonbfdlib=true ;;
|
||||
no) commonbfdlib=false ;;
|
||||
*) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
|
||||
esac])dnl
|
||||
|
||||
build_warnings="-W -Wall"
|
||||
AC_ARG_ENABLE(build-warnings,
|
||||
[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
|
||||
[case "${enableval}" in
|
||||
yes) ;;
|
||||
no) build_warnings="-w";;
|
||||
,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
|
||||
build_warnings="${build_warnings} ${t}";;
|
||||
*,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
|
||||
build_warnings="${t} ${build_warnings}";;
|
||||
*) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
|
||||
esac
|
||||
if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
|
||||
echo "Setting warning flags = $build_warnings" 6>&1
|
||||
fi])dnl
|
||||
WARN_CFLAGS=""
|
||||
if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
|
||||
WARN_CFLAGS="${build_warnings}"
|
||||
fi
|
||||
AC_SUBST(WARN_CFLAGS)
|
||||
|
||||
AM_CONFIG_HEADER(config.h:config.in)
|
||||
|
||||
if test -z "$target" ; then
|
||||
AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
|
||||
fi
|
||||
if test -z "$host" ; then
|
||||
AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
|
||||
fi
|
||||
|
||||
AC_PROG_CC
|
||||
|
||||
AC_PROG_YACC
|
||||
AM_PROG_LEX
|
||||
|
||||
ALL_LINGUAS=
|
||||
CY_GNU_GETTEXT
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
AC_EXEEXT
|
||||
if test -n "$EXEEXT"; then
|
||||
AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
|
||||
[Does the platform use an executable suffix?])
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
|
||||
[Suffix used for executables, if any.])
|
||||
|
||||
# host-specific stuff:
|
||||
|
||||
HDEFINES=
|
||||
|
||||
. ${srcdir}/../bfd/configure.host
|
||||
|
||||
AC_SUBST(HDEFINES)
|
||||
AR=${AR-ar}
|
||||
AC_SUBST(AR)
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_INSTALL
|
||||
|
||||
BFD_CC_FOR_BUILD
|
||||
|
||||
DEMANGLER_NAME=c++filt
|
||||
case "${host}" in
|
||||
*-*-go32* | *-*-msdos*)
|
||||
DEMANGLER_NAME=cxxfilt
|
||||
esac
|
||||
AC_SUBST(DEMANGLER_NAME)
|
||||
|
||||
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 setmode)
|
||||
|
||||
# Some systems have frexp only in -lm, not in -lc.
|
||||
AC_SEARCH_LIBS(frexp, m)
|
||||
|
||||
AC_MSG_CHECKING(for time_t in time.h)
|
||||
AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
|
||||
[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
|
||||
bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
|
||||
AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
|
||||
if test $bu_cv_decl_time_t_time_h = yes; then
|
||||
AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
|
||||
[Is the type time_t defined in <time.h>?])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for time_t in sys/types.h)
|
||||
AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
|
||||
[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
|
||||
bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
|
||||
AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
|
||||
if test $bu_cv_decl_time_t_types_h = yes; then
|
||||
AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
|
||||
[Is the type time_t defined in <sys/types.h>?])
|
||||
fi
|
||||
|
||||
# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
|
||||
# by default.
|
||||
AC_MSG_CHECKING([for utime.h])
|
||||
AC_CACHE_VAL(bu_cv_header_utime_h,
|
||||
[AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
#include <utime.h>],
|
||||
[struct utimbuf s;],
|
||||
bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
|
||||
AC_MSG_RESULT($bu_cv_header_utime_h)
|
||||
if test $bu_cv_header_utime_h = yes; then
|
||||
AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
|
||||
fi
|
||||
|
||||
BFD_NEED_DECLARATION(fprintf)
|
||||
BFD_NEED_DECLARATION(strstr)
|
||||
BFD_NEED_DECLARATION(sbrk)
|
||||
BFD_NEED_DECLARATION(getenv)
|
||||
BFD_NEED_DECLARATION(environ)
|
||||
|
||||
BFD_BINARY_FOPEN
|
||||
|
||||
# target-specific stuff:
|
||||
|
||||
# Canonicalize the secondary target names.
|
||||
if test -n "$enable_targets"; then
|
||||
for targ in `echo $enable_targets | sed 's/,/ /g'`
|
||||
do
|
||||
result=`$ac_config_sub $targ 2>/dev/null`
|
||||
if test -n "$result"; then
|
||||
canon_targets="$canon_targets $result"
|
||||
else
|
||||
# Allow targets that config.sub doesn't recognize, like "all".
|
||||
canon_targets="$canon_targets $targ"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
all_targets=false
|
||||
BUILD_NLMCONV=
|
||||
NLMCONV_DEFS=
|
||||
BUILD_SRCONV=
|
||||
BUILD_DLLTOOL=
|
||||
DLLTOOL_DEFS=
|
||||
BUILD_WINDRES=
|
||||
BUILD_DLLWRAP=
|
||||
BUILD_MISC=
|
||||
OBJDUMP_DEFS=
|
||||
|
||||
for targ in $target $canon_targets
|
||||
do
|
||||
if test "x$targ" = "xall"; then
|
||||
all_targets=true
|
||||
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
|
||||
BUILD_SRCONV='$(SRCONV_PROG)'
|
||||
NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
|
||||
else
|
||||
case $targ in
|
||||
changequote(,)dnl
|
||||
i[3456]86*-*-netware*)
|
||||
changequote([,])dnl
|
||||
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
|
||||
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
|
||||
;;
|
||||
alpha*-*-netware*)
|
||||
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
|
||||
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
|
||||
;;
|
||||
powerpc*-*-netware*)
|
||||
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
|
||||
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
|
||||
;;
|
||||
sparc*-*-netware*)
|
||||
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
|
||||
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
|
||||
;;
|
||||
esac
|
||||
case $targ in
|
||||
*-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
|
||||
esac
|
||||
case $targ in
|
||||
arm-epoc-pe*)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
;;
|
||||
arm-*pe* | arm-*-wince)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
;;
|
||||
thumb-*pe*)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
;;
|
||||
arm*-* | xscale-* | strongarm-* | d10v-*)
|
||||
OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS"
|
||||
;;
|
||||
changequote(,)dnl
|
||||
i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
|
||||
changequote([,])dnl
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
|
||||
;;
|
||||
i[3-6]86-*-interix)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
|
||||
;;
|
||||
powerpc*-*-*pe* | powerpc*-*-cygwin*)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
;;
|
||||
sh*-*-*pe)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
;;
|
||||
mips*-*-*pe)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
;;
|
||||
mcore-*pe)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
;;
|
||||
mcore-*elf)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
|
||||
AC_SUBST(NLMCONV_DEFS)
|
||||
AC_SUBST(BUILD_NLMCONV)
|
||||
AC_SUBST(BUILD_SRCONV)
|
||||
AC_SUBST(BUILD_DLLTOOL)
|
||||
AC_SUBST(DLLTOOL_DEFS)
|
||||
AC_SUBST(BUILD_WINDRES)
|
||||
AC_SUBST(BUILD_DLLWRAP)
|
||||
AC_SUBST(BUILD_MISC)
|
||||
AC_SUBST(OBJDUMP_DEFS)
|
||||
|
||||
AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
|
||||
|
||||
targ=$target
|
||||
. $srcdir/../bfd/config.bfd
|
||||
if test "x$targ_underscore" = "xyes"; then
|
||||
UNDERSCORE=1
|
||||
else
|
||||
UNDERSCORE=0
|
||||
fi
|
||||
AC_SUBST(UNDERSCORE)
|
||||
|
||||
AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in,
|
||||
[
|
||||
case "x$CONFIG_FILES" in
|
||||
*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
|
||||
esac
|
||||
])
|
||||
3567
binutils/debug.c
3567
binutils/debug.c
File diff suppressed because it is too large
Load Diff
798
binutils/debug.h
798
binutils/debug.h
@@ -1,798 +0,0 @@
|
||||
/* debug.h -- Describe generic debugging information.
|
||||
Copyright 1995, 1996 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor <ian@cygnus.com>.
|
||||
|
||||
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 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. */
|
||||
|
||||
#ifndef DEBUG_H
|
||||
#define DEBUG_H
|
||||
|
||||
/* This header file describes a generic debugging information format.
|
||||
We may eventually have readers which convert different formats into
|
||||
this generic format, and writers which write it out. The initial
|
||||
impetus for this was writing a convertor from stabs to HP IEEE-695
|
||||
debugging format. */
|
||||
|
||||
/* Different kinds of types. */
|
||||
|
||||
enum debug_type_kind
|
||||
{
|
||||
/* Not used. */
|
||||
DEBUG_KIND_ILLEGAL,
|
||||
/* Indirect via a pointer. */
|
||||
DEBUG_KIND_INDIRECT,
|
||||
/* Void. */
|
||||
DEBUG_KIND_VOID,
|
||||
/* Integer. */
|
||||
DEBUG_KIND_INT,
|
||||
/* Floating point. */
|
||||
DEBUG_KIND_FLOAT,
|
||||
/* Complex. */
|
||||
DEBUG_KIND_COMPLEX,
|
||||
/* Boolean. */
|
||||
DEBUG_KIND_BOOL,
|
||||
/* Struct. */
|
||||
DEBUG_KIND_STRUCT,
|
||||
/* Union. */
|
||||
DEBUG_KIND_UNION,
|
||||
/* Class. */
|
||||
DEBUG_KIND_CLASS,
|
||||
/* Union class (can this really happen?). */
|
||||
DEBUG_KIND_UNION_CLASS,
|
||||
/* Enumeration type. */
|
||||
DEBUG_KIND_ENUM,
|
||||
/* Pointer. */
|
||||
DEBUG_KIND_POINTER,
|
||||
/* Function. */
|
||||
DEBUG_KIND_FUNCTION,
|
||||
/* Reference. */
|
||||
DEBUG_KIND_REFERENCE,
|
||||
/* Range. */
|
||||
DEBUG_KIND_RANGE,
|
||||
/* Array. */
|
||||
DEBUG_KIND_ARRAY,
|
||||
/* Set. */
|
||||
DEBUG_KIND_SET,
|
||||
/* Based pointer. */
|
||||
DEBUG_KIND_OFFSET,
|
||||
/* Method. */
|
||||
DEBUG_KIND_METHOD,
|
||||
/* Const qualified type. */
|
||||
DEBUG_KIND_CONST,
|
||||
/* Volatile qualified type. */
|
||||
DEBUG_KIND_VOLATILE,
|
||||
/* Named type. */
|
||||
DEBUG_KIND_NAMED,
|
||||
/* Tagged type. */
|
||||
DEBUG_KIND_TAGGED
|
||||
};
|
||||
|
||||
/* Different kinds of variables. */
|
||||
|
||||
enum debug_var_kind
|
||||
{
|
||||
/* Not used. */
|
||||
DEBUG_VAR_ILLEGAL,
|
||||
/* A global variable. */
|
||||
DEBUG_GLOBAL,
|
||||
/* A static variable. */
|
||||
DEBUG_STATIC,
|
||||
/* A local static variable. */
|
||||
DEBUG_LOCAL_STATIC,
|
||||
/* A local variable. */
|
||||
DEBUG_LOCAL,
|
||||
/* A register variable. */
|
||||
DEBUG_REGISTER
|
||||
};
|
||||
|
||||
/* Different kinds of function parameters. */
|
||||
|
||||
enum debug_parm_kind
|
||||
{
|
||||
/* Not used. */
|
||||
DEBUG_PARM_ILLEGAL,
|
||||
/* A stack based parameter. */
|
||||
DEBUG_PARM_STACK,
|
||||
/* A register parameter. */
|
||||
DEBUG_PARM_REG,
|
||||
/* A stack based reference parameter. */
|
||||
DEBUG_PARM_REFERENCE,
|
||||
/* A register reference parameter. */
|
||||
DEBUG_PARM_REF_REG
|
||||
};
|
||||
|
||||
/* Different kinds of visibility. */
|
||||
|
||||
enum debug_visibility
|
||||
{
|
||||
/* A public field (e.g., a field in a C struct). */
|
||||
DEBUG_VISIBILITY_PUBLIC,
|
||||
/* A protected field. */
|
||||
DEBUG_VISIBILITY_PROTECTED,
|
||||
/* A private field. */
|
||||
DEBUG_VISIBILITY_PRIVATE,
|
||||
/* A field which should be ignored. */
|
||||
DEBUG_VISIBILITY_IGNORE
|
||||
};
|
||||
|
||||
/* A type. */
|
||||
|
||||
typedef struct debug_type *debug_type;
|
||||
|
||||
#define DEBUG_TYPE_NULL ((debug_type) NULL)
|
||||
|
||||
/* A field in a struct or union. */
|
||||
|
||||
typedef struct debug_field *debug_field;
|
||||
|
||||
#define DEBUG_FIELD_NULL ((debug_field) NULL)
|
||||
|
||||
/* A base class for an object. */
|
||||
|
||||
typedef struct debug_baseclass *debug_baseclass;
|
||||
|
||||
#define DEBUG_BASECLASS_NULL ((debug_baseclass) NULL)
|
||||
|
||||
/* A method of an object. */
|
||||
|
||||
typedef struct debug_method *debug_method;
|
||||
|
||||
#define DEBUG_METHOD_NULL ((debug_method) NULL)
|
||||
|
||||
/* The arguments to a method function of an object. These indicate
|
||||
which method to run. */
|
||||
|
||||
typedef struct debug_method_variant *debug_method_variant;
|
||||
|
||||
#define DEBUG_METHOD_VARIANT_NULL ((debug_method_variant) NULL)
|
||||
|
||||
/* This structure is passed to debug_write. It holds function
|
||||
pointers that debug_write will call based on the accumulated
|
||||
debugging information. */
|
||||
|
||||
struct debug_write_fns
|
||||
{
|
||||
/* This is called at the start of each new compilation unit with the
|
||||
name of the main file in the new unit. */
|
||||
boolean (*start_compilation_unit) PARAMS ((PTR, const char *));
|
||||
|
||||
/* This is called at the start of each source file within a
|
||||
compilation unit, before outputting any global information for
|
||||
that file. The argument is the name of the file. */
|
||||
boolean (*start_source) PARAMS ((PTR, const char *));
|
||||
|
||||
/* Each writer must keep a stack of types. */
|
||||
|
||||
/* Push an empty type onto the type stack. This type can appear if
|
||||
there is a reference to a type which is never defined. */
|
||||
boolean (*empty_type) PARAMS ((PTR));
|
||||
|
||||
/* Push a void type onto the type stack. */
|
||||
boolean (*void_type) PARAMS ((PTR));
|
||||
|
||||
/* Push an integer type onto the type stack, given the size and
|
||||
whether it is unsigned. */
|
||||
boolean (*int_type) PARAMS ((PTR, unsigned int, boolean));
|
||||
|
||||
/* Push a floating type onto the type stack, given the size. */
|
||||
boolean (*float_type) PARAMS ((PTR, unsigned int));
|
||||
|
||||
/* Push a complex type onto the type stack, given the size. */
|
||||
boolean (*complex_type) PARAMS ((PTR, unsigned int));
|
||||
|
||||
/* Push a boolean type onto the type stack, given the size. */
|
||||
boolean (*bool_type) PARAMS ((PTR, unsigned int));
|
||||
|
||||
/* Push an enum type onto the type stack, given the tag, a NULL
|
||||
terminated array of names and the associated values. If there is
|
||||
no tag, the tag argument will be NULL. If this is an undefined
|
||||
enum, the names and values arguments will be NULL. */
|
||||
boolean (*enum_type) PARAMS ((PTR, const char *, const char **,
|
||||
bfd_signed_vma *));
|
||||
|
||||
/* Pop the top type on the type stack, and push a pointer to that
|
||||
type onto the type stack. */
|
||||
boolean (*pointer_type) PARAMS ((PTR));
|
||||
|
||||
/* Push a function type onto the type stack. The second argument
|
||||
indicates the number of argument types that have been pushed onto
|
||||
the stack. If the number of argument types is passed as -1, then
|
||||
the argument types of the function are unknown, and no types have
|
||||
been pushed onto the stack. The third argument is true if the
|
||||
function takes a variable number of arguments. The return type
|
||||
of the function is pushed onto the type stack below the argument
|
||||
types, if any. */
|
||||
boolean (*function_type) PARAMS ((PTR, int, boolean));
|
||||
|
||||
/* Pop the top type on the type stack, and push a reference to that
|
||||
type onto the type stack. */
|
||||
boolean (*reference_type) PARAMS ((PTR));
|
||||
|
||||
/* Pop the top type on the type stack, and push a range of that type
|
||||
with the given lower and upper bounds onto the type stack. */
|
||||
boolean (*range_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma));
|
||||
|
||||
/* Push an array type onto the type stack. The top type on the type
|
||||
stack is the range, and the next type on the type stack is the
|
||||
element type. These should be popped before the array type is
|
||||
pushed. The arguments are the lower bound, the upper bound, and
|
||||
whether the array is a string. */
|
||||
boolean (*array_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma,
|
||||
boolean));
|
||||
|
||||
/* Pop the top type on the type stack, and push a set of that type
|
||||
onto the type stack. The argument indicates whether this set is
|
||||
a bitstring. */
|
||||
boolean (*set_type) PARAMS ((PTR, boolean));
|
||||
|
||||
/* Push an offset type onto the type stack. The top type on the
|
||||
type stack is the target type, and the next type on the type
|
||||
stack is the base type. These should be popped before the offset
|
||||
type is pushed. */
|
||||
boolean (*offset_type) PARAMS ((PTR));
|
||||
|
||||
/* Push a method type onto the type stack. If the second argument
|
||||
is true, the top type on the stack is the class to which the
|
||||
method belongs; otherwise, the class must be determined by the
|
||||
class to which the method is attached. The third argument is the
|
||||
number of argument types; these are pushed onto the type stack in
|
||||
reverse order (the first type popped is the last argument to the
|
||||
method). A value of -1 for the third argument means that no
|
||||
argument information is available. The fourth argument is true
|
||||
if the function takes a variable number of arguments. The next
|
||||
type on the type stack below the domain and the argument types is
|
||||
the return type of the method. All these types must be popped,
|
||||
and then the method type must be pushed. */
|
||||
boolean (*method_type) PARAMS ((PTR, boolean, int, boolean));
|
||||
|
||||
/* Pop the top type off the type stack, and push a const qualified
|
||||
version of that type onto the type stack. */
|
||||
boolean (*const_type) PARAMS ((PTR));
|
||||
|
||||
/* Pop the top type off the type stack, and push a volatile
|
||||
qualified version of that type onto the type stack. */
|
||||
boolean (*volatile_type) PARAMS ((PTR));
|
||||
|
||||
/* Start building a struct. This is followed by calls to the
|
||||
struct_field function, and finished by a call to the
|
||||
end_struct_type function. The second argument is the tag; this
|
||||
will be NULL if there isn't one. If the second argument is NULL,
|
||||
the third argument is a constant identifying this struct for use
|
||||
with tag_type. The fourth argument is true for a struct, false
|
||||
for a union. The fifth argument is the size. If this is an
|
||||
undefined struct or union, the size will be 0 and struct_field
|
||||
will not be called before end_struct_type is called. */
|
||||
boolean (*start_struct_type) PARAMS ((PTR, const char *, unsigned int,
|
||||
boolean, unsigned int));
|
||||
|
||||
/* Add a field to the struct type currently being built. The type
|
||||
of the field should be popped off the type stack. The arguments
|
||||
are the name, the bit position, the bit size (may be zero if the
|
||||
field is not packed), and the visibility. */
|
||||
boolean (*struct_field) PARAMS ((PTR, const char *, bfd_vma, bfd_vma,
|
||||
enum debug_visibility));
|
||||
|
||||
/* Finish building a struct, and push it onto the type stack. */
|
||||
boolean (*end_struct_type) PARAMS ((PTR));
|
||||
|
||||
/* Start building a class. This is followed by calls to several
|
||||
functions: struct_field, class_static_member, class_baseclass,
|
||||
class_start_method, class_method_variant,
|
||||
class_static_method_variant, and class_end_method. The class is
|
||||
finished by a call to end_class_type. The first five arguments
|
||||
are the same as for start_struct_type. The sixth argument is
|
||||
true if there is a virtual function table; if there is, the
|
||||
seventh argument is true if the virtual function table can be
|
||||
found in the type itself, and is false if the type of the object
|
||||
holding the virtual function table should be popped from the type
|
||||
stack. */
|
||||
boolean (*start_class_type) PARAMS ((PTR, const char *, unsigned int,
|
||||
boolean, unsigned int, boolean,
|
||||
boolean));
|
||||
|
||||
/* Add a static member to the class currently being built. The
|
||||
arguments are the field name, the physical name, and the
|
||||
visibility. The type must be popped off the type stack. */
|
||||
boolean (*class_static_member) PARAMS ((PTR, const char *, const char *,
|
||||
enum debug_visibility));
|
||||
|
||||
/* Add a baseclass to the class currently being built. The type of
|
||||
the baseclass must be popped off the type stack. The arguments
|
||||
are the bit position, whether the class is virtual, and the
|
||||
visibility. */
|
||||
boolean (*class_baseclass) PARAMS ((PTR, bfd_vma, boolean,
|
||||
enum debug_visibility));
|
||||
|
||||
/* Start adding a method to the class currently being built. This
|
||||
is followed by calls to class_method_variant and
|
||||
class_static_method_variant to describe different variants of the
|
||||
method which take different arguments. The method is finished
|
||||
with a call to class_end_method. The argument is the method
|
||||
name. */
|
||||
boolean (*class_start_method) PARAMS ((PTR, const char *));
|
||||
|
||||
/* Describe a variant to the class method currently being built.
|
||||
The type of the variant must be popped off the type stack. The
|
||||
second argument is the physical name of the function. The
|
||||
following arguments are the visibility, whether the variant is
|
||||
const, whether the variant is volatile, the offset in the virtual
|
||||
function table, and whether the context is on the type stack
|
||||
(below the variant type). */
|
||||
boolean (*class_method_variant) PARAMS ((PTR, const char *,
|
||||
enum debug_visibility,
|
||||
boolean, boolean,
|
||||
bfd_vma, boolean));
|
||||
|
||||
/* Describe a static variant to the class method currently being
|
||||
built. The arguments are the same as for class_method_variant,
|
||||
except that the last two arguments are omitted. The type of the
|
||||
variant must be popped off the type stack. */
|
||||
boolean (*class_static_method_variant) PARAMS ((PTR, const char *,
|
||||
enum debug_visibility,
|
||||
boolean, boolean));
|
||||
|
||||
/* Finish describing a class method. */
|
||||
boolean (*class_end_method) PARAMS ((PTR));
|
||||
|
||||
/* Finish describing a class, and push it onto the type stack. */
|
||||
boolean (*end_class_type) PARAMS ((PTR));
|
||||
|
||||
/* Push a type on the stack which was given a name by an earlier
|
||||
call to typdef. */
|
||||
boolean (*typedef_type) PARAMS ((PTR, const char *));
|
||||
|
||||
/* Push a tagged type on the stack which was defined earlier. If
|
||||
the second argument is not NULL, the type was defined by a call
|
||||
to tag. If the second argument is NULL, the type was defined by
|
||||
a call to start_struct_type or start_class_type with a tag of
|
||||
NULL and the number of the third argument. Either way, the
|
||||
fourth argument is the tag kind. Note that this may be called
|
||||
for a struct (class) being defined, in between the call to
|
||||
start_struct_type (start_class_type) and the call to
|
||||
end_struct_type (end_class_type). */
|
||||
boolean (*tag_type) PARAMS ((PTR, const char *, unsigned int,
|
||||
enum debug_type_kind));
|
||||
|
||||
/* Pop the type stack, and typedef it to the given name. */
|
||||
boolean (*typdef) PARAMS ((PTR, const char *));
|
||||
|
||||
/* Pop the type stack, and declare it as a tagged struct or union or
|
||||
enum or whatever. The tag passed down here is redundant, since
|
||||
was also passed when enum_type, start_struct_type, or
|
||||
start_class_type was called. */
|
||||
boolean (*tag) PARAMS ((PTR, const char *));
|
||||
|
||||
/* This is called to record a named integer constant. */
|
||||
boolean (*int_constant) PARAMS ((PTR, const char *, bfd_vma));
|
||||
|
||||
/* This is called to record a named floating point constant. */
|
||||
boolean (*float_constant) PARAMS ((PTR, const char *, double));
|
||||
|
||||
/* This is called to record a typed integer constant. The type is
|
||||
popped off the type stack. */
|
||||
boolean (*typed_constant) PARAMS ((PTR, const char *, bfd_vma));
|
||||
|
||||
/* This is called to record a variable. The type is popped off the
|
||||
type stack. */
|
||||
boolean (*variable) PARAMS ((PTR, const char *, enum debug_var_kind,
|
||||
bfd_vma));
|
||||
|
||||
/* Start writing out a function. The return type must be popped off
|
||||
the stack. The boolean is true if the function is global. This
|
||||
is followed by calls to function_parameter, followed by block
|
||||
information. */
|
||||
boolean (*start_function) PARAMS ((PTR, const char *, boolean));
|
||||
|
||||
/* Record a function parameter for the current function. The type
|
||||
must be popped off the stack. */
|
||||
boolean (*function_parameter) PARAMS ((PTR, const char *,
|
||||
enum debug_parm_kind, bfd_vma));
|
||||
|
||||
/* Start writing out a block. There is at least one top level block
|
||||
per function. Blocks may be nested. The argument is the
|
||||
starting address of the block. */
|
||||
boolean (*start_block) PARAMS ((PTR, bfd_vma));
|
||||
|
||||
/* Finish writing out a block. The argument is the ending address
|
||||
of the block. */
|
||||
boolean (*end_block) PARAMS ((PTR, bfd_vma));
|
||||
|
||||
/* Finish writing out a function. */
|
||||
boolean (*end_function) PARAMS ((PTR));
|
||||
|
||||
/* Record line number information for the current compilation unit. */
|
||||
boolean (*lineno) PARAMS ((PTR, const char *, unsigned long, bfd_vma));
|
||||
};
|
||||
|
||||
/* Exported functions. */
|
||||
|
||||
/* The first argument to most of these functions is a handle. This
|
||||
handle is returned by the debug_init function. The purpose of the
|
||||
handle is to permit the debugging routines to not use static
|
||||
variables, and hence to be reentrant. This would be useful for a
|
||||
program which wanted to handle two executables simultaneously. */
|
||||
|
||||
/* Return a debugging handle. */
|
||||
|
||||
extern PTR debug_init PARAMS ((void));
|
||||
|
||||
/* Set the source filename. This implicitly starts a new compilation
|
||||
unit. */
|
||||
|
||||
extern boolean debug_set_filename PARAMS ((PTR, const char *));
|
||||
|
||||
/* Change source files to the given file name. This is used for
|
||||
include files in a single compilation unit. */
|
||||
|
||||
extern boolean debug_start_source PARAMS ((PTR, const char *));
|
||||
|
||||
/* Record a function definition. This implicitly starts a function
|
||||
block. The debug_type argument is the type of the return value.
|
||||
The boolean indicates whether the function is globally visible.
|
||||
The bfd_vma is the address of the start of the function. Currently
|
||||
the parameter types are specified by calls to
|
||||
debug_record_parameter. */
|
||||
|
||||
extern boolean debug_record_function
|
||||
PARAMS ((PTR, const char *, debug_type, boolean, bfd_vma));
|
||||
|
||||
/* Record a parameter for the current function. */
|
||||
|
||||
extern boolean debug_record_parameter
|
||||
PARAMS ((PTR, const char *, debug_type, enum debug_parm_kind, bfd_vma));
|
||||
|
||||
/* End a function definition. The argument is the address where the
|
||||
function ends. */
|
||||
|
||||
extern boolean debug_end_function PARAMS ((PTR, bfd_vma));
|
||||
|
||||
/* Start a block in a function. All local information will be
|
||||
recorded in this block, until the matching call to debug_end_block.
|
||||
debug_start_block and debug_end_block may be nested. The argument
|
||||
is the address at which this block starts. */
|
||||
|
||||
extern boolean debug_start_block PARAMS ((PTR, bfd_vma));
|
||||
|
||||
/* Finish a block in a function. This matches the call to
|
||||
debug_start_block. The argument is the address at which this block
|
||||
ends. */
|
||||
|
||||
extern boolean debug_end_block PARAMS ((PTR, bfd_vma));
|
||||
|
||||
/* Associate a line number in the current source file with a given
|
||||
address. */
|
||||
|
||||
extern boolean debug_record_line PARAMS ((PTR, unsigned long, bfd_vma));
|
||||
|
||||
/* Start a named common block. This is a block of variables that may
|
||||
move in memory. */
|
||||
|
||||
extern boolean debug_start_common_block PARAMS ((PTR, const char *));
|
||||
|
||||
/* End a named common block. */
|
||||
|
||||
extern boolean debug_end_common_block PARAMS ((PTR, const char *));
|
||||
|
||||
/* Record a named integer constant. */
|
||||
|
||||
extern boolean debug_record_int_const PARAMS ((PTR, const char *, bfd_vma));
|
||||
|
||||
/* Record a named floating point constant. */
|
||||
|
||||
extern boolean debug_record_float_const PARAMS ((PTR, const char *, double));
|
||||
|
||||
/* Record a typed constant with an integral value. */
|
||||
|
||||
extern boolean debug_record_typed_const
|
||||
PARAMS ((PTR, const char *, debug_type, bfd_vma));
|
||||
|
||||
/* Record a label. */
|
||||
|
||||
extern boolean debug_record_label
|
||||
PARAMS ((PTR, const char *, debug_type, bfd_vma));
|
||||
|
||||
/* Record a variable. */
|
||||
|
||||
extern boolean debug_record_variable
|
||||
PARAMS ((PTR, const char *, debug_type, enum debug_var_kind, bfd_vma));
|
||||
|
||||
/* Make an indirect type. The first argument is a pointer to the
|
||||
location where the real type will be placed. The second argument
|
||||
is the type tag, if there is one; this may be NULL; the only
|
||||
purpose of this argument is so that debug_get_type_name can return
|
||||
something useful. This function may be used when a type is
|
||||
referenced before it is defined. */
|
||||
|
||||
extern debug_type debug_make_indirect_type
|
||||
PARAMS ((PTR, debug_type *, const char *));
|
||||
|
||||
/* Make a void type. */
|
||||
|
||||
extern debug_type debug_make_void_type PARAMS ((PTR));
|
||||
|
||||
/* Make an integer type of a given size. The boolean argument is true
|
||||
if the integer is unsigned. */
|
||||
|
||||
extern debug_type debug_make_int_type PARAMS ((PTR, unsigned int, boolean));
|
||||
|
||||
/* Make a floating point type of a given size. FIXME: On some
|
||||
platforms, like an Alpha, you probably need to be able to specify
|
||||
the format. */
|
||||
|
||||
extern debug_type debug_make_float_type PARAMS ((PTR, unsigned int));
|
||||
|
||||
/* Make a boolean type of a given size. */
|
||||
|
||||
extern debug_type debug_make_bool_type PARAMS ((PTR, unsigned int));
|
||||
|
||||
/* Make a complex type of a given size. */
|
||||
|
||||
extern debug_type debug_make_complex_type PARAMS ((PTR, unsigned int));
|
||||
|
||||
/* Make a structure type. The second argument is true for a struct,
|
||||
false for a union. The third argument is the size of the struct.
|
||||
The fourth argument is a NULL terminated array of fields. */
|
||||
|
||||
extern debug_type debug_make_struct_type
|
||||
PARAMS ((PTR, boolean, bfd_vma, debug_field *));
|
||||
|
||||
/* Make an object type. The first three arguments after the handle
|
||||
are the same as for debug_make_struct_type. The next arguments are
|
||||
a NULL terminated array of base classes, a NULL terminated array of
|
||||
methods, the type of the object holding the virtual function table
|
||||
if it is not this object, and a boolean which is true if this
|
||||
object has its own virtual function table. */
|
||||
|
||||
extern debug_type debug_make_object_type
|
||||
PARAMS ((PTR, boolean, bfd_vma, debug_field *, debug_baseclass *,
|
||||
debug_method *, debug_type, boolean));
|
||||
|
||||
/* Make an enumeration type. The arguments are a null terminated
|
||||
array of strings, and an array of corresponding values. */
|
||||
|
||||
extern debug_type debug_make_enum_type
|
||||
PARAMS ((PTR, const char **, bfd_signed_vma *));
|
||||
|
||||
/* Make a pointer to a given type. */
|
||||
|
||||
extern debug_type debug_make_pointer_type
|
||||
PARAMS ((PTR, debug_type));
|
||||
|
||||
/* Make a function type. The second argument is the return type. The
|
||||
third argument is a NULL terminated array of argument types. The
|
||||
fourth argument is true if the function takes a variable number of
|
||||
arguments. If the third argument is NULL, then the argument types
|
||||
are unknown. */
|
||||
|
||||
extern debug_type debug_make_function_type
|
||||
PARAMS ((PTR, debug_type, debug_type *, boolean));
|
||||
|
||||
/* Make a reference to a given type. */
|
||||
|
||||
extern debug_type debug_make_reference_type PARAMS ((PTR, debug_type));
|
||||
|
||||
/* Make a range of a given type from a lower to an upper bound. */
|
||||
|
||||
extern debug_type debug_make_range_type
|
||||
PARAMS ((PTR, debug_type, bfd_signed_vma, bfd_signed_vma));
|
||||
|
||||
/* Make an array type. The second argument is the type of an element
|
||||
of the array. The third argument is the type of a range of the
|
||||
array. The fourth and fifth argument are the lower and upper
|
||||
bounds, respectively (if the bounds are not known, lower should be
|
||||
0 and upper should be -1). The sixth argument is true if this
|
||||
array is actually a string, as in C. */
|
||||
|
||||
extern debug_type debug_make_array_type
|
||||
PARAMS ((PTR, debug_type, debug_type, bfd_signed_vma, bfd_signed_vma,
|
||||
boolean));
|
||||
|
||||
/* Make a set of a given type. For example, a Pascal set type. The
|
||||
boolean argument is true if this set is actually a bitstring, as in
|
||||
CHILL. */
|
||||
|
||||
extern debug_type debug_make_set_type PARAMS ((PTR, debug_type, boolean));
|
||||
|
||||
/* Make a type for a pointer which is relative to an object. The
|
||||
second argument is the type of the object to which the pointer is
|
||||
relative. The third argument is the type that the pointer points
|
||||
to. */
|
||||
|
||||
extern debug_type debug_make_offset_type
|
||||
PARAMS ((PTR, debug_type, debug_type));
|
||||
|
||||
/* Make a type for a method function. The second argument is the
|
||||
return type. The third argument is the domain. The fourth
|
||||
argument is a NULL terminated array of argument types. The fifth
|
||||
argument is true if the function takes a variable number of
|
||||
arguments, in which case the array of argument types indicates the
|
||||
types of the first arguments. The domain and the argument array
|
||||
may be NULL, in which case this is a stub method and that
|
||||
information is not available. Stabs debugging uses this, and gets
|
||||
the argument types from the mangled name. */
|
||||
|
||||
extern debug_type debug_make_method_type
|
||||
PARAMS ((PTR, debug_type, debug_type, debug_type *, boolean));
|
||||
|
||||
/* Make a const qualified version of a given type. */
|
||||
|
||||
extern debug_type debug_make_const_type PARAMS ((PTR, debug_type));
|
||||
|
||||
/* Make a volatile qualified version of a given type. */
|
||||
|
||||
extern debug_type debug_make_volatile_type PARAMS ((PTR, debug_type));
|
||||
|
||||
/* Make an undefined tagged type. For example, a struct which has
|
||||
been mentioned, but not defined. */
|
||||
|
||||
extern debug_type debug_make_undefined_tagged_type
|
||||
PARAMS ((PTR, const char *, enum debug_type_kind));
|
||||
|
||||
/* Make a base class for an object. The second argument is the base
|
||||
class type. The third argument is the bit position of this base
|
||||
class in the object. The fourth argument is whether this is a
|
||||
virtual class. The fifth argument is the visibility of the base
|
||||
class. */
|
||||
|
||||
extern debug_baseclass debug_make_baseclass
|
||||
PARAMS ((PTR, debug_type, bfd_vma, boolean, enum debug_visibility));
|
||||
|
||||
/* Make a field for a struct. The second argument is the name. The
|
||||
third argument is the type of the field. The fourth argument is
|
||||
the bit position of the field. The fifth argument is the size of
|
||||
the field (it may be zero). The sixth argument is the visibility
|
||||
of the field. */
|
||||
|
||||
extern debug_field debug_make_field
|
||||
PARAMS ((PTR, const char *, debug_type, bfd_vma, bfd_vma,
|
||||
enum debug_visibility));
|
||||
|
||||
/* Make a static member of an object. The second argument is the
|
||||
name. The third argument is the type of the member. The fourth
|
||||
argument is the physical name of the member (i.e., the name as a
|
||||
global variable). The fifth argument is the visibility of the
|
||||
member. */
|
||||
|
||||
extern debug_field debug_make_static_member
|
||||
PARAMS ((PTR, const char *, debug_type, const char *,
|
||||
enum debug_visibility));
|
||||
|
||||
/* Make a method. The second argument is the name, and the third
|
||||
argument is a NULL terminated array of method variants. Each
|
||||
method variant is a method with this name but with different
|
||||
argument types. */
|
||||
|
||||
extern debug_method debug_make_method
|
||||
PARAMS ((PTR, const char *, debug_method_variant *));
|
||||
|
||||
/* Make a method variant. The second argument is the physical name of
|
||||
the function. The third argument is the type of the function,
|
||||
probably constructed by debug_make_method_type. The fourth
|
||||
argument is the visibility. The fifth argument is whether this is
|
||||
a const function. The sixth argument is whether this is a volatile
|
||||
function. The seventh argument is the index in the virtual
|
||||
function table, if any. The eighth argument is the virtual
|
||||
function context. */
|
||||
|
||||
extern debug_method_variant debug_make_method_variant
|
||||
PARAMS ((PTR, const char *, debug_type, enum debug_visibility, boolean,
|
||||
boolean, bfd_vma, debug_type));
|
||||
|
||||
/* Make a static method argument. The arguments are the same as for
|
||||
debug_make_method_variant, except that the last two are omitted
|
||||
since a static method can not also be virtual. */
|
||||
|
||||
extern debug_method_variant debug_make_static_method_variant
|
||||
PARAMS ((PTR, const char *, debug_type, enum debug_visibility, boolean,
|
||||
boolean));
|
||||
|
||||
/* Name a type. This returns a new type with an attached name. */
|
||||
|
||||
extern debug_type debug_name_type PARAMS ((PTR, const char *, debug_type));
|
||||
|
||||
/* Give a tag to a type, such as a struct or union. This returns a
|
||||
new type with an attached tag. */
|
||||
|
||||
extern debug_type debug_tag_type PARAMS ((PTR, const char *, debug_type));
|
||||
|
||||
/* Record the size of a given type. */
|
||||
|
||||
extern boolean debug_record_type_size PARAMS ((PTR, debug_type, unsigned int));
|
||||
|
||||
/* Find a named type. */
|
||||
|
||||
extern debug_type debug_find_named_type PARAMS ((PTR, const char *));
|
||||
|
||||
/* Find a tagged type. */
|
||||
|
||||
extern debug_type debug_find_tagged_type
|
||||
PARAMS ((PTR, const char *, enum debug_type_kind));
|
||||
|
||||
/* Get the kind of a type. */
|
||||
|
||||
extern enum debug_type_kind debug_get_type_kind PARAMS ((PTR, debug_type));
|
||||
|
||||
/* Get the name of a type. */
|
||||
|
||||
extern const char *debug_get_type_name PARAMS ((PTR, debug_type));
|
||||
|
||||
/* Get the size of a type. */
|
||||
|
||||
extern bfd_vma debug_get_type_size PARAMS ((PTR, debug_type));
|
||||
|
||||
/* Get the return type of a function or method type. */
|
||||
|
||||
extern debug_type debug_get_return_type PARAMS ((PTR, debug_type));
|
||||
|
||||
/* Get the NULL terminated array of parameter types for a function or
|
||||
method type (actually, parameter types are not currently stored for
|
||||
function types). This may be used to determine whether a method
|
||||
type is a stub method or not. The last argument points to a
|
||||
boolean which is set to true if the function takes a variable
|
||||
number of arguments. */
|
||||
|
||||
extern const debug_type *debug_get_parameter_types PARAMS ((PTR,
|
||||
debug_type,
|
||||
boolean *));
|
||||
|
||||
/* Get the target type of a pointer or reference or const or volatile
|
||||
type. */
|
||||
|
||||
extern debug_type debug_get_target_type PARAMS ((PTR, debug_type));
|
||||
|
||||
/* Get the NULL terminated array of fields for a struct, union, or
|
||||
class. */
|
||||
|
||||
extern const debug_field *debug_get_fields PARAMS ((PTR, debug_type));
|
||||
|
||||
/* Get the type of a field. */
|
||||
|
||||
extern debug_type debug_get_field_type PARAMS ((PTR, debug_field));
|
||||
|
||||
/* Get the name of a field. */
|
||||
|
||||
extern const char *debug_get_field_name PARAMS ((PTR, debug_field));
|
||||
|
||||
/* Get the bit position of a field within the containing structure.
|
||||
If the field is a static member, this will return (bfd_vma) -1. */
|
||||
|
||||
extern bfd_vma debug_get_field_bitpos PARAMS ((PTR, debug_field));
|
||||
|
||||
/* Get the bit size of a field. If the field is a static member, this
|
||||
will return (bfd_vma) -1. */
|
||||
|
||||
extern bfd_vma debug_get_field_bitsize PARAMS ((PTR, debug_field));
|
||||
|
||||
/* Get the visibility of a field. */
|
||||
|
||||
extern enum debug_visibility debug_get_field_visibility
|
||||
PARAMS ((PTR, debug_field));
|
||||
|
||||
/* Get the physical name of a field, if it is a static member. If the
|
||||
field is not a static member, this will return NULL. */
|
||||
|
||||
extern const char *debug_get_field_physname PARAMS ((PTR, debug_field));
|
||||
|
||||
/* Write out the recorded debugging information. This takes a set of
|
||||
function pointers which are called to do the actual writing. The
|
||||
first PTR is the debugging handle. The second PTR is a handle
|
||||
which is passed to the functions. */
|
||||
|
||||
extern boolean debug_write PARAMS ((PTR, const struct debug_write_fns *, PTR));
|
||||
|
||||
#endif /* DEBUG_H */
|
||||
@@ -1,93 +0,0 @@
|
||||
%{/* deflex.l - Lexer for .def files */
|
||||
|
||||
/* Copyright 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
|
||||
/* Contributed by Steve Chamberlain
|
||||
sac@cygnus.com
|
||||
|
||||
*/
|
||||
#define DONTDECLARE_MALLOC
|
||||
#include "libiberty.h"
|
||||
#include "defparse.h"
|
||||
#include "dlltool.h"
|
||||
|
||||
int linenumber;
|
||||
|
||||
%}
|
||||
%%
|
||||
"NAME" { return NAME;}
|
||||
"LIBRARY" { return LIBRARY;}
|
||||
"DESCRIPTION" { return DESCRIPTION;}
|
||||
"STACKSIZE" { return STACKSIZE;}
|
||||
"HEAPSIZE" { return HEAPSIZE;}
|
||||
"CODE" { return CODE;}
|
||||
"DATA" { return DATA;}
|
||||
"SECTIONS" { return SECTIONS;}
|
||||
"EXPORTS" { return EXPORTS;}
|
||||
"IMPORTS" { return IMPORTS;}
|
||||
"VERSION" { return VERSIONK;}
|
||||
"BASE" { return BASE;}
|
||||
"CONSTANT" { return CONSTANT; }
|
||||
"NONAME" { return NONAME; }
|
||||
"READ" { return READ;}
|
||||
"WRITE" { return WRITE;}
|
||||
"EXECUTE" { return EXECUTE;}
|
||||
"SHARED" { return SHARED;}
|
||||
"NONSHARED" { return NONSHARED;}
|
||||
"SINGLE" { return SINGLE;}
|
||||
"MULTIPLE" { return MULTIPLE;}
|
||||
"INITINSTANCE" { return INITINSTANCE;}
|
||||
"INITGLOBAL" { return INITGLOBAL;}
|
||||
"TERMINSTANCE" { return TERMINSTANCE;}
|
||||
"TERMGLOBAL" { return TERMGLOBAL;}
|
||||
|
||||
[0-9][x0-9A-Fa-f]* { yylval.number = strtol (yytext,0,0);
|
||||
return NUMBER; }
|
||||
|
||||
[A-Za-z$:\-\_?][A-Za-z0-9/$:\-\_@?]* {
|
||||
yylval.id = xstrdup (yytext);
|
||||
return ID;
|
||||
}
|
||||
|
||||
"\""[^\"]*"\"" {
|
||||
yylval.id = xstrdup (yytext+1);
|
||||
yylval.id[yyleng-2] = 0;
|
||||
return ID;
|
||||
}
|
||||
|
||||
"\'"[^\']*"\'" {
|
||||
yylval.id = xstrdup (yytext+1);
|
||||
yylval.id[yyleng-2] = 0;
|
||||
return ID;
|
||||
}
|
||||
"*".* { }
|
||||
";".* { }
|
||||
" " { }
|
||||
"\t" { }
|
||||
"\n" { linenumber ++ ;}
|
||||
"=" { return '=';}
|
||||
"." { return '.';}
|
||||
"@" { return '@';}
|
||||
"," { return ',';}
|
||||
%%
|
||||
#ifndef yywrap
|
||||
/* Needed for lex, though not flex. */
|
||||
int yywrap() { return 1; }
|
||||
#endif
|
||||
@@ -1,175 +0,0 @@
|
||||
%{ /* defparse.y - parser for .def files */
|
||||
|
||||
/* Copyright 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
#include "dlltool.h"
|
||||
%}
|
||||
|
||||
%union {
|
||||
char *id;
|
||||
int number;
|
||||
};
|
||||
|
||||
%token NAME, LIBRARY, DESCRIPTION, STACKSIZE, HEAPSIZE, CODE, DATA
|
||||
%token SECTIONS, EXPORTS, IMPORTS, VERSIONK, BASE, CONSTANT
|
||||
%token READ WRITE EXECUTE SHARED NONSHARED NONAME
|
||||
%token SINGLE MULTIPLE INITINSTANCE INITGLOBAL TERMINSTANCE TERMGLOBAL
|
||||
%token <id> ID
|
||||
%token <number> NUMBER
|
||||
%type <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT opt_DATA
|
||||
%type <number> attr attr_list opt_number
|
||||
%type <id> opt_name opt_equal_name
|
||||
|
||||
%%
|
||||
|
||||
start: start command
|
||||
| command
|
||||
;
|
||||
|
||||
command:
|
||||
NAME opt_name opt_base { def_name ($2, $3); }
|
||||
| LIBRARY opt_name opt_base option_list { def_library ($2, $3); }
|
||||
| EXPORTS explist
|
||||
| DESCRIPTION ID { def_description ($2);}
|
||||
| STACKSIZE NUMBER opt_number { def_stacksize ($2, $3);}
|
||||
| HEAPSIZE NUMBER opt_number { def_heapsize ($2, $3);}
|
||||
| CODE attr_list { def_code ($2);}
|
||||
| DATA attr_list { def_data ($2);}
|
||||
| SECTIONS seclist
|
||||
| IMPORTS implist
|
||||
| VERSIONK NUMBER { def_version ($2,0);}
|
||||
| VERSIONK NUMBER '.' NUMBER { def_version ($2,$4);}
|
||||
;
|
||||
|
||||
|
||||
explist:
|
||||
/* EMPTY */
|
||||
| explist expline
|
||||
;
|
||||
|
||||
expline:
|
||||
ID opt_equal_name opt_ordinal opt_NONAME opt_CONSTANT opt_DATA
|
||||
{ def_exports ($1, $2, $3, $4, $5, $6);}
|
||||
;
|
||||
implist:
|
||||
implist impline
|
||||
| impline
|
||||
;
|
||||
|
||||
impline:
|
||||
ID '=' ID '.' ID '.' ID { def_import ($1,$3,$5,$7, 0); }
|
||||
| ID '=' ID '.' ID '.' NUMBER { def_import ($1,$3,$5, 0,$7); }
|
||||
| ID '=' ID '.' ID { def_import ($1,$3, 0,$5, 0); }
|
||||
| ID '=' ID '.' NUMBER { def_import ($1,$3, 0, 0,$5); }
|
||||
| ID '.' ID '.' ID { def_import ( 0,$1,$3,$5, 0); }
|
||||
| ID '.' ID '.' NUMBER { def_import ( 0,$1,$3, 0,$5); }
|
||||
| ID '.' ID { def_import ( 0,$1, 0,$3, 0); }
|
||||
| ID '.' NUMBER { def_import ( 0,$1, 0, 0,$3); }
|
||||
;
|
||||
|
||||
seclist:
|
||||
seclist secline
|
||||
| secline
|
||||
;
|
||||
|
||||
secline:
|
||||
ID attr_list { def_section ($1,$2);}
|
||||
;
|
||||
|
||||
attr_list:
|
||||
attr_list opt_comma attr
|
||||
| attr
|
||||
;
|
||||
|
||||
opt_comma:
|
||||
','
|
||||
|
|
||||
;
|
||||
opt_number: ',' NUMBER { $$=$2;}
|
||||
| { $$=-1;}
|
||||
;
|
||||
|
||||
attr:
|
||||
READ { $$ = 1; }
|
||||
| WRITE { $$ = 2; }
|
||||
| EXECUTE { $$ = 4; }
|
||||
| SHARED { $$ = 8; }
|
||||
| NONSHARED { $$ = 0; }
|
||||
| SINGLE { $$ = 0; }
|
||||
| MULTIPLE { $$ = 0; }
|
||||
;
|
||||
|
||||
opt_CONSTANT:
|
||||
CONSTANT {$$=1;}
|
||||
| {$$=0;}
|
||||
;
|
||||
|
||||
opt_NONAME:
|
||||
NONAME {$$=1;}
|
||||
| {$$=0;}
|
||||
;
|
||||
|
||||
opt_DATA:
|
||||
DATA { $$ = 1; }
|
||||
| { $$ = 0; }
|
||||
;
|
||||
|
||||
opt_name: ID { $$ =$1; }
|
||||
| ID '.' ID
|
||||
{
|
||||
char *name = xmalloc (strlen ($1) + 1 + strlen ($3) + 1);
|
||||
sprintf (name, "%s.%s", $1, $3);
|
||||
$$ = name;
|
||||
}
|
||||
| { $$=""; }
|
||||
;
|
||||
|
||||
opt_ordinal:
|
||||
'@' NUMBER { $$=$2;}
|
||||
| { $$=-1;}
|
||||
;
|
||||
|
||||
opt_equal_name:
|
||||
'=' ID { $$ = $2; }
|
||||
| '=' ID '.' ID
|
||||
{
|
||||
char *name = xmalloc (strlen ($2) + 1 + strlen ($4) + 1);
|
||||
sprintf (name, "%s.%s", $2, $4);
|
||||
$$ = name;
|
||||
}
|
||||
| { $$ = 0; }
|
||||
;
|
||||
|
||||
opt_base: BASE '=' NUMBER { $$= $3;}
|
||||
| { $$=-1;}
|
||||
;
|
||||
|
||||
option_list:
|
||||
/* empty */
|
||||
| option_list opt_comma option
|
||||
;
|
||||
|
||||
option:
|
||||
INITINSTANCE
|
||||
| INITGLOBAL
|
||||
| TERMINSTANCE
|
||||
| TERMGLOBAL
|
||||
;
|
||||
@@ -1,17 +0,0 @@
|
||||
:loop
|
||||
/\\$/N
|
||||
/\\$/b loop
|
||||
|
||||
s!@INCDIR@!$(INCDIR)!g
|
||||
s!@BFDDIR@!$(BFDDIR)!g
|
||||
s!@SRCDIR@/!!g
|
||||
s!@OBJDIR@/!!g
|
||||
|
||||
s/\\\n */ /g
|
||||
|
||||
s/ *$//
|
||||
s/ */ /g
|
||||
/:$/d
|
||||
|
||||
s/\(.\{50\}[^ ]*\) /\1 \\\
|
||||
/g
|
||||
3650
binutils/dlltool.c
3650
binutils/dlltool.c
File diff suppressed because it is too large
Load Diff
@@ -1,42 +0,0 @@
|
||||
/* dlltool.h -- header file for dlltool
|
||||
Copyright 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
#include "ansidecl.h"
|
||||
#include <stdio.h>
|
||||
|
||||
extern void def_code PARAMS ((int));
|
||||
extern void def_data PARAMS ((int));
|
||||
extern void def_description PARAMS ((const char *));
|
||||
extern void def_exports
|
||||
PARAMS ((const char *, const char *, int, int, int, int));
|
||||
extern void def_heapsize PARAMS ((int, int));
|
||||
extern void def_import
|
||||
PARAMS ((const char *, const char *, const char *, const char *, int));
|
||||
extern void def_library PARAMS ((const char *, int));
|
||||
extern void def_name PARAMS ((const char *, int));
|
||||
extern void def_section PARAMS ((const char *, int));
|
||||
extern void def_stacksize PARAMS ((int, int));
|
||||
extern void def_version PARAMS ((int, int));
|
||||
extern int yyparse PARAMS ((void));
|
||||
extern int yyerror PARAMS ((const char *));
|
||||
extern int yydebug;
|
||||
extern int yylex PARAMS ((void));
|
||||
extern FILE *yyin;
|
||||
extern int linenumber;
|
||||
1249
binutils/dllwrap.c
1249
binutils/dllwrap.c
File diff suppressed because it is too large
Load Diff
@@ -1,155 +0,0 @@
|
||||
## Process this file with automake to generate Makefile.in
|
||||
|
||||
AUTOMAKE_OPTIONS = cygnus
|
||||
|
||||
# What version of the manual you want; "all" includes everything
|
||||
CONFIG=all
|
||||
|
||||
# Options to extract the man page from as.texinfo
|
||||
MANCONF = -Dman
|
||||
|
||||
TEXI2POD = perl $(top_srcdir)/../etc/texi2pod.pl
|
||||
|
||||
POD2MAN = pod2man --center="GNU" --release="binutils-$(VERSION)" --section=1
|
||||
|
||||
# List of man pages generated from binutils.texi
|
||||
man_MANS = \
|
||||
addr2line.1 \
|
||||
ar.1 \
|
||||
dlltool.1 \
|
||||
nlmconv.1 \
|
||||
nm.1 \
|
||||
objcopy.1 \
|
||||
objdump.1 \
|
||||
ranlib.1 \
|
||||
readelf.1 \
|
||||
size.1 \
|
||||
strings.1 \
|
||||
strip.1 \
|
||||
windres.1 \
|
||||
$(DEMANGLER_NAME).1
|
||||
|
||||
info_TEXINFOS = binutils.texi
|
||||
|
||||
config.texi: Makefile
|
||||
rm -f config.texi
|
||||
echo '@set VERSION $(VERSION)' > config.texi
|
||||
|
||||
binutils_TEXI = $(srcdir)/binutils.texi
|
||||
|
||||
binutils.dvi: $(binutils_TEXI) config.texi
|
||||
|
||||
binutils.info: $(binutils_TEXI) config.texi
|
||||
|
||||
# Man page generation from texinfo
|
||||
addr2line.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Daddr2line < $< > addr2line.pod
|
||||
-($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f addr2line.pod
|
||||
|
||||
ar.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dar < $< > ar.pod
|
||||
-($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f ar.pod
|
||||
|
||||
dlltool.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Ddlltool < $< > dlltool.pod
|
||||
-($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f dlltool.pod
|
||||
|
||||
nlmconv.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dnlmconv < $< > nlmconv.pod
|
||||
-($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f nlmconv.pod
|
||||
|
||||
nm.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dnm < $< > nm.pod
|
||||
-($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f nm.pod
|
||||
|
||||
objcopy.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dobjcopy < $< > objcopy.pod
|
||||
-($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f objcopy.pod
|
||||
|
||||
objdump.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dobjdump < $< > objdump.pod
|
||||
-($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f objdump.pod
|
||||
|
||||
ranlib.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dranlib < $< > ranlib.pod
|
||||
-($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f ranlib.pod
|
||||
|
||||
readelf.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dreadelf < $< > readelf.pod
|
||||
-($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f readelf.pod
|
||||
|
||||
size.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dsize < $< > size.pod
|
||||
-($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f size.pod
|
||||
|
||||
strings.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dstrings < $< > strings.pod
|
||||
-($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f strings.pod
|
||||
|
||||
strip.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dstrip < $< > strip.pod
|
||||
-($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f strip.pod
|
||||
|
||||
windres.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dwindres < $< > windres.pod
|
||||
-($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f windres.pod
|
||||
|
||||
cxxfilt.man: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dcxxfilt < $< > $(DEMANGLER_NAME).pod
|
||||
-($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f $(DEMANGLER_NAME).pod
|
||||
|
||||
MAINTAINERCLEANFILES = config.texi
|
||||
DISTCLEANFILES = config.texi
|
||||
MOSTLYCLEANFILES = $(DEMANGLER_NAME).1
|
||||
|
||||
$(DEMANGLER_NAME).1: cxxfilt.man Makefile
|
||||
sed -e 's/@PROGRAM@/$(DEMANGLER_NAME)/' \
|
||||
-e 's/cxxfilt/$(DEMANGLER_NAME)/' < cxxfilt.man \
|
||||
> $(DEMANGLER_NAME).1
|
||||
|
||||
# Maintenance
|
||||
|
||||
# We need it for the taz target in ../../Makefile.in.
|
||||
info: $(MANS)
|
||||
@@ -1,550 +0,0 @@
|
||||
# Makefile.in generated automatically by automake 1.4 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_alias = @build_alias@
|
||||
build_triplet = @build@
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
target_alias = @target_alias@
|
||||
target_triplet = @target@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
BUILD_DLLTOOL = @BUILD_DLLTOOL@
|
||||
BUILD_DLLWRAP = @BUILD_DLLWRAP@
|
||||
BUILD_MISC = @BUILD_MISC@
|
||||
BUILD_NLMCONV = @BUILD_NLMCONV@
|
||||
BUILD_SRCONV = @BUILD_SRCONV@
|
||||
BUILD_WINDRES = @BUILD_WINDRES@
|
||||
CATALOGS = @CATALOGS@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
CC = @CC@
|
||||
CC_FOR_BUILD = @CC_FOR_BUILD@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
DEMANGLER_NAME = @DEMANGLER_NAME@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DLLTOOL_DEFS = @DLLTOOL_DEFS@
|
||||
EXEEXT = @EXEEXT@
|
||||
EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@
|
||||
GCJ = @GCJ@
|
||||
GCJFLAGS = @GCJFLAGS@
|
||||
GMOFILES = @GMOFILES@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GT_NO = @GT_NO@
|
||||
GT_YES = @GT_YES@
|
||||
HDEFINES = @HDEFINES@
|
||||
INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLDEPS = @INTLDEPS@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
LEX = @LEX@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
MSGFMT = @MSGFMT@
|
||||
NLMCONV_DEFS = @NLMCONV_DEFS@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJDUMP_DEFS = @OBJDUMP_DEFS@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
POFILES = @POFILES@
|
||||
POSUB = @POSUB@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
UNDERSCORE = @UNDERSCORE@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WARN_CFLAGS = @WARN_CFLAGS@
|
||||
YACC = @YACC@
|
||||
l = @l@
|
||||
|
||||
AUTOMAKE_OPTIONS = cygnus
|
||||
|
||||
# What version of the manual you want; "all" includes everything
|
||||
CONFIG = all
|
||||
|
||||
# Options to extract the man page from as.texinfo
|
||||
MANCONF = -Dman
|
||||
|
||||
TEXI2POD = perl $(top_srcdir)/../etc/texi2pod.pl
|
||||
|
||||
POD2MAN = pod2man --center="GNU" --release="binutils-$(VERSION)" --section=1
|
||||
|
||||
# List of man pages generated from binutils.texi
|
||||
man_MANS = \
|
||||
addr2line.1 \
|
||||
ar.1 \
|
||||
dlltool.1 \
|
||||
nlmconv.1 \
|
||||
nm.1 \
|
||||
objcopy.1 \
|
||||
objdump.1 \
|
||||
ranlib.1 \
|
||||
readelf.1 \
|
||||
size.1 \
|
||||
strings.1 \
|
||||
strip.1 \
|
||||
windres.1 \
|
||||
$(DEMANGLER_NAME).1
|
||||
|
||||
|
||||
info_TEXINFOS = binutils.texi
|
||||
|
||||
binutils_TEXI = $(srcdir)/binutils.texi
|
||||
|
||||
MAINTAINERCLEANFILES = config.texi
|
||||
DISTCLEANFILES = config.texi
|
||||
MOSTLYCLEANFILES = $(DEMANGLER_NAME).1
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
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
|
||||
man1dir = $(mandir)/man1
|
||||
MANS = $(man_MANS)
|
||||
|
||||
NROFF = nroff
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = gtar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .dvi .info .ps .texi .texinfo .txi
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
binutils.info: binutils.texi
|
||||
binutils.dvi: binutils.texi
|
||||
|
||||
|
||||
DVIPS = dvips
|
||||
|
||||
.texi.info:
|
||||
@rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
$(MAKEINFO) -I $(srcdir) $<
|
||||
|
||||
.texi.dvi:
|
||||
TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \
|
||||
MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
|
||||
|
||||
.texi:
|
||||
@rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
$(MAKEINFO) -I $(srcdir) $<
|
||||
|
||||
.texinfo.info:
|
||||
@rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
$(MAKEINFO) -I $(srcdir) $<
|
||||
|
||||
.texinfo:
|
||||
@rm -f $@ $@-[0-9] $@-[0-9][0-9]
|
||||
$(MAKEINFO) -I $(srcdir) $<
|
||||
|
||||
.texinfo.dvi:
|
||||
TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$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/texinfo.tex:$$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) $(DESTDIR)$(infodir)
|
||||
@list='$(INFO_DEPS)'; \
|
||||
for file in $$list; 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 $(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 \
|
||||
list='$(INFO_DEPS)'; \
|
||||
for file in $$list; do \
|
||||
echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
|
||||
install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
|
||||
done; \
|
||||
else : ; fi
|
||||
|
||||
uninstall-info:
|
||||
$(PRE_UNINSTALL)
|
||||
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
|
||||
ii=yes; \
|
||||
else ii=; fi; \
|
||||
list='$(INFO_DEPS)'; \
|
||||
for file in $$list; do \
|
||||
test -z "$ii" \
|
||||
|| install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
|
||||
done
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(INFO_DEPS)'; \
|
||||
for file in $$list; do \
|
||||
(cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
|
||||
done
|
||||
|
||||
dist-info: $(INFO_DEPS)
|
||||
list='$(INFO_DEPS)'; \
|
||||
for base in $$list; do \
|
||||
if test -f $$base; then d=.; else d=$(srcdir); fi; \
|
||||
for file in `cd $$d && eval echo $$base*`; do \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file; \
|
||||
done; \
|
||||
done
|
||||
|
||||
mostlyclean-aminfo:
|
||||
-rm -f binutils.aux binutils.cp binutils.cps binutils.dvi binutils.fn \
|
||||
binutils.fns binutils.ky binutils.kys binutils.ps \
|
||||
binutils.log binutils.pg binutils.toc binutils.tp \
|
||||
binutils.tps binutils.vr binutils.vrs binutils.op binutils.tr \
|
||||
binutils.cv binutils.cn
|
||||
|
||||
clean-aminfo:
|
||||
|
||||
distclean-aminfo:
|
||||
|
||||
maintainer-clean-aminfo:
|
||||
for i in $(INFO_DEPS); do \
|
||||
rm -f $$i; \
|
||||
if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
|
||||
rm -f $$i-[0-9]*; \
|
||||
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)
|
||||
$(MAKE) $(AM_MAKEFLAGS) install-man1
|
||||
uninstall-man:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
$(MAKE) $(AM_MAKEFLAGS) uninstall-man1
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = doc
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
if test -f $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
|
||||
info-am: $(INFO_DEPS)
|
||||
info: info-am
|
||||
dvi-am: $(DVIS)
|
||||
dvi: dvi-am
|
||||
check-am:
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-info-am:
|
||||
install-info: install-info-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am: install-man
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-man
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(MANS)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(mandir)/man1
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
-test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
|
||||
mostlyclean-am: mostlyclean-aminfo mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-aminfo clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-aminfo distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: install-info-am uninstall-info mostlyclean-aminfo \
|
||||
distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \
|
||||
uninstall-man1 install-man uninstall-man tags distdir info-am info \
|
||||
dvi-am dvi check check-am installcheck-am installcheck install-info-am \
|
||||
install-info install-exec-am install-exec install-data-am install-data \
|
||||
install-am install uninstall-am uninstall all-redirect all-am all \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
config.texi: Makefile
|
||||
rm -f config.texi
|
||||
echo '@set VERSION $(VERSION)' > config.texi
|
||||
|
||||
binutils.dvi: $(binutils_TEXI) config.texi
|
||||
|
||||
binutils.info: $(binutils_TEXI) config.texi
|
||||
|
||||
# Man page generation from texinfo
|
||||
addr2line.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Daddr2line < $< > addr2line.pod
|
||||
-($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f addr2line.pod
|
||||
|
||||
ar.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dar < $< > ar.pod
|
||||
-($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f ar.pod
|
||||
|
||||
dlltool.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Ddlltool < $< > dlltool.pod
|
||||
-($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f dlltool.pod
|
||||
|
||||
nlmconv.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dnlmconv < $< > nlmconv.pod
|
||||
-($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f nlmconv.pod
|
||||
|
||||
nm.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dnm < $< > nm.pod
|
||||
-($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f nm.pod
|
||||
|
||||
objcopy.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dobjcopy < $< > objcopy.pod
|
||||
-($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f objcopy.pod
|
||||
|
||||
objdump.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dobjdump < $< > objdump.pod
|
||||
-($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f objdump.pod
|
||||
|
||||
ranlib.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dranlib < $< > ranlib.pod
|
||||
-($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f ranlib.pod
|
||||
|
||||
readelf.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dreadelf < $< > readelf.pod
|
||||
-($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f readelf.pod
|
||||
|
||||
size.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dsize < $< > size.pod
|
||||
-($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f size.pod
|
||||
|
||||
strings.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dstrings < $< > strings.pod
|
||||
-($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f strings.pod
|
||||
|
||||
strip.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dstrip < $< > strip.pod
|
||||
-($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f strip.pod
|
||||
|
||||
windres.1: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dwindres < $< > windres.pod
|
||||
-($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f windres.pod
|
||||
|
||||
cxxfilt.man: $(binutils_TEXI)
|
||||
touch $@
|
||||
-$(TEXI2POD) $(MANCONF) -Dcxxfilt < $< > $(DEMANGLER_NAME).pod
|
||||
-($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \
|
||||
mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1)
|
||||
rm -f $(DEMANGLER_NAME).pod
|
||||
|
||||
$(DEMANGLER_NAME).1: cxxfilt.man Makefile
|
||||
sed -e 's/@PROGRAM@/$(DEMANGLER_NAME)/' \
|
||||
-e 's/cxxfilt/$(DEMANGLER_NAME)/' < cxxfilt.man \
|
||||
> $(DEMANGLER_NAME).1
|
||||
|
||||
# Maintenance
|
||||
|
||||
# We need it for the taz target in ../../Makefile.in.
|
||||
info: $(MANS)
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,267 +0,0 @@
|
||||
/* filemode.c -- make a string describing file modes
|
||||
Copyright 1985, 1990, 1991, 1994, 1995, 1997
|
||||
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
|
||||
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, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
|
||||
static char ftypelet PARAMS ((unsigned long));
|
||||
static void setst PARAMS ((unsigned long, char *));
|
||||
|
||||
/* filemodestring - fill in string STR with an ls-style ASCII
|
||||
representation of the st_mode field of file stats block STATP.
|
||||
10 characters are stored in STR; no terminating null is added.
|
||||
The characters stored in STR are:
|
||||
|
||||
0 File type. 'd' for directory, 'c' for character
|
||||
special, 'b' for block special, 'm' for multiplex,
|
||||
'l' for symbolic link, 's' for socket, 'p' for fifo,
|
||||
'-' for any other file type
|
||||
|
||||
1 'r' if the owner may read, '-' otherwise.
|
||||
|
||||
2 'w' if the owner may write, '-' otherwise.
|
||||
|
||||
3 'x' if the owner may execute, 's' if the file is
|
||||
set-user-id, '-' otherwise.
|
||||
'S' if the file is set-user-id, but the execute
|
||||
bit isn't set.
|
||||
|
||||
4 'r' if group members may read, '-' otherwise.
|
||||
|
||||
5 'w' if group members may write, '-' otherwise.
|
||||
|
||||
6 'x' if group members may execute, 's' if the file is
|
||||
set-group-id, '-' otherwise.
|
||||
'S' if it is set-group-id but not executable.
|
||||
|
||||
7 'r' if any user may read, '-' otherwise.
|
||||
|
||||
8 'w' if any user may write, '-' otherwise.
|
||||
|
||||
9 'x' if any user may execute, 't' if the file is "sticky"
|
||||
(will be retained in swap space after execution), '-'
|
||||
otherwise.
|
||||
'T' if the file is sticky but not executable. */
|
||||
|
||||
#if 0
|
||||
|
||||
/* This is not used; only mode_string is used. */
|
||||
|
||||
void
|
||||
filemodestring (statp, str)
|
||||
struct stat *statp;
|
||||
char *str;
|
||||
{
|
||||
mode_string ((unsigned long) statp->st_mode, str);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Get definitions for the file permission bits. */
|
||||
|
||||
#ifndef S_IRWXU
|
||||
#define S_IRWXU 0700
|
||||
#endif
|
||||
#ifndef S_IRUSR
|
||||
#define S_IRUSR 0400
|
||||
#endif
|
||||
#ifndef S_IWUSR
|
||||
#define S_IWUSR 0200
|
||||
#endif
|
||||
#ifndef S_IXUSR
|
||||
#define S_IXUSR 0100
|
||||
#endif
|
||||
|
||||
#ifndef S_IRWXG
|
||||
#define S_IRWXG 0070
|
||||
#endif
|
||||
#ifndef S_IRGRP
|
||||
#define S_IRGRP 0040
|
||||
#endif
|
||||
#ifndef S_IWGRP
|
||||
#define S_IWGRP 0020
|
||||
#endif
|
||||
#ifndef S_IXGRP
|
||||
#define S_IXGRP 0010
|
||||
#endif
|
||||
|
||||
#ifndef S_IRWXO
|
||||
#define S_IRWXO 0007
|
||||
#endif
|
||||
#ifndef S_IROTH
|
||||
#define S_IROTH 0004
|
||||
#endif
|
||||
#ifndef S_IWOTH
|
||||
#define S_IWOTH 0002
|
||||
#endif
|
||||
#ifndef S_IXOTH
|
||||
#define S_IXOTH 0001
|
||||
#endif
|
||||
|
||||
/* Like filemodestring, but only the relevant part of the `struct stat'
|
||||
is given as an argument. */
|
||||
|
||||
void
|
||||
mode_string (mode, str)
|
||||
unsigned long mode;
|
||||
char *str;
|
||||
{
|
||||
str[0] = ftypelet ((unsigned long) mode);
|
||||
str[1] = (mode & S_IRUSR) != 0 ? 'r' : '-';
|
||||
str[2] = (mode & S_IWUSR) != 0 ? 'w' : '-';
|
||||
str[3] = (mode & S_IXUSR) != 0 ? 'x' : '-';
|
||||
str[4] = (mode & S_IRGRP) != 0 ? 'r' : '-';
|
||||
str[5] = (mode & S_IWGRP) != 0 ? 'w' : '-';
|
||||
str[6] = (mode & S_IXGRP) != 0 ? 'x' : '-';
|
||||
str[7] = (mode & S_IROTH) != 0 ? 'r' : '-';
|
||||
str[8] = (mode & S_IWOTH) != 0 ? 'w' : '-';
|
||||
str[9] = (mode & S_IXOTH) != 0 ? 'x' : '-';
|
||||
setst ((unsigned long) mode, str);
|
||||
}
|
||||
|
||||
/* Return a character indicating the type of file described by
|
||||
file mode BITS:
|
||||
'd' for directories
|
||||
'b' for block special files
|
||||
'c' for character special files
|
||||
'm' for multiplexor files
|
||||
'l' for symbolic links
|
||||
's' for sockets
|
||||
'p' for fifos
|
||||
'-' for any other file type. */
|
||||
|
||||
#ifndef S_ISDIR
|
||||
#ifdef S_IFDIR
|
||||
#define S_ISDIR(i) (((i) & S_IFMT) == S_IFDIR)
|
||||
#else /* ! defined (S_IFDIR) */
|
||||
#define S_ISDIR(i) (((i) & 0170000) == 040000)
|
||||
#endif /* ! defined (S_IFDIR) */
|
||||
#endif /* ! defined (S_ISDIR) */
|
||||
|
||||
#ifndef S_ISBLK
|
||||
#ifdef S_IFBLK
|
||||
#define S_ISBLK(i) (((i) & S_IFMT) == S_IFBLK)
|
||||
#else /* ! defined (S_IFBLK) */
|
||||
#define S_ISBLK(i) 0
|
||||
#endif /* ! defined (S_IFBLK) */
|
||||
#endif /* ! defined (S_ISBLK) */
|
||||
|
||||
#ifndef S_ISCHR
|
||||
#ifdef S_IFCHR
|
||||
#define S_ISCHR(i) (((i) & S_IFMT) == S_IFCHR)
|
||||
#else /* ! defined (S_IFCHR) */
|
||||
#define S_ISCHR(i) 0
|
||||
#endif /* ! defined (S_IFCHR) */
|
||||
#endif /* ! defined (S_ISCHR) */
|
||||
|
||||
#ifndef S_ISFIFO
|
||||
#ifdef S_IFIFO
|
||||
#define S_ISFIFO(i) (((i) & S_IFMT) == S_IFIFO)
|
||||
#else /* ! defined (S_IFIFO) */
|
||||
#define S_ISFIFO(i) 0
|
||||
#endif /* ! defined (S_IFIFO) */
|
||||
#endif /* ! defined (S_ISFIFO) */
|
||||
|
||||
#ifndef S_ISSOCK
|
||||
#ifdef S_IFSOCK
|
||||
#define S_ISSOCK(i) (((i) & S_IFMT) == S_IFSOCK)
|
||||
#else /* ! defined (S_IFSOCK) */
|
||||
#define S_ISSOCK(i) 0
|
||||
#endif /* ! defined (S_IFSOCK) */
|
||||
#endif /* ! defined (S_ISSOCK) */
|
||||
|
||||
#ifndef S_ISLNK
|
||||
#ifdef S_IFLNK
|
||||
#define S_ISLNK(i) (((i) & S_IFMT) == S_IFLNK)
|
||||
#else /* ! defined (S_IFLNK) */
|
||||
#define S_ISLNK(i) 0
|
||||
#endif /* ! defined (S_IFLNK) */
|
||||
#endif /* ! defined (S_ISLNK) */
|
||||
|
||||
static char
|
||||
ftypelet (bits)
|
||||
unsigned long bits;
|
||||
{
|
||||
if (S_ISDIR (bits))
|
||||
return 'd';
|
||||
if (S_ISLNK (bits))
|
||||
return 'l';
|
||||
if (S_ISBLK (bits))
|
||||
return 'b';
|
||||
if (S_ISCHR (bits))
|
||||
return 'c';
|
||||
if (S_ISSOCK (bits))
|
||||
return 's';
|
||||
if (S_ISFIFO (bits))
|
||||
return 'p';
|
||||
|
||||
#ifdef S_IFMT
|
||||
#ifdef S_IFMPC
|
||||
if ((bits & S_IFMT) == S_IFMPC
|
||||
|| (bits & S_IFMT) == S_IFMPB)
|
||||
return 'm';
|
||||
#endif
|
||||
#ifdef S_IFNWK
|
||||
if ((bits & S_IFMT) == S_IFNWK)
|
||||
return 'n';
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return '-';
|
||||
}
|
||||
|
||||
/* Set the 's' and 't' flags in file attributes string CHARS,
|
||||
according to the file mode BITS. */
|
||||
|
||||
static void
|
||||
setst (bits, chars)
|
||||
unsigned long bits ATTRIBUTE_UNUSED;
|
||||
char *chars ATTRIBUTE_UNUSED;
|
||||
{
|
||||
#ifdef S_ISUID
|
||||
if (bits & S_ISUID)
|
||||
{
|
||||
if (chars[3] != 'x')
|
||||
/* Set-uid, but not executable by owner. */
|
||||
chars[3] = 'S';
|
||||
else
|
||||
chars[3] = 's';
|
||||
}
|
||||
#endif
|
||||
#ifdef S_ISGID
|
||||
if (bits & S_ISGID)
|
||||
{
|
||||
if (chars[6] != 'x')
|
||||
/* Set-gid, but not executable by group. */
|
||||
chars[6] = 'S';
|
||||
else
|
||||
chars[6] = 's';
|
||||
}
|
||||
#endif
|
||||
#ifdef S_ISVTX
|
||||
if (bits & S_ISVTX)
|
||||
{
|
||||
if (chars[9] != 'x')
|
||||
/* Sticky, but not executable by others. */
|
||||
chars[9] = 'T';
|
||||
else
|
||||
chars[9] = 't';
|
||||
}
|
||||
#endif
|
||||
}
|
||||
7627
binutils/ieee.c
7627
binutils/ieee.c
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
/* Linked with ar.o to flag that this program is 'ranlib' (not 'ar'). */
|
||||
|
||||
int is_ranlib = 1;
|
||||
@@ -1,4 +0,0 @@
|
||||
/* Linked with objcopy.o to flag that this program is 'strip' (not
|
||||
'objcopy'). */
|
||||
|
||||
int is_strip = 1;
|
||||
@@ -1,42 +0,0 @@
|
||||
/* Resources for GNU binutils. */
|
||||
|
||||
#include "SysTypes.r"
|
||||
|
||||
/* Version resources. */
|
||||
|
||||
resource 'vers' (1) {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
verUs,
|
||||
VERSION_STRING,
|
||||
VERSION_STRING " (C) 1986-95 FSF, Inc."
|
||||
};
|
||||
|
||||
resource 'vers' (2, purgeable) {
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
verUs,
|
||||
VERSION_STRING,
|
||||
"binutils " VERSION_STRING " for MPW"
|
||||
};
|
||||
|
||||
#ifdef WANT_CFRG
|
||||
|
||||
#include "CodeFragmentTypes.r"
|
||||
|
||||
resource 'cfrg' (0) {
|
||||
{
|
||||
kPowerPC,
|
||||
kFullLib,
|
||||
kNoVersionNum, kNoVersionNum,
|
||||
0,0,
|
||||
kIsApp, kOnDiskFlat, kZeroOffset, kWholeFork,
|
||||
PROG_NAME
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* WANT_CFRG */
|
||||
@@ -1,98 +0,0 @@
|
||||
#
|
||||
# Makefile for binutils under openVMS (Alpha and Vax)
|
||||
#
|
||||
# For use with gnu-make for vms
|
||||
#
|
||||
# Created by Klaus K"ampf, kkaempf@rmi.de
|
||||
#
|
||||
#
|
||||
|
||||
# Distribution version, filled in by configure.com
|
||||
VERSION=@VERSION@
|
||||
|
||||
ifeq ($(ARCH),ALPHA)
|
||||
TARGET=""vms-alpha""
|
||||
else
|
||||
TARGET=""vms-vax""
|
||||
endif
|
||||
|
||||
ifeq ($(CC),gcc)
|
||||
CFLAGS=/include=([],[-.include],[-.bfd])$(DEFS)
|
||||
DEFS=/define=("TARGET=$(TARGET)")
|
||||
LIBS=,gnu_cc_library:libgcc/lib,sys$$library:vaxcrtl.olb/lib,gnu_cc_library:crt0.obj
|
||||
else
|
||||
CFLAGS=/noopt/debug/include=([],[-.include],[-.bfd])$(DEFS)\
|
||||
/warnings=disable=(missingreturn,implicitfunc,longextern)
|
||||
DEFS=/define=("TARGET=$(TARGET)","const=","unlink=remove")
|
||||
LIBS=,sys$$library:vaxcrtl.olb/lib
|
||||
endif
|
||||
|
||||
BFDLIB = [-.bfd]libbfd.olb/lib
|
||||
BFDLIB_DEP = [-.bfd]libbfd.olb
|
||||
LIBIBERTY_DEP = [-.libiberty]libiberty.olb
|
||||
LIBIBERTY = [-.libiberty]libiberty.olb/lib
|
||||
OPCODES_DEP = [-.opcodes]libopcodes.olb
|
||||
OPCODES = [-.opcodes]libopcodes.olb/lib
|
||||
|
||||
DEBUG_OBJS = rddbg.obj,debug.obj,stabs.obj,ieee.obj,rdcoff.obj
|
||||
|
||||
WRITE_DEBUG_OBJS = $(DEBUG_OBJS),wrstabs.obj
|
||||
|
||||
BULIBS = []bucomm.obj,version.obj,filemode.obj
|
||||
|
||||
ADDL_DEPS = $(BULIBS),$(BFDLIB_DEP),$(LIBIBERTY_DEP)
|
||||
ADDL_LIBS = $(BULIBS),$(BFDLIB),$(LIBIBERTY)
|
||||
|
||||
SIZEOBJS = $(ADDL_DEPS),size.obj
|
||||
|
||||
STRINGSOBJS = $(ADDL_DEPS),strings.obj
|
||||
|
||||
NMOBJS = $(ADDL_DEPS),nm.obj
|
||||
|
||||
OBJDUMPOBJS = $(ADDL_DEPS),objdump.obj,prdbg.obj,$(DEBUG_OBJS),$(OPCODES_DEP)
|
||||
|
||||
all: config.h size.exe strings.exe objdump.exe nm.exe
|
||||
|
||||
size.exe: $(SIZEOBJS)
|
||||
link/exe=$@ size.obj,$(ADDL_LIBS)$(LIBS)
|
||||
|
||||
strings.exe: $(STRINGSOBJS)
|
||||
link/exe=$@ strings.obj,$(ADDL_LIBS)$(LIBS)
|
||||
|
||||
nm.exe: $(NMOBJS)
|
||||
link/exe=$@ nm.obj,$(ADDL_LIBS)$(LIBS)
|
||||
|
||||
objdump.exe: $(OBJDUMPOBJS)
|
||||
link/exe=$@ objdump.obj,prdbg.obj,$(DEBUG_OBJS),$(BFDLIB),$(OPCODES),$(ADDL_LIBS)$(LIBS)
|
||||
|
||||
|
||||
version.obj: version.c
|
||||
$(CC) $(CFLAGS)/define=(VERSION="""$(VERSION)""") $<
|
||||
|
||||
config.h:
|
||||
$$ @configure
|
||||
$(MAKE) -f makefile.vms "CC=$(CC)"
|
||||
|
||||
[-.bfd]libbfd.olb:
|
||||
$(CD) [-.bfd]
|
||||
$(MAKE) -f makefile.vms "CC=$(CC)"
|
||||
$(CD) [-.binutils]
|
||||
|
||||
[-.libiberty]libiberty.olb:
|
||||
$(CD) [-.libiberty]
|
||||
$(MAKE) -f makefile.vms "CC=$(CC)"
|
||||
$(CD) [-.binutils]
|
||||
|
||||
[-.opcodes]libopcodes.olb:
|
||||
$(CD) [-.opcodes]
|
||||
$(MAKE) -f makefile.vms "CC=$(CC)"
|
||||
$(CD) [-.binutils]
|
||||
|
||||
clean:
|
||||
$$ purge
|
||||
$(RM) *.obj;
|
||||
$(RM) *.exe;
|
||||
|
||||
distclean: clean
|
||||
$(RM) config.h;
|
||||
$(RM) makefile.vms;
|
||||
@@ -1,4 +0,0 @@
|
||||
/* Linked with ar.o to flag that this program decides at runtime
|
||||
(using argv[0] if it is is 'ar' or 'ranlib'. */
|
||||
|
||||
int is_ranlib = -1;
|
||||
@@ -1,4 +0,0 @@
|
||||
/* Linked with objcopy.o to flag that this program decides at runtime
|
||||
(using argv[0] if it is is 'strip' or 'objcopy'. */
|
||||
|
||||
int is_strip = -1;
|
||||
@@ -1,27 +0,0 @@
|
||||
# Configuration fragment for binutils.
|
||||
|
||||
Set target_arch `echo {target_canonical} | sed -e 's/-.*-.*//'`
|
||||
|
||||
# (should canonicalize arch name) */
|
||||
|
||||
Set archname ARCH_{target_arch}
|
||||
|
||||
Set underscore 0
|
||||
|
||||
If "{target_canonical}" =~ /sh-hitachi-hms/
|
||||
Set underscore 1
|
||||
End If
|
||||
|
||||
Echo '# From mpw-config.in' > "{o}"mk.tmp
|
||||
Echo "ARCHDEFS = -d" {archname} >> "{o}"mk.tmp
|
||||
Echo "UNDERSCORE = " {underscore} >> "{o}"mk.tmp
|
||||
Echo "BUILD_NLMCONV = " >> "{o}"mk.tmp
|
||||
Echo "BUILD_SRCONV = " >> "{o}"mk.tmp
|
||||
Echo "SYSINFO_PROG = " >> "{o}"mk.tmp
|
||||
Echo "BUILD_DLLTOOL = " >> "{o}"mk.tmp
|
||||
Echo '# End from mpw-config.in' >> "{o}"mk.tmp
|
||||
|
||||
Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new
|
||||
Echo '#include "mpw.h"' >> "{o}"config.new
|
||||
|
||||
MoveIfChange "{o}"config.new "{o}"config.h
|
||||
@@ -1,115 +0,0 @@
|
||||
# Sed commands to finish translating the binutils Unix makefile into MPW syntax.
|
||||
|
||||
# Add a rule.
|
||||
/^#### .*/a\
|
||||
\
|
||||
"{o}"underscore.c.o \\Option-f "{o}"underscore.c\
|
||||
|
||||
# Comment out any alias settings.
|
||||
/^host_alias =/s/^/#/
|
||||
/^target_alias =/s/^/#/
|
||||
|
||||
# Whack out unused host define bits.
|
||||
/HDEFINES/s/@HDEFINES@//
|
||||
|
||||
# Don't build specialized tools.
|
||||
/BUILD_NLMCONV/s/@BUILD_NLMCONV@//
|
||||
/BUILD_SRCONV/s/@BUILD_SRCONV@//
|
||||
/BUILD_DLLTOOL/s/@BUILD_DLLTOOL@//
|
||||
|
||||
/UNDERSCORE/s/@UNDERSCORE@/{UNDERSCORE}/
|
||||
|
||||
# Don't need this.
|
||||
/@HLDFLAGS@/s/@HLDFLAGS@//
|
||||
|
||||
# Point at the libraries directly.
|
||||
/@BFDLIB@/s/@BFDLIB@/::bfd:libbfd.o/
|
||||
/@OPCODES@/s/@OPCODES@/::opcodes:libopcodes.o/
|
||||
|
||||
# Whack out target makefile fragment.
|
||||
/target_makefile_fragment/s/target_makefile_fragment@//
|
||||
|
||||
# Fix and add to the include paths.
|
||||
/^INCLUDES = .*$/s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/
|
||||
/BFDDIR/s/-i {BFDDIR} /-i "{BFDDIR}": /
|
||||
/INCDIR/s/-i {INCDIR} /-i "{INCDIR}": /
|
||||
|
||||
# Use byacc instead of bison (for now anyway).
|
||||
/BISON/s/^BISON =.*$/BISON = byacc/
|
||||
#/BISONFLAGS/s/^BISONFLAGS =.*$/BISONFLAGS = /
|
||||
|
||||
# Embed the version in symbolic doublequotes that will expand to
|
||||
# the right thing for each compiler.
|
||||
/VERSION/s/'"{VERSION}"'/{dq}{VERSION}{dq}/
|
||||
|
||||
# '+' is a special char to MPW, don't use it ever.
|
||||
/c++filt/s/c++filt/cplusfilt/
|
||||
|
||||
# All of the binutils use the same Rez file, change names to refer to it.
|
||||
/^{[A-Z]*_PROG}/s/$/ "{s}"mac-binutils.r/
|
||||
/{[A-Z]*_PROG}\.r/s/{[A-Z]*_PROG}\.r/mac-binutils.r/
|
||||
|
||||
# There are auto-generated references to BFD .h files that are not
|
||||
# in the objdir (like bfd.h) but are in the source dir.
|
||||
/::bfd:lib/s/::bfd:lib\([a-z]*\)\.h/{BFDDIR}:lib\1.h/g
|
||||
|
||||
# Fix the locations of generated files.
|
||||
/config/s/"{s}"config\.h/"{o}"config.h/g
|
||||
/config/s/^config\.h/"{o}"config\.h/
|
||||
/underscore/s/"{s}"underscore\.c/"{o}"underscore.c/g
|
||||
/underscore/s/^underscore\.c/"{o}"underscore\.c/
|
||||
|
||||
# Fix paths to generated source files.
|
||||
/lex.yy.c/s/"{s}"lex\.yy\.c/"{o}"lex.yy.c/g
|
||||
/lex.yy.c/s/^lex\.yy\.c/"{o}"lex.yy.c/
|
||||
/arlex.c/s/"{s}"arlex\.c/"{o}"arlex.c/g
|
||||
/arlex.c/s/^arlex\.c/"{o}"arlex.c/
|
||||
/y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g
|
||||
/y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/
|
||||
/arparse.c/s/"{s}"arparse\.c/"{o}"arparse.c/g
|
||||
/arparse.c/s/^arparse\.c/"{o}"arparse.c/
|
||||
/y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g
|
||||
/y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/
|
||||
/arparse.h/s/"{s}"arparse\.h/"{o}"arparse.h/g
|
||||
/arparse.h/s/^arparse\.h/"{o}"arparse.h/
|
||||
|
||||
/"{s}"{INCDIR}/s/"{s}"{INCDIR}/"{INCDIR}"/g
|
||||
|
||||
# The generated lexer may include an ifdef for older Mac compilers that
|
||||
# needs to work with newer compilers also.
|
||||
/lex.yy.c/s/Rename -y \([^ ]*\) \([^ ]*\)$/sed -e 's,ifdef macintosh,if defined(macintosh) || defined(__MWERKS__),' \1 > \2/
|
||||
|
||||
# Fix an over-eagerness.
|
||||
/echo.*WARNING.*This file/s/'.*'/' '/
|
||||
|
||||
# Add a "stamps" target.
|
||||
$a\
|
||||
stamps \\Option-f stamp-under\
|
||||
|
||||
/^install \\Option-f /,/^$/c\
|
||||
install \\Option-f all install-only\
|
||||
\
|
||||
install-only \\Option-f\
|
||||
NewFolderRecursive "{bindir}"\
|
||||
# Need to copy all the tools\
|
||||
For prog in {PROGS}\
|
||||
Set progname `echo {prog} | sed -e 's/.new//'`\
|
||||
Duplicate -y :{prog} "{bindir}"{progname}\
|
||||
End For\
|
||||
|
||||
|
||||
/true/s/ ; @true$//
|
||||
|
||||
# dot files are trouble, remove them and their actions.
|
||||
/^\.dep/,/^$/d
|
||||
|
||||
# Remove un-useful targets.
|
||||
/^Makefile \\Option-f/,/^$/d
|
||||
/^"{o}"config.h \\Option-f/,/^$/d
|
||||
/^config.status \\Option-f/,/^$/d
|
||||
|
||||
# Don't try to make the demangler's man page, it's useless.
|
||||
/^{DEMANGLER_PROG}\.1 \\Option-f/,/^$/d
|
||||
# Don't depend on it either.
|
||||
/{DEMANGLER_PROG}/s/ {DEMANGLER_PROG}\.1//
|
||||
|
||||
2180
binutils/nlmconv.c
2180
binutils/nlmconv.c
File diff suppressed because it is too large
Load Diff
@@ -1,84 +0,0 @@
|
||||
/* nlmconv.h -- header file for NLM conversion program
|
||||
Copyright 1993 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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 Ian Lance Taylor <ian@cygnus.com>.
|
||||
|
||||
bfd.h, nlm/common.h and nlm/internal.h must be included before this
|
||||
file. */
|
||||
|
||||
/* A linked list of strings. */
|
||||
|
||||
struct string_list
|
||||
{
|
||||
struct string_list *next;
|
||||
char *string;
|
||||
};
|
||||
|
||||
/* The NLM header parser in nlmheader.y stores information in the
|
||||
following variables. */
|
||||
|
||||
extern Nlm_Internal_Fixed_Header *fixed_hdr;
|
||||
extern Nlm_Internal_Variable_Header *var_hdr;
|
||||
extern Nlm_Internal_Version_Header *version_hdr;
|
||||
extern Nlm_Internal_Copyright_Header *copyright_hdr;
|
||||
extern Nlm_Internal_Extended_Header *extended_hdr;
|
||||
|
||||
/* Procedure named by CHECK. */
|
||||
extern char *check_procedure;
|
||||
/* File named by CUSTOM. */
|
||||
extern char *custom_file;
|
||||
/* Whether to generate debugging information (DEBUG). */
|
||||
extern boolean debug_info;
|
||||
/* Procedure named by EXIT. */
|
||||
extern char *exit_procedure;
|
||||
/* Exported symbols (EXPORT). */
|
||||
extern struct string_list *export_symbols;
|
||||
/* List of files from INPUT. */
|
||||
extern struct string_list *input_files;
|
||||
/* Map file name (MAP, FULLMAP). */
|
||||
extern char *map_file;
|
||||
/* Whether a full map has been requested (FULLMAP). */
|
||||
extern boolean full_map;
|
||||
/* File named by HELP. */
|
||||
extern char *help_file;
|
||||
/* Imported symbols (IMPORT). */
|
||||
extern struct string_list *import_symbols;
|
||||
/* File named by MESSAGES. */
|
||||
extern char *message_file;
|
||||
/* Autoload module list (MODULE). */
|
||||
extern struct string_list *modules;
|
||||
/* File named by OUTPUT. */
|
||||
extern char *output_file;
|
||||
/* File named by SHARELIB. */
|
||||
extern char *sharelib_file;
|
||||
/* Start procedure name (START). */
|
||||
extern char *start_procedure;
|
||||
/* VERBOSE. */
|
||||
extern boolean verbose;
|
||||
/* RPC description file (XDCDATA). */
|
||||
extern char *rpc_file;
|
||||
|
||||
/* The number of serious parse errors. */
|
||||
extern int parse_errors;
|
||||
|
||||
/* The parser. */
|
||||
extern int yyparse PARAMS ((void));
|
||||
|
||||
/* Tell the lexer what file to read. */
|
||||
extern boolean nlmlex_file PARAMS ((const char *));
|
||||
@@ -1,978 +0,0 @@
|
||||
%{/* nlmheader.y - parse NLM header specification keywords.
|
||||
Copyright 1993, 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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 Ian Lance Taylor <ian@cygnus.com>.
|
||||
|
||||
This bison file parses the commands recognized by the NetWare NLM
|
||||
linker, except for lists of object files. It stores the
|
||||
information in global variables.
|
||||
|
||||
This implementation is based on the description in the NetWare Tool
|
||||
Maker Specification manual, edition 1.0. */
|
||||
|
||||
#include <ansidecl.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
#include "nlm/common.h"
|
||||
#include "nlm/internal.h"
|
||||
#include "nlmconv.h"
|
||||
|
||||
/* Information is stored in the structures pointed to by these
|
||||
variables. */
|
||||
|
||||
Nlm_Internal_Fixed_Header *fixed_hdr;
|
||||
Nlm_Internal_Variable_Header *var_hdr;
|
||||
Nlm_Internal_Version_Header *version_hdr;
|
||||
Nlm_Internal_Copyright_Header *copyright_hdr;
|
||||
Nlm_Internal_Extended_Header *extended_hdr;
|
||||
|
||||
/* Procedure named by CHECK. */
|
||||
char *check_procedure;
|
||||
/* File named by CUSTOM. */
|
||||
char *custom_file;
|
||||
/* Whether to generate debugging information (DEBUG). */
|
||||
boolean debug_info;
|
||||
/* Procedure named by EXIT. */
|
||||
char *exit_procedure;
|
||||
/* Exported symbols (EXPORT). */
|
||||
struct string_list *export_symbols;
|
||||
/* List of files from INPUT. */
|
||||
struct string_list *input_files;
|
||||
/* Map file name (MAP, FULLMAP). */
|
||||
char *map_file;
|
||||
/* Whether a full map has been requested (FULLMAP). */
|
||||
boolean full_map;
|
||||
/* File named by HELP. */
|
||||
char *help_file;
|
||||
/* Imported symbols (IMPORT). */
|
||||
struct string_list *import_symbols;
|
||||
/* File named by MESSAGES. */
|
||||
char *message_file;
|
||||
/* Autoload module list (MODULE). */
|
||||
struct string_list *modules;
|
||||
/* File named by OUTPUT. */
|
||||
char *output_file;
|
||||
/* File named by SHARELIB. */
|
||||
char *sharelib_file;
|
||||
/* Start procedure name (START). */
|
||||
char *start_procedure;
|
||||
/* VERBOSE. */
|
||||
boolean verbose;
|
||||
/* RPC description file (XDCDATA). */
|
||||
char *rpc_file;
|
||||
|
||||
/* The number of serious errors that have occurred. */
|
||||
int parse_errors;
|
||||
|
||||
/* The current symbol prefix when reading a list of import or export
|
||||
symbols. */
|
||||
static char *symbol_prefix;
|
||||
|
||||
/* Parser error message handler. */
|
||||
#define yyerror(msg) nlmheader_error (msg);
|
||||
|
||||
/* Local functions. */
|
||||
static int yylex PARAMS ((void));
|
||||
static void nlmlex_file_push PARAMS ((const char *));
|
||||
static boolean nlmlex_file_open PARAMS ((const char *));
|
||||
static int nlmlex_buf_init PARAMS ((void));
|
||||
static char nlmlex_buf_add PARAMS ((int));
|
||||
static long nlmlex_get_number PARAMS ((const char *));
|
||||
static void nlmheader_identify PARAMS ((void));
|
||||
static void nlmheader_warn PARAMS ((const char *, int));
|
||||
static void nlmheader_error PARAMS ((const char *));
|
||||
static struct string_list * string_list_cons PARAMS ((char *,
|
||||
struct string_list *));
|
||||
static struct string_list * string_list_append PARAMS ((struct string_list *,
|
||||
struct string_list *));
|
||||
static struct string_list * string_list_append1 PARAMS ((struct string_list *,
|
||||
char *));
|
||||
static char *xstrdup PARAMS ((const char *));
|
||||
|
||||
%}
|
||||
|
||||
%union
|
||||
{
|
||||
char *string;
|
||||
struct string_list *list;
|
||||
};
|
||||
|
||||
/* The reserved words. */
|
||||
|
||||
%token CHECK CODESTART COPYRIGHT CUSTOM DATE DEBUG DESCRIPTION EXIT
|
||||
%token EXPORT FLAG_ON FLAG_OFF FULLMAP HELP IMPORT INPUT MAP MESSAGES
|
||||
%token MODULE MULTIPLE OS_DOMAIN OUTPUT PSEUDOPREEMPTION REENTRANT
|
||||
%token SCREENNAME SHARELIB STACK START SYNCHRONIZE
|
||||
%token THREADNAME TYPE VERBOSE VERSIONK XDCDATA
|
||||
|
||||
/* Arguments. */
|
||||
|
||||
%token <string> STRING
|
||||
%token <string> QUOTED_STRING
|
||||
|
||||
/* Typed non-terminals. */
|
||||
%type <list> symbol_list_opt symbol_list string_list
|
||||
%type <string> symbol
|
||||
|
||||
%%
|
||||
|
||||
/* Keywords must start in the leftmost column of the file. Arguments
|
||||
may appear anywhere else. The lexer uses this to determine what
|
||||
token to return, so we don't have to worry about it here. */
|
||||
|
||||
/* The entire file is just a list of commands. */
|
||||
|
||||
file:
|
||||
commands
|
||||
;
|
||||
|
||||
/* A possibly empty list of commands. */
|
||||
|
||||
commands:
|
||||
/* May be empty. */
|
||||
| command commands
|
||||
;
|
||||
|
||||
/* A single command. There is where most of the work takes place. */
|
||||
|
||||
command:
|
||||
CHECK STRING
|
||||
{
|
||||
check_procedure = $2;
|
||||
}
|
||||
| CODESTART STRING
|
||||
{
|
||||
nlmheader_warn (_("CODESTART is not implemented; sorry"), -1);
|
||||
free ($2);
|
||||
}
|
||||
| COPYRIGHT QUOTED_STRING
|
||||
{
|
||||
int len;
|
||||
|
||||
strncpy (copyright_hdr->stamp, "CoPyRiGhT=", 10);
|
||||
len = strlen ($2);
|
||||
if (len >= NLM_MAX_COPYRIGHT_MESSAGE_LENGTH)
|
||||
{
|
||||
nlmheader_warn (_("copyright string is too long"),
|
||||
NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1);
|
||||
len = NLM_MAX_COPYRIGHT_MESSAGE_LENGTH - 1;
|
||||
}
|
||||
copyright_hdr->copyrightMessageLength = len;
|
||||
strncpy (copyright_hdr->copyrightMessage, $2, len);
|
||||
copyright_hdr->copyrightMessage[len] = '\0';
|
||||
free ($2);
|
||||
}
|
||||
| CUSTOM STRING
|
||||
{
|
||||
custom_file = $2;
|
||||
}
|
||||
| DATE STRING STRING STRING
|
||||
{
|
||||
/* We don't set the version stamp here, because we use the
|
||||
version stamp to detect whether the required VERSION
|
||||
keyword was given. */
|
||||
version_hdr->month = nlmlex_get_number ($2);
|
||||
version_hdr->day = nlmlex_get_number ($3);
|
||||
version_hdr->year = nlmlex_get_number ($4);
|
||||
free ($2);
|
||||
free ($3);
|
||||
free ($4);
|
||||
if (version_hdr->month < 1 || version_hdr->month > 12)
|
||||
nlmheader_warn (_("illegal month"), -1);
|
||||
if (version_hdr->day < 1 || version_hdr->day > 31)
|
||||
nlmheader_warn (_("illegal day"), -1);
|
||||
if (version_hdr->year < 1900 || version_hdr->year > 3000)
|
||||
nlmheader_warn (_("illegal year"), -1);
|
||||
}
|
||||
| DEBUG
|
||||
{
|
||||
debug_info = true;
|
||||
}
|
||||
| DESCRIPTION QUOTED_STRING
|
||||
{
|
||||
int len;
|
||||
|
||||
len = strlen ($2);
|
||||
if (len > NLM_MAX_DESCRIPTION_LENGTH)
|
||||
{
|
||||
nlmheader_warn (_("description string is too long"),
|
||||
NLM_MAX_DESCRIPTION_LENGTH);
|
||||
len = NLM_MAX_DESCRIPTION_LENGTH;
|
||||
}
|
||||
var_hdr->descriptionLength = len;
|
||||
strncpy (var_hdr->descriptionText, $2, len);
|
||||
var_hdr->descriptionText[len] = '\0';
|
||||
free ($2);
|
||||
}
|
||||
| EXIT STRING
|
||||
{
|
||||
exit_procedure = $2;
|
||||
}
|
||||
| EXPORT
|
||||
{
|
||||
symbol_prefix = NULL;
|
||||
}
|
||||
symbol_list_opt
|
||||
{
|
||||
export_symbols = string_list_append (export_symbols, $3);
|
||||
}
|
||||
| FLAG_ON STRING
|
||||
{
|
||||
fixed_hdr->flags |= nlmlex_get_number ($2);
|
||||
free ($2);
|
||||
}
|
||||
| FLAG_OFF STRING
|
||||
{
|
||||
fixed_hdr->flags &=~ nlmlex_get_number ($2);
|
||||
free ($2);
|
||||
}
|
||||
| FULLMAP
|
||||
{
|
||||
map_file = "";
|
||||
full_map = true;
|
||||
}
|
||||
| FULLMAP STRING
|
||||
{
|
||||
map_file = $2;
|
||||
full_map = true;
|
||||
}
|
||||
| HELP STRING
|
||||
{
|
||||
help_file = $2;
|
||||
}
|
||||
| IMPORT
|
||||
{
|
||||
symbol_prefix = NULL;
|
||||
}
|
||||
symbol_list_opt
|
||||
{
|
||||
import_symbols = string_list_append (import_symbols, $3);
|
||||
}
|
||||
| INPUT string_list
|
||||
{
|
||||
input_files = string_list_append (input_files, $2);
|
||||
}
|
||||
| MAP
|
||||
{
|
||||
map_file = "";
|
||||
}
|
||||
| MAP STRING
|
||||
{
|
||||
map_file = $2;
|
||||
}
|
||||
| MESSAGES STRING
|
||||
{
|
||||
message_file = $2;
|
||||
}
|
||||
| MODULE string_list
|
||||
{
|
||||
modules = string_list_append (modules, $2);
|
||||
}
|
||||
| MULTIPLE
|
||||
{
|
||||
fixed_hdr->flags |= 0x2;
|
||||
}
|
||||
| OS_DOMAIN
|
||||
{
|
||||
fixed_hdr->flags |= 0x10;
|
||||
}
|
||||
| OUTPUT STRING
|
||||
{
|
||||
if (output_file == NULL)
|
||||
output_file = $2;
|
||||
else
|
||||
nlmheader_warn (_("ignoring duplicate OUTPUT statement"), -1);
|
||||
}
|
||||
| PSEUDOPREEMPTION
|
||||
{
|
||||
fixed_hdr->flags |= 0x8;
|
||||
}
|
||||
| REENTRANT
|
||||
{
|
||||
fixed_hdr->flags |= 0x1;
|
||||
}
|
||||
| SCREENNAME QUOTED_STRING
|
||||
{
|
||||
int len;
|
||||
|
||||
len = strlen ($2);
|
||||
if (len >= NLM_MAX_SCREEN_NAME_LENGTH)
|
||||
{
|
||||
nlmheader_warn (_("screen name is too long"),
|
||||
NLM_MAX_SCREEN_NAME_LENGTH);
|
||||
len = NLM_MAX_SCREEN_NAME_LENGTH;
|
||||
}
|
||||
var_hdr->screenNameLength = len;
|
||||
strncpy (var_hdr->screenName, $2, len);
|
||||
var_hdr->screenName[NLM_MAX_SCREEN_NAME_LENGTH] = '\0';
|
||||
free ($2);
|
||||
}
|
||||
| SHARELIB STRING
|
||||
{
|
||||
sharelib_file = $2;
|
||||
}
|
||||
| STACK STRING
|
||||
{
|
||||
var_hdr->stackSize = nlmlex_get_number ($2);
|
||||
free ($2);
|
||||
}
|
||||
| START STRING
|
||||
{
|
||||
start_procedure = $2;
|
||||
}
|
||||
| SYNCHRONIZE
|
||||
{
|
||||
fixed_hdr->flags |= 0x4;
|
||||
}
|
||||
| THREADNAME QUOTED_STRING
|
||||
{
|
||||
int len;
|
||||
|
||||
len = strlen ($2);
|
||||
if (len >= NLM_MAX_THREAD_NAME_LENGTH)
|
||||
{
|
||||
nlmheader_warn (_("thread name is too long"),
|
||||
NLM_MAX_THREAD_NAME_LENGTH);
|
||||
len = NLM_MAX_THREAD_NAME_LENGTH;
|
||||
}
|
||||
var_hdr->threadNameLength = len;
|
||||
strncpy (var_hdr->threadName, $2, len);
|
||||
var_hdr->threadName[len] = '\0';
|
||||
free ($2);
|
||||
}
|
||||
| TYPE STRING
|
||||
{
|
||||
fixed_hdr->moduleType = nlmlex_get_number ($2);
|
||||
free ($2);
|
||||
}
|
||||
| VERBOSE
|
||||
{
|
||||
verbose = true;
|
||||
}
|
||||
| VERSIONK STRING STRING STRING
|
||||
{
|
||||
long val;
|
||||
|
||||
strncpy (version_hdr->stamp, "VeRsIoN#", 8);
|
||||
version_hdr->majorVersion = nlmlex_get_number ($2);
|
||||
val = nlmlex_get_number ($3);
|
||||
if (val < 0 || val > 99)
|
||||
nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"),
|
||||
-1);
|
||||
else
|
||||
version_hdr->minorVersion = val;
|
||||
val = nlmlex_get_number ($4);
|
||||
if (val < 0)
|
||||
nlmheader_warn (_("illegal revision number (must be between 0 and 26)"),
|
||||
-1);
|
||||
else if (val > 26)
|
||||
version_hdr->revision = 0;
|
||||
else
|
||||
version_hdr->revision = val;
|
||||
free ($2);
|
||||
free ($3);
|
||||
free ($4);
|
||||
}
|
||||
| VERSIONK STRING STRING
|
||||
{
|
||||
long val;
|
||||
|
||||
strncpy (version_hdr->stamp, "VeRsIoN#", 8);
|
||||
version_hdr->majorVersion = nlmlex_get_number ($2);
|
||||
val = nlmlex_get_number ($3);
|
||||
if (val < 0 || val > 99)
|
||||
nlmheader_warn (_("illegal minor version number (must be between 0 and 99)"),
|
||||
-1);
|
||||
else
|
||||
version_hdr->minorVersion = val;
|
||||
version_hdr->revision = 0;
|
||||
free ($2);
|
||||
free ($3);
|
||||
}
|
||||
| XDCDATA STRING
|
||||
{
|
||||
rpc_file = $2;
|
||||
}
|
||||
;
|
||||
|
||||
/* A possibly empty list of symbols. */
|
||||
|
||||
symbol_list_opt:
|
||||
/* Empty. */
|
||||
{
|
||||
$$ = NULL;
|
||||
}
|
||||
| symbol_list
|
||||
{
|
||||
$$ = $1;
|
||||
}
|
||||
;
|
||||
|
||||
/* A list of symbols in an import or export list. Prefixes may appear
|
||||
in parentheses. We need to use left recursion here to avoid
|
||||
building up a large import list on the parser stack. */
|
||||
|
||||
symbol_list:
|
||||
symbol
|
||||
{
|
||||
$$ = string_list_cons ($1, NULL);
|
||||
}
|
||||
| symbol_prefix
|
||||
{
|
||||
$$ = NULL;
|
||||
}
|
||||
| symbol_list symbol
|
||||
{
|
||||
$$ = string_list_append1 ($1, $2);
|
||||
}
|
||||
| symbol_list symbol_prefix
|
||||
{
|
||||
$$ = $1;
|
||||
}
|
||||
;
|
||||
|
||||
/* A prefix for subsequent symbols. */
|
||||
|
||||
symbol_prefix:
|
||||
'(' STRING ')'
|
||||
{
|
||||
if (symbol_prefix != NULL)
|
||||
free (symbol_prefix);
|
||||
symbol_prefix = $2;
|
||||
}
|
||||
;
|
||||
|
||||
/* A single symbol. */
|
||||
|
||||
symbol:
|
||||
STRING
|
||||
{
|
||||
if (symbol_prefix == NULL)
|
||||
$$ = $1;
|
||||
else
|
||||
{
|
||||
$$ = xmalloc (strlen (symbol_prefix) + strlen ($1) + 2);
|
||||
sprintf ($$, "%s@%s", symbol_prefix, $1);
|
||||
free ($1);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
/* A list of strings. */
|
||||
|
||||
string_list:
|
||||
/* May be empty. */
|
||||
{
|
||||
$$ = NULL;
|
||||
}
|
||||
| STRING string_list
|
||||
{
|
||||
$$ = string_list_cons ($1, $2);
|
||||
}
|
||||
;
|
||||
|
||||
%%
|
||||
|
||||
/* If strerror is just a macro, we want to use the one from libiberty
|
||||
since it will handle undefined values. */
|
||||
#undef strerror
|
||||
extern char *strerror ();
|
||||
|
||||
/* The lexer is simple, too simple for flex. Keywords are only
|
||||
recognized at the start of lines. Everything else must be an
|
||||
argument. A comma is treated as whitespace. */
|
||||
|
||||
/* The states the lexer can be in. */
|
||||
|
||||
enum lex_state
|
||||
{
|
||||
/* At the beginning of a line. */
|
||||
BEGINNING_OF_LINE,
|
||||
/* In the middle of a line. */
|
||||
IN_LINE
|
||||
};
|
||||
|
||||
/* We need to keep a stack of files to handle file inclusion. */
|
||||
|
||||
struct input
|
||||
{
|
||||
/* The file to read from. */
|
||||
FILE *file;
|
||||
/* The name of the file. */
|
||||
char *name;
|
||||
/* The current line number. */
|
||||
int lineno;
|
||||
/* The current state. */
|
||||
enum lex_state state;
|
||||
/* The next file on the stack. */
|
||||
struct input *next;
|
||||
};
|
||||
|
||||
/* The current input file. */
|
||||
|
||||
static struct input current;
|
||||
|
||||
/* The character which introduces comments. */
|
||||
#define COMMENT_CHAR '#'
|
||||
|
||||
/* Start the lexer going on the main input file. */
|
||||
|
||||
boolean
|
||||
nlmlex_file (name)
|
||||
const char *name;
|
||||
{
|
||||
current.next = NULL;
|
||||
return nlmlex_file_open (name);
|
||||
}
|
||||
|
||||
/* Start the lexer going on a subsidiary input file. */
|
||||
|
||||
static void
|
||||
nlmlex_file_push (name)
|
||||
const char *name;
|
||||
{
|
||||
struct input *push;
|
||||
|
||||
push = (struct input *) xmalloc (sizeof (struct input));
|
||||
*push = current;
|
||||
if (nlmlex_file_open (name))
|
||||
current.next = push;
|
||||
else
|
||||
{
|
||||
current = *push;
|
||||
free (push);
|
||||
}
|
||||
}
|
||||
|
||||
/* Start lexing from a file. */
|
||||
|
||||
static boolean
|
||||
nlmlex_file_open (name)
|
||||
const char *name;
|
||||
{
|
||||
current.file = fopen (name, "r");
|
||||
if (current.file == NULL)
|
||||
{
|
||||
fprintf (stderr, "%s:%s: %s\n", program_name, name, strerror (errno));
|
||||
++parse_errors;
|
||||
return false;
|
||||
}
|
||||
current.name = xstrdup (name);
|
||||
current.lineno = 1;
|
||||
current.state = BEGINNING_OF_LINE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Table used to turn keywords into tokens. */
|
||||
|
||||
struct keyword_tokens_struct
|
||||
{
|
||||
const char *keyword;
|
||||
int token;
|
||||
};
|
||||
|
||||
struct keyword_tokens_struct keyword_tokens[] =
|
||||
{
|
||||
{ "CHECK", CHECK },
|
||||
{ "CODESTART", CODESTART },
|
||||
{ "COPYRIGHT", COPYRIGHT },
|
||||
{ "CUSTOM", CUSTOM },
|
||||
{ "DATE", DATE },
|
||||
{ "DEBUG", DEBUG },
|
||||
{ "DESCRIPTION", DESCRIPTION },
|
||||
{ "EXIT", EXIT },
|
||||
{ "EXPORT", EXPORT },
|
||||
{ "FLAG_ON", FLAG_ON },
|
||||
{ "FLAG_OFF", FLAG_OFF },
|
||||
{ "FULLMAP", FULLMAP },
|
||||
{ "HELP", HELP },
|
||||
{ "IMPORT", IMPORT },
|
||||
{ "INPUT", INPUT },
|
||||
{ "MAP", MAP },
|
||||
{ "MESSAGES", MESSAGES },
|
||||
{ "MODULE", MODULE },
|
||||
{ "MULTIPLE", MULTIPLE },
|
||||
{ "OS_DOMAIN", OS_DOMAIN },
|
||||
{ "OUTPUT", OUTPUT },
|
||||
{ "PSEUDOPREEMPTION", PSEUDOPREEMPTION },
|
||||
{ "REENTRANT", REENTRANT },
|
||||
{ "SCREENNAME", SCREENNAME },
|
||||
{ "SHARELIB", SHARELIB },
|
||||
{ "STACK", STACK },
|
||||
{ "STACKSIZE", STACK },
|
||||
{ "START", START },
|
||||
{ "SYNCHRONIZE", SYNCHRONIZE },
|
||||
{ "THREADNAME", THREADNAME },
|
||||
{ "TYPE", TYPE },
|
||||
{ "VERBOSE", VERBOSE },
|
||||
{ "VERSION", VERSIONK },
|
||||
{ "XDCDATA", XDCDATA }
|
||||
};
|
||||
|
||||
#define KEYWORD_COUNT (sizeof (keyword_tokens) / sizeof (keyword_tokens[0]))
|
||||
|
||||
/* The lexer accumulates strings in these variables. */
|
||||
static char *lex_buf;
|
||||
static int lex_size;
|
||||
static int lex_pos;
|
||||
|
||||
/* Start accumulating strings into the buffer. */
|
||||
#define BUF_INIT() \
|
||||
((void) (lex_buf != NULL ? lex_pos = 0 : nlmlex_buf_init ()))
|
||||
|
||||
static int
|
||||
nlmlex_buf_init ()
|
||||
{
|
||||
lex_size = 10;
|
||||
lex_buf = xmalloc (lex_size + 1);
|
||||
lex_pos = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Finish a string in the buffer. */
|
||||
#define BUF_FINISH() ((void) (lex_buf[lex_pos] = '\0'))
|
||||
|
||||
/* Accumulate a character into the buffer. */
|
||||
#define BUF_ADD(c) \
|
||||
((void) (lex_pos < lex_size \
|
||||
? lex_buf[lex_pos++] = (c) \
|
||||
: nlmlex_buf_add (c)))
|
||||
|
||||
static char
|
||||
nlmlex_buf_add (c)
|
||||
int c;
|
||||
{
|
||||
if (lex_pos >= lex_size)
|
||||
{
|
||||
lex_size *= 2;
|
||||
lex_buf = xrealloc (lex_buf, lex_size + 1);
|
||||
}
|
||||
|
||||
return lex_buf[lex_pos++] = c;
|
||||
}
|
||||
|
||||
/* The lexer proper. This is called by the bison generated parsing
|
||||
code. */
|
||||
|
||||
static int
|
||||
yylex ()
|
||||
{
|
||||
int c;
|
||||
|
||||
tail_recurse:
|
||||
|
||||
c = getc (current.file);
|
||||
|
||||
/* Commas are treated as whitespace characters. */
|
||||
while (isspace ((unsigned char) c) || c == ',')
|
||||
{
|
||||
current.state = IN_LINE;
|
||||
if (c == '\n')
|
||||
{
|
||||
++current.lineno;
|
||||
current.state = BEGINNING_OF_LINE;
|
||||
}
|
||||
c = getc (current.file);
|
||||
}
|
||||
|
||||
/* At the end of the file we either pop to the previous file or
|
||||
finish up. */
|
||||
if (c == EOF)
|
||||
{
|
||||
fclose (current.file);
|
||||
free (current.name);
|
||||
if (current.next == NULL)
|
||||
return 0;
|
||||
else
|
||||
{
|
||||
struct input *next;
|
||||
|
||||
next = current.next;
|
||||
current = *next;
|
||||
free (next);
|
||||
goto tail_recurse;
|
||||
}
|
||||
}
|
||||
|
||||
/* A comment character always means to drop everything until the
|
||||
next newline. */
|
||||
if (c == COMMENT_CHAR)
|
||||
{
|
||||
do
|
||||
{
|
||||
c = getc (current.file);
|
||||
}
|
||||
while (c != '\n');
|
||||
++current.lineno;
|
||||
current.state = BEGINNING_OF_LINE;
|
||||
goto tail_recurse;
|
||||
}
|
||||
|
||||
/* An '@' introduces an include file. */
|
||||
if (c == '@')
|
||||
{
|
||||
do
|
||||
{
|
||||
c = getc (current.file);
|
||||
if (c == '\n')
|
||||
++current.lineno;
|
||||
}
|
||||
while (isspace ((unsigned char) c));
|
||||
BUF_INIT ();
|
||||
while (! isspace ((unsigned char) c) && c != EOF)
|
||||
{
|
||||
BUF_ADD (c);
|
||||
c = getc (current.file);
|
||||
}
|
||||
BUF_FINISH ();
|
||||
|
||||
ungetc (c, current.file);
|
||||
|
||||
nlmlex_file_push (lex_buf);
|
||||
goto tail_recurse;
|
||||
}
|
||||
|
||||
/* A non-space character at the start of a line must be the start of
|
||||
a keyword. */
|
||||
if (current.state == BEGINNING_OF_LINE)
|
||||
{
|
||||
BUF_INIT ();
|
||||
while (isalnum ((unsigned char) c) || c == '_')
|
||||
{
|
||||
if (islower ((unsigned char) c))
|
||||
BUF_ADD (toupper ((unsigned char) c));
|
||||
else
|
||||
BUF_ADD (c);
|
||||
c = getc (current.file);
|
||||
}
|
||||
BUF_FINISH ();
|
||||
|
||||
if (c != EOF && ! isspace ((unsigned char) c) && c != ',')
|
||||
{
|
||||
nlmheader_identify ();
|
||||
fprintf (stderr, _("%s:%d: illegal character in keyword: %c\n"),
|
||||
current.name, current.lineno, c);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < KEYWORD_COUNT; i++)
|
||||
{
|
||||
if (lex_buf[0] == keyword_tokens[i].keyword[0]
|
||||
&& strcmp (lex_buf, keyword_tokens[i].keyword) == 0)
|
||||
{
|
||||
/* Pushing back the final whitespace avoids worrying
|
||||
about \n here. */
|
||||
ungetc (c, current.file);
|
||||
current.state = IN_LINE;
|
||||
return keyword_tokens[i].token;
|
||||
}
|
||||
}
|
||||
|
||||
nlmheader_identify ();
|
||||
fprintf (stderr, _("%s:%d: unrecognized keyword: %s\n"),
|
||||
current.name, current.lineno, lex_buf);
|
||||
}
|
||||
|
||||
++parse_errors;
|
||||
/* Treat the rest of this line as a comment. */
|
||||
ungetc (COMMENT_CHAR, current.file);
|
||||
goto tail_recurse;
|
||||
}
|
||||
|
||||
/* Parentheses just represent themselves. */
|
||||
if (c == '(' || c == ')')
|
||||
return c;
|
||||
|
||||
/* Handle quoted strings. */
|
||||
if (c == '"' || c == '\'')
|
||||
{
|
||||
int quote;
|
||||
int start_lineno;
|
||||
|
||||
quote = c;
|
||||
start_lineno = current.lineno;
|
||||
|
||||
c = getc (current.file);
|
||||
BUF_INIT ();
|
||||
while (c != quote && c != EOF)
|
||||
{
|
||||
BUF_ADD (c);
|
||||
if (c == '\n')
|
||||
++current.lineno;
|
||||
c = getc (current.file);
|
||||
}
|
||||
BUF_FINISH ();
|
||||
|
||||
if (c == EOF)
|
||||
{
|
||||
nlmheader_identify ();
|
||||
fprintf (stderr, _("%s:%d: end of file in quoted string\n"),
|
||||
current.name, start_lineno);
|
||||
++parse_errors;
|
||||
}
|
||||
|
||||
/* FIXME: Possible memory leak. */
|
||||
yylval.string = xstrdup (lex_buf);
|
||||
return QUOTED_STRING;
|
||||
}
|
||||
|
||||
/* Gather a generic argument. */
|
||||
BUF_INIT ();
|
||||
while (! isspace (c)
|
||||
&& c != ','
|
||||
&& c != COMMENT_CHAR
|
||||
&& c != '('
|
||||
&& c != ')')
|
||||
{
|
||||
BUF_ADD (c);
|
||||
c = getc (current.file);
|
||||
}
|
||||
BUF_FINISH ();
|
||||
|
||||
ungetc (c, current.file);
|
||||
|
||||
/* FIXME: Possible memory leak. */
|
||||
yylval.string = xstrdup (lex_buf);
|
||||
return STRING;
|
||||
}
|
||||
|
||||
/* Get a number from a string. */
|
||||
|
||||
static long
|
||||
nlmlex_get_number (s)
|
||||
const char *s;
|
||||
{
|
||||
long ret;
|
||||
char *send;
|
||||
|
||||
ret = strtol (s, &send, 10);
|
||||
if (*send != '\0')
|
||||
nlmheader_warn (_("bad number"), -1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Prefix the nlmconv warnings with a note as to where they come from.
|
||||
We don't use program_name on every warning, because then some
|
||||
versions of the emacs next-error function can't recognize the line
|
||||
number. */
|
||||
|
||||
static void
|
||||
nlmheader_identify ()
|
||||
{
|
||||
static int done;
|
||||
|
||||
if (! done)
|
||||
{
|
||||
fprintf (stderr, _("%s: problems in NLM command language input:\n"),
|
||||
program_name);
|
||||
done = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Issue a warning. */
|
||||
|
||||
static void
|
||||
nlmheader_warn (s, imax)
|
||||
const char *s;
|
||||
int imax;
|
||||
{
|
||||
nlmheader_identify ();
|
||||
fprintf (stderr, "%s:%d: %s", current.name, current.lineno, s);
|
||||
if (imax != -1)
|
||||
fprintf (stderr, " (max %d)", imax);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
||||
/* Report an error. */
|
||||
|
||||
static void
|
||||
nlmheader_error (s)
|
||||
const char *s;
|
||||
{
|
||||
nlmheader_warn (s, -1);
|
||||
++parse_errors;
|
||||
}
|
||||
|
||||
/* Add a string to a string list. */
|
||||
|
||||
static struct string_list *
|
||||
string_list_cons (s, l)
|
||||
char *s;
|
||||
struct string_list *l;
|
||||
{
|
||||
struct string_list *ret;
|
||||
|
||||
ret = (struct string_list *) xmalloc (sizeof (struct string_list));
|
||||
ret->next = l;
|
||||
ret->string = s;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Append a string list to another string list. */
|
||||
|
||||
static struct string_list *
|
||||
string_list_append (l1, l2)
|
||||
struct string_list *l1;
|
||||
struct string_list *l2;
|
||||
{
|
||||
register struct string_list **pp;
|
||||
|
||||
for (pp = &l1; *pp != NULL; pp = &(*pp)->next)
|
||||
;
|
||||
*pp = l2;
|
||||
return l1;
|
||||
}
|
||||
|
||||
/* Append a string to a string list. */
|
||||
|
||||
static struct string_list *
|
||||
string_list_append1 (l, s)
|
||||
struct string_list *l;
|
||||
char *s;
|
||||
{
|
||||
struct string_list *n;
|
||||
register struct string_list **pp;
|
||||
|
||||
n = (struct string_list *) xmalloc (sizeof (struct string_list));
|
||||
n->next = NULL;
|
||||
n->string = s;
|
||||
for (pp = &l; *pp != NULL; pp = &(*pp)->next)
|
||||
;
|
||||
*pp = n;
|
||||
return l;
|
||||
}
|
||||
|
||||
/* Duplicate a string in memory. */
|
||||
|
||||
static char *
|
||||
xstrdup (s)
|
||||
const char *s;
|
||||
{
|
||||
unsigned long len;
|
||||
char *ret;
|
||||
|
||||
len = strlen (s);
|
||||
ret = xmalloc (len + 1);
|
||||
strcpy (ret, s);
|
||||
return ret;
|
||||
}
|
||||
1600
binutils/nm.c
1600
binutils/nm.c
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
/* Linked with ar.o to flag that this program is 'ar' (not 'ranlib'). */
|
||||
|
||||
int is_ranlib = 0;
|
||||
@@ -1,4 +0,0 @@
|
||||
/* Linked with objcopy.o to flag that this program is 'objcopy' (not
|
||||
'strip'). */
|
||||
|
||||
int is_strip = 0;
|
||||
2510
binutils/objcopy.c
2510
binutils/objcopy.c
File diff suppressed because it is too large
Load Diff
3013
binutils/objdump.c
3013
binutils/objdump.c
File diff suppressed because it is too large
Load Diff
@@ -1,251 +0,0 @@
|
||||
# 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 = @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) @MAINT@ $(PACKAGE).pot
|
||||
all-no:
|
||||
|
||||
$(srcdir)/$(PACKAGE).pot: $(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-info:
|
||||
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:
|
||||
@@ -1,53 +0,0 @@
|
||||
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
|
||||
dllwrap.c
|
||||
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
|
||||
readelf.c
|
||||
rename.c
|
||||
resbin.c
|
||||
rescoff.c
|
||||
resrc.c
|
||||
resres.c
|
||||
size.c
|
||||
srconv.c
|
||||
stabs.c
|
||||
stabs.c
|
||||
strings.c
|
||||
sysdump.c
|
||||
version.c
|
||||
windres.c
|
||||
windres.h
|
||||
winduni.c
|
||||
winduni.h
|
||||
wrstabs.c
|
||||
File diff suppressed because it is too large
Load Diff
1862
binutils/prdbg.c
1862
binutils/prdbg.c
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
# A simple ranlib script, to use less disk space than a ranlib program.
|
||||
ar s $1
|
||||
496
binutils/rclex.l
496
binutils/rclex.l
@@ -1,496 +0,0 @@
|
||||
%{ /* rclex.l -- lexer for Windows rc files parser */
|
||||
/* Copyright 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Cygnus Support.
|
||||
|
||||
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 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. */
|
||||
|
||||
/* This is a lex input file which generates a lexer used by the
|
||||
Windows rc file parser. It basically just recognized a bunch of
|
||||
keywords. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
#include "libiberty.h"
|
||||
#include "windres.h"
|
||||
#include "rcparse.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
|
||||
/* Whether we are in rcdata mode, in which we returns the lengths of
|
||||
strings. */
|
||||
|
||||
static int rcdata_mode;
|
||||
|
||||
/* Whether we are supressing lines from cpp (including windows.h or
|
||||
headers from your C sources may bring in externs and typedefs).
|
||||
When active, we return IGNORED_TOKEN, which lets us ignore these
|
||||
outside of resource constructs. Thus, it isn't required to protect
|
||||
all the non-preprocessor lines in your header files with #ifdef
|
||||
RC_INVOKED. It also means your RC file can't include other RC
|
||||
files if they're named "*.h". Sorry. Name them *.rch or whatever. */
|
||||
|
||||
static int suppress_cpp_data;
|
||||
|
||||
#define MAYBE_RETURN(x) return suppress_cpp_data ? IGNORED_TOKEN : (x)
|
||||
|
||||
/* The first filename we detect in the cpp output. We use this to
|
||||
tell included files from the original file. */
|
||||
|
||||
static char *initial_fn;
|
||||
|
||||
/* List of allocated strings. */
|
||||
|
||||
struct alloc_string
|
||||
{
|
||||
struct alloc_string *next;
|
||||
char *s;
|
||||
};
|
||||
|
||||
static struct alloc_string *strings;
|
||||
|
||||
/* Local functions. */
|
||||
|
||||
static void cpp_line PARAMS ((const char *));
|
||||
static char *handle_quotes PARAMS ((const char *, unsigned long *));
|
||||
static char *get_string PARAMS ((int));
|
||||
|
||||
%}
|
||||
|
||||
%%
|
||||
|
||||
"BEGIN" { MAYBE_RETURN (BEG); }
|
||||
"{" { MAYBE_RETURN (BEG); }
|
||||
"END" { MAYBE_RETURN (END); }
|
||||
"}" { MAYBE_RETURN (END); }
|
||||
"ACCELERATORS" { MAYBE_RETURN (ACCELERATORS); }
|
||||
"VIRTKEY" { MAYBE_RETURN (VIRTKEY); }
|
||||
"ASCII" { MAYBE_RETURN (ASCII); }
|
||||
"NOINVERT" { MAYBE_RETURN (NOINVERT); }
|
||||
"SHIFT" { MAYBE_RETURN (SHIFT); }
|
||||
"CONTROL" { MAYBE_RETURN (CONTROL); }
|
||||
"ALT" { MAYBE_RETURN (ALT); }
|
||||
"BITMAP" { MAYBE_RETURN (BITMAP); }
|
||||
"CURSOR" { MAYBE_RETURN (CURSOR); }
|
||||
"DIALOG" { MAYBE_RETURN (DIALOG); }
|
||||
"DIALOGEX" { MAYBE_RETURN (DIALOGEX); }
|
||||
"EXSTYLE" { MAYBE_RETURN (EXSTYLE); }
|
||||
"CAPTION" { MAYBE_RETURN (CAPTION); }
|
||||
"CLASS" { MAYBE_RETURN (CLASS); }
|
||||
"STYLE" { MAYBE_RETURN (STYLE); }
|
||||
"AUTO3STATE" { MAYBE_RETURN (AUTO3STATE); }
|
||||
"AUTOCHECKBOX" { MAYBE_RETURN (AUTOCHECKBOX); }
|
||||
"AUTORADIOBUTTON" { MAYBE_RETURN (AUTORADIOBUTTON); }
|
||||
"CHECKBOX" { MAYBE_RETURN (CHECKBOX); }
|
||||
"COMBOBOX" { MAYBE_RETURN (COMBOBOX); }
|
||||
"CTEXT" { MAYBE_RETURN (CTEXT); }
|
||||
"DEFPUSHBUTTON" { MAYBE_RETURN (DEFPUSHBUTTON); }
|
||||
"EDITTEXT" { MAYBE_RETURN (EDITTEXT); }
|
||||
"GROUPBOX" { MAYBE_RETURN (GROUPBOX); }
|
||||
"LISTBOX" { MAYBE_RETURN (LISTBOX); }
|
||||
"LTEXT" { MAYBE_RETURN (LTEXT); }
|
||||
"PUSHBOX" { MAYBE_RETURN (PUSHBOX); }
|
||||
"PUSHBUTTON" { MAYBE_RETURN (PUSHBUTTON); }
|
||||
"RADIOBUTTON" { MAYBE_RETURN (RADIOBUTTON); }
|
||||
"RTEXT" { MAYBE_RETURN (RTEXT); }
|
||||
"SCROLLBAR" { MAYBE_RETURN (SCROLLBAR); }
|
||||
"STATE3" { MAYBE_RETURN (STATE3); }
|
||||
"USERBUTTON" { MAYBE_RETURN (USERBUTTON); }
|
||||
"BEDIT" { MAYBE_RETURN (BEDIT); }
|
||||
"HEDIT" { MAYBE_RETURN (HEDIT); }
|
||||
"IEDIT" { MAYBE_RETURN (IEDIT); }
|
||||
"FONT" { MAYBE_RETURN (FONT); }
|
||||
"ICON" { MAYBE_RETURN (ICON); }
|
||||
"LANGUAGE" { MAYBE_RETURN (LANGUAGE); }
|
||||
"CHARACTERISTICS" { MAYBE_RETURN (CHARACTERISTICS); }
|
||||
"VERSION" { MAYBE_RETURN (VERSIONK); }
|
||||
"MENU" { MAYBE_RETURN (MENU); }
|
||||
"MENUEX" { MAYBE_RETURN (MENUEX); }
|
||||
"MENUITEM" { MAYBE_RETURN (MENUITEM); }
|
||||
"SEPARATOR" { MAYBE_RETURN (SEPARATOR); }
|
||||
"POPUP" { MAYBE_RETURN (POPUP); }
|
||||
"CHECKED" { MAYBE_RETURN (CHECKED); }
|
||||
"GRAYED" { MAYBE_RETURN (GRAYED); }
|
||||
"HELP" { MAYBE_RETURN (HELP); }
|
||||
"INACTIVE" { MAYBE_RETURN (INACTIVE); }
|
||||
"MENUBARBREAK" { MAYBE_RETURN (MENUBARBREAK); }
|
||||
"MENUBREAK" { MAYBE_RETURN (MENUBREAK); }
|
||||
"MESSAGETABLE" { MAYBE_RETURN (MESSAGETABLE); }
|
||||
"RCDATA" { MAYBE_RETURN (RCDATA); }
|
||||
"STRINGTABLE" { MAYBE_RETURN (STRINGTABLE); }
|
||||
"VERSIONINFO" { MAYBE_RETURN (VERSIONINFO); }
|
||||
"FILEVERSION" { MAYBE_RETURN (FILEVERSION); }
|
||||
"PRODUCTVERSION" { MAYBE_RETURN (PRODUCTVERSION); }
|
||||
"FILEFLAGSMASK" { MAYBE_RETURN (FILEFLAGSMASK); }
|
||||
"FILEFLAGS" { MAYBE_RETURN (FILEFLAGS); }
|
||||
"FILEOS" { MAYBE_RETURN (FILEOS); }
|
||||
"FILETYPE" { MAYBE_RETURN (FILETYPE); }
|
||||
"FILESUBTYPE" { MAYBE_RETURN (FILESUBTYPE); }
|
||||
"VALUE" { MAYBE_RETURN (VALUE); }
|
||||
"MOVEABLE" { MAYBE_RETURN (MOVEABLE); }
|
||||
"FIXED" { MAYBE_RETURN (FIXED); }
|
||||
"PURE" { MAYBE_RETURN (PURE); }
|
||||
"IMPURE" { MAYBE_RETURN (IMPURE); }
|
||||
"PRELOAD" { MAYBE_RETURN (PRELOAD); }
|
||||
"LOADONCALL" { MAYBE_RETURN (LOADONCALL); }
|
||||
"DISCARDABLE" { MAYBE_RETURN (DISCARDABLE); }
|
||||
"NOT" { MAYBE_RETURN (NOT); }
|
||||
|
||||
"BLOCK"[ \t\n]*"\""[^\#\n]*"\"" {
|
||||
char *s, *send;
|
||||
|
||||
/* This is a hack to let us parse version
|
||||
information easily. */
|
||||
|
||||
s = strchr (yytext, '"');
|
||||
++s;
|
||||
send = strchr (s, '"');
|
||||
if (strncmp (s, "StringFileInfo",
|
||||
sizeof "StringFileInfo" - 1) == 0
|
||||
&& s + sizeof "StringFileInfo" - 1 == send)
|
||||
MAYBE_RETURN (BLOCKSTRINGFILEINFO);
|
||||
else if (strncmp (s, "VarFileInfo",
|
||||
sizeof "VarFileInfo" - 1) == 0
|
||||
&& s + sizeof "VarFileInfo" - 1 == send)
|
||||
MAYBE_RETURN (BLOCKVARFILEINFO);
|
||||
else
|
||||
{
|
||||
char *r;
|
||||
|
||||
r = get_string (send - s + 1);
|
||||
strncpy (r, s, send - s);
|
||||
r[send - s] = '\0';
|
||||
yylval.s = r;
|
||||
MAYBE_RETURN (BLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
"#"[^\n]* {
|
||||
cpp_line (yytext);
|
||||
}
|
||||
|
||||
[0-9][x0-9A-Fa-f]*L {
|
||||
yylval.i.val = strtoul (yytext, 0, 0);
|
||||
yylval.i.dword = 1;
|
||||
MAYBE_RETURN (NUMBER);
|
||||
}
|
||||
|
||||
[0-9][x0-9A-Fa-f]* {
|
||||
yylval.i.val = strtoul (yytext, 0, 0);
|
||||
yylval.i.dword = 0;
|
||||
MAYBE_RETURN (NUMBER);
|
||||
}
|
||||
|
||||
("\""[^\"\n]*"\""[ \t]*)+ {
|
||||
char *s;
|
||||
unsigned long length;
|
||||
|
||||
s = handle_quotes (yytext, &length);
|
||||
if (! rcdata_mode)
|
||||
{
|
||||
yylval.s = s;
|
||||
MAYBE_RETURN (QUOTEDSTRING);
|
||||
}
|
||||
else
|
||||
{
|
||||
yylval.ss.length = length;
|
||||
yylval.ss.s = s;
|
||||
MAYBE_RETURN (SIZEDSTRING);
|
||||
}
|
||||
}
|
||||
|
||||
[A-Za-z][^ ,\t\r\n]* {
|
||||
char *s;
|
||||
|
||||
/* I rejected comma in a string in order to
|
||||
handle VIRTKEY, CONTROL in an accelerator
|
||||
resource. This means that an unquoted
|
||||
file name can not contain a comma. I
|
||||
don't know what rc permits. */
|
||||
|
||||
s = get_string (strlen (yytext) + 1);
|
||||
strcpy (s, yytext);
|
||||
yylval.s = s;
|
||||
MAYBE_RETURN (STRING);
|
||||
}
|
||||
|
||||
[\n] { ++rc_lineno; }
|
||||
[ \t\r]+ { /* ignore whitespace */ }
|
||||
. { MAYBE_RETURN (*yytext); }
|
||||
|
||||
%%
|
||||
#ifndef yywrap
|
||||
/* This is needed for some versions of lex. */
|
||||
int yywrap ()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Handle a C preprocessor line. */
|
||||
|
||||
static void
|
||||
cpp_line (s)
|
||||
const char *s;
|
||||
{
|
||||
int line;
|
||||
char *send, *fn;
|
||||
|
||||
++s;
|
||||
while (isspace ((unsigned char) *s))
|
||||
++s;
|
||||
|
||||
line = strtol (s, &send, 0);
|
||||
if (*send != '\0' && ! isspace ((unsigned char) *send))
|
||||
return;
|
||||
|
||||
/* Subtract 1 because we are about to count the newline. */
|
||||
rc_lineno = line - 1;
|
||||
|
||||
s = send;
|
||||
while (isspace ((unsigned char) *s))
|
||||
++s;
|
||||
|
||||
if (*s != '"')
|
||||
return;
|
||||
|
||||
++s;
|
||||
send = strchr (s, '"');
|
||||
if (send == NULL)
|
||||
return;
|
||||
|
||||
fn = (char *) xmalloc (send - s + 1);
|
||||
strncpy (fn, s, send - s);
|
||||
fn[send - s] = '\0';
|
||||
|
||||
free (rc_filename);
|
||||
rc_filename = fn;
|
||||
|
||||
if (!initial_fn)
|
||||
{
|
||||
initial_fn = xmalloc (strlen (fn) + 1);
|
||||
strcpy(initial_fn, fn);
|
||||
}
|
||||
|
||||
/* Allow the initial file, regardless of name. Suppress all other
|
||||
files if they end in ".h" (this allows included "*.rc") */
|
||||
if (strcmp (initial_fn, fn) == 0
|
||||
|| strcmp (fn + strlen (fn) - 2, ".h") != 0)
|
||||
suppress_cpp_data = 0;
|
||||
else
|
||||
suppress_cpp_data = 1;
|
||||
}
|
||||
|
||||
/* Handle a quoted string. The quotes are stripped. A pair of quotes
|
||||
in a string are turned into a single quote. Adjacent strings are
|
||||
merged separated by whitespace are merged, as in C. */
|
||||
|
||||
static char *
|
||||
handle_quotes (input, len)
|
||||
const char *input;
|
||||
unsigned long *len;
|
||||
{
|
||||
char *ret, *s;
|
||||
const char *t;
|
||||
int ch;
|
||||
|
||||
ret = get_string (strlen (input) + 1);
|
||||
|
||||
s = ret;
|
||||
t = input;
|
||||
if (*t == '"')
|
||||
++t;
|
||||
while (*t != '\0')
|
||||
{
|
||||
if (*t == '\\')
|
||||
{
|
||||
++t;
|
||||
switch (*t)
|
||||
{
|
||||
case '\0':
|
||||
rcparse_warning ("backslash at end of string");
|
||||
break;
|
||||
|
||||
case '\"':
|
||||
rcparse_warning ("use \"\" to put \" in a string");
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
*s++ = ESCAPE_A;
|
||||
++t;
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
*s++ = ESCAPE_B;
|
||||
++t;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
*s++ = ESCAPE_F;
|
||||
++t;
|
||||
break;
|
||||
|
||||
case 'n':
|
||||
*s++ = ESCAPE_N;
|
||||
++t;
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
*s++ = ESCAPE_R;
|
||||
++t;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
*s++ = ESCAPE_T;
|
||||
++t;
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
*s++ = ESCAPE_V;
|
||||
++t;
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
*s++ = *t++;
|
||||
break;
|
||||
|
||||
case '0': case '1': case '2': case '3':
|
||||
case '4': case '5': case '6': case '7':
|
||||
ch = *t - '0';
|
||||
++t;
|
||||
if (*t >= '0' && *t <= '7')
|
||||
{
|
||||
ch = (ch << 3) | (*t - '0');
|
||||
++t;
|
||||
if (*t >= '0' && *t <= '7')
|
||||
{
|
||||
ch = (ch << 3) | (*t - '0');
|
||||
++t;
|
||||
}
|
||||
}
|
||||
*s++ = ch;
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
++t;
|
||||
ch = 0;
|
||||
while (1)
|
||||
{
|
||||
if (*t >= '0' && *t <= '9')
|
||||
ch = (ch << 4) | (*t - '0');
|
||||
else if (*t >= 'a' && *t <= 'f')
|
||||
ch = (ch << 4) | (*t - 'a');
|
||||
else if (*t >= 'A' && *t <= 'F')
|
||||
ch = (ch << 4) | (*t - 'A');
|
||||
else
|
||||
break;
|
||||
++t;
|
||||
}
|
||||
*s++ = ch;
|
||||
break;
|
||||
|
||||
default:
|
||||
rcparse_warning ("unrecognized escape sequence");
|
||||
*s++ = '\\';
|
||||
*s++ = *t++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (*t != '"')
|
||||
*s++ = *t++;
|
||||
else if (t[1] == '\0')
|
||||
break;
|
||||
else if (t[1] == '"')
|
||||
{
|
||||
*s++ = '"';
|
||||
t += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
++t;
|
||||
assert (isspace ((unsigned char) *t));
|
||||
while (isspace ((unsigned char) *t))
|
||||
++t;
|
||||
if (*t == '\0')
|
||||
break;
|
||||
assert (*t == '"');
|
||||
++t;
|
||||
}
|
||||
}
|
||||
|
||||
*s = '\0';
|
||||
|
||||
*len = s - ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Allocate a string of a given length. */
|
||||
|
||||
static char *
|
||||
get_string (len)
|
||||
int len;
|
||||
{
|
||||
struct alloc_string *as;
|
||||
|
||||
as = (struct alloc_string *) xmalloc (sizeof *as);
|
||||
as->s = xmalloc (len);
|
||||
|
||||
as->next = strings;
|
||||
strings = as->next;
|
||||
|
||||
return as->s;
|
||||
}
|
||||
|
||||
/* Discard all the strings we have allocated. The parser calls this
|
||||
when it no longer needs them. */
|
||||
|
||||
void
|
||||
rcparse_discard_strings ()
|
||||
{
|
||||
struct alloc_string *as;
|
||||
|
||||
as = strings;
|
||||
while (as != NULL)
|
||||
{
|
||||
struct alloc_string *n;
|
||||
|
||||
free (as->s);
|
||||
n = as->next;
|
||||
free (as);
|
||||
as = n;
|
||||
}
|
||||
|
||||
strings = NULL;
|
||||
}
|
||||
|
||||
/* Enter rcdata mode. */
|
||||
|
||||
void
|
||||
rcparse_rcdata ()
|
||||
{
|
||||
rcdata_mode = 1;
|
||||
}
|
||||
|
||||
/* Go back to normal mode from rcdata mode. */
|
||||
|
||||
void
|
||||
rcparse_normal ()
|
||||
{
|
||||
rcdata_mode = 0;
|
||||
}
|
||||
1651
binutils/rcparse.y
1651
binutils/rcparse.y
File diff suppressed because it is too large
Load Diff
@@ -1,907 +0,0 @@
|
||||
/* stabs.c -- Parse COFF debugging information
|
||||
Copyright 1996, 2000 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor <ian@cygnus.com>.
|
||||
|
||||
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 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. */
|
||||
|
||||
/* This file contains code which parses COFF debugging information. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "coff/internal.h"
|
||||
#include "bucomm.h"
|
||||
#include "libiberty.h"
|
||||
#include "demangle.h"
|
||||
#include "debug.h"
|
||||
#include "budbg.h"
|
||||
|
||||
/* FIXME: We should not need this BFD internal file. We need it for
|
||||
the N_BTMASK, etc., values. */
|
||||
#include "libcoff.h"
|
||||
|
||||
/* These macros extract the right mask and shifts for this BFD. They
|
||||
assume that there is a local variable named ABFD. This is so that
|
||||
macros like ISFCN and DECREF, from coff/internal.h, will work
|
||||
without modification. */
|
||||
#define N_BTMASK (coff_data (abfd)->local_n_btmask)
|
||||
#define N_BTSHFT (coff_data (abfd)->local_n_btshft)
|
||||
#define N_TMASK (coff_data (abfd)->local_n_tmask)
|
||||
#define N_TSHIFT (coff_data (abfd)->local_n_tshift)
|
||||
|
||||
/* This structure is used to hold the symbols, as well as the current
|
||||
location within the symbols. */
|
||||
|
||||
struct coff_symbols
|
||||
{
|
||||
/* The symbols. */
|
||||
asymbol **syms;
|
||||
/* The number of symbols. */
|
||||
long symcount;
|
||||
/* The index of the current symbol. */
|
||||
long symno;
|
||||
/* The index of the current symbol in the COFF symbol table (where
|
||||
each auxent counts as a symbol). */
|
||||
long coff_symno;
|
||||
};
|
||||
|
||||
/* The largest basic type we are prepared to handle. */
|
||||
|
||||
#define T_MAX (T_LNGDBL)
|
||||
|
||||
/* This structure is used to hold slots. */
|
||||
|
||||
struct coff_slots
|
||||
{
|
||||
/* Next set of slots. */
|
||||
struct coff_slots *next;
|
||||
/* Slots. */
|
||||
#define COFF_SLOTS (16)
|
||||
debug_type slots[COFF_SLOTS];
|
||||
};
|
||||
|
||||
/* This structure is used to map symbol indices to types. */
|
||||
|
||||
struct coff_types
|
||||
{
|
||||
/* Slots. */
|
||||
struct coff_slots *slots;
|
||||
/* Basic types. */
|
||||
debug_type basic[T_MAX + 1];
|
||||
};
|
||||
|
||||
static debug_type *coff_get_slot PARAMS ((struct coff_types *, int));
|
||||
static debug_type parse_coff_type
|
||||
PARAMS ((bfd *, struct coff_symbols *, struct coff_types *, long, int,
|
||||
union internal_auxent *, boolean, PTR));
|
||||
static debug_type parse_coff_base_type
|
||||
PARAMS ((bfd *, struct coff_symbols *, struct coff_types *, long, int,
|
||||
union internal_auxent *, PTR));
|
||||
static debug_type parse_coff_struct_type
|
||||
PARAMS ((bfd *, struct coff_symbols *, struct coff_types *, int,
|
||||
union internal_auxent *, PTR));
|
||||
static debug_type parse_coff_enum_type
|
||||
PARAMS ((bfd *, struct coff_symbols *, struct coff_types *,
|
||||
union internal_auxent *, PTR));
|
||||
static boolean parse_coff_symbol
|
||||
PARAMS ((bfd *, struct coff_types *, asymbol *, long,
|
||||
struct internal_syment *, PTR, debug_type, boolean));
|
||||
static boolean external_coff_symbol_p PARAMS ((int sym_class));
|
||||
|
||||
/* Return the slot for a type. */
|
||||
|
||||
static debug_type *
|
||||
coff_get_slot (types, indx)
|
||||
struct coff_types *types;
|
||||
int indx;
|
||||
{
|
||||
struct coff_slots **pps;
|
||||
|
||||
pps = &types->slots;
|
||||
|
||||
while (indx >= COFF_SLOTS)
|
||||
{
|
||||
if (*pps == NULL)
|
||||
{
|
||||
*pps = (struct coff_slots *) xmalloc (sizeof **pps);
|
||||
memset (*pps, 0, sizeof **pps);
|
||||
}
|
||||
pps = &(*pps)->next;
|
||||
indx -= COFF_SLOTS;
|
||||
}
|
||||
|
||||
if (*pps == NULL)
|
||||
{
|
||||
*pps = (struct coff_slots *) xmalloc (sizeof **pps);
|
||||
memset (*pps, 0, sizeof **pps);
|
||||
}
|
||||
|
||||
return (*pps)->slots + indx;
|
||||
}
|
||||
|
||||
/* Parse a COFF type code in NTYPE. */
|
||||
|
||||
static debug_type
|
||||
parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux,
|
||||
dhandle)
|
||||
bfd *abfd;
|
||||
struct coff_symbols *symbols;
|
||||
struct coff_types *types;
|
||||
long coff_symno;
|
||||
int ntype;
|
||||
union internal_auxent *pauxent;
|
||||
boolean useaux;
|
||||
PTR dhandle;
|
||||
{
|
||||
debug_type type;
|
||||
|
||||
if ((ntype & ~N_BTMASK) != 0)
|
||||
{
|
||||
int newtype;
|
||||
|
||||
newtype = DECREF (ntype);
|
||||
|
||||
if (ISPTR (ntype))
|
||||
{
|
||||
type = parse_coff_type (abfd, symbols, types, coff_symno, newtype,
|
||||
pauxent, useaux, dhandle);
|
||||
type = debug_make_pointer_type (dhandle, type);
|
||||
}
|
||||
else if (ISFCN (ntype))
|
||||
{
|
||||
type = parse_coff_type (abfd, symbols, types, coff_symno, newtype,
|
||||
pauxent, useaux, dhandle);
|
||||
type = debug_make_function_type (dhandle, type, (debug_type *) NULL,
|
||||
false);
|
||||
}
|
||||
else if (ISARY (ntype))
|
||||
{
|
||||
int n;
|
||||
|
||||
if (pauxent == NULL)
|
||||
n = 0;
|
||||
else
|
||||
{
|
||||
unsigned short *dim;
|
||||
int i;
|
||||
|
||||
/* FIXME: If pauxent->x_sym.x_tagndx.l == 0, gdb sets
|
||||
the c_naux field of the syment to 0. */
|
||||
|
||||
/* Move the dimensions down, so that the next array
|
||||
picks up the next one. */
|
||||
dim = pauxent->x_sym.x_fcnary.x_ary.x_dimen;
|
||||
n = dim[0];
|
||||
for (i = 0; *dim != 0 && i < DIMNUM - 1; i++, dim++)
|
||||
*dim = *(dim + 1);
|
||||
*dim = 0;
|
||||
}
|
||||
|
||||
type = parse_coff_type (abfd, symbols, types, coff_symno, newtype,
|
||||
pauxent, false, dhandle);
|
||||
type = debug_make_array_type (dhandle, type,
|
||||
parse_coff_base_type (abfd, symbols,
|
||||
types,
|
||||
coff_symno,
|
||||
T_INT,
|
||||
NULL, dhandle),
|
||||
0, n - 1, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
non_fatal (_("parse_coff_type: Bad type code 0x%x"), ntype);
|
||||
return DEBUG_TYPE_NULL;
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
if (pauxent != NULL && pauxent->x_sym.x_tagndx.l > 0)
|
||||
{
|
||||
debug_type *slot;
|
||||
|
||||
/* This is a reference to an existing type. FIXME: gdb checks
|
||||
that the class is not C_STRTAG, nor C_UNTAG, nor C_ENTAG. */
|
||||
slot = coff_get_slot (types, pauxent->x_sym.x_tagndx.l);
|
||||
if (*slot != DEBUG_TYPE_NULL)
|
||||
return *slot;
|
||||
else
|
||||
return debug_make_indirect_type (dhandle, slot, (const char *) NULL);
|
||||
}
|
||||
|
||||
/* If the aux entry has already been used for something, useaux will
|
||||
have been set to false, indicating that parse_coff_base_type
|
||||
should not use it. We need to do it this way, rather than simply
|
||||
passing pauxent as NULL, because we need to be able handle
|
||||
multiple array dimensions while still discarding pauxent after
|
||||
having handled all of them. */
|
||||
if (! useaux)
|
||||
pauxent = NULL;
|
||||
|
||||
return parse_coff_base_type (abfd, symbols, types, coff_symno, ntype,
|
||||
pauxent, dhandle);
|
||||
}
|
||||
|
||||
/* Parse a basic COFF type in NTYPE. */
|
||||
|
||||
static debug_type
|
||||
parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent,
|
||||
dhandle)
|
||||
bfd *abfd;
|
||||
struct coff_symbols *symbols;
|
||||
struct coff_types *types;
|
||||
long coff_symno;
|
||||
int ntype;
|
||||
union internal_auxent *pauxent;
|
||||
PTR dhandle;
|
||||
{
|
||||
debug_type ret;
|
||||
boolean set_basic;
|
||||
const char *name;
|
||||
debug_type *slot;
|
||||
|
||||
if (ntype >= 0
|
||||
&& ntype <= T_MAX
|
||||
&& types->basic[ntype] != DEBUG_TYPE_NULL)
|
||||
return types->basic[ntype];
|
||||
|
||||
set_basic = true;
|
||||
name = NULL;
|
||||
|
||||
switch (ntype)
|
||||
{
|
||||
default:
|
||||
ret = debug_make_void_type (dhandle);
|
||||
break;
|
||||
|
||||
case T_NULL:
|
||||
case T_VOID:
|
||||
ret = debug_make_void_type (dhandle);
|
||||
name = "void";
|
||||
break;
|
||||
|
||||
case T_CHAR:
|
||||
ret = debug_make_int_type (dhandle, 1, false);
|
||||
name = "char";
|
||||
break;
|
||||
|
||||
case T_SHORT:
|
||||
ret = debug_make_int_type (dhandle, 2, false);
|
||||
name = "short";
|
||||
break;
|
||||
|
||||
case T_INT:
|
||||
/* FIXME: Perhaps the size should depend upon the architecture. */
|
||||
ret = debug_make_int_type (dhandle, 4, false);
|
||||
name = "int";
|
||||
break;
|
||||
|
||||
case T_LONG:
|
||||
ret = debug_make_int_type (dhandle, 4, false);
|
||||
name = "long";
|
||||
break;
|
||||
|
||||
case T_FLOAT:
|
||||
ret = debug_make_float_type (dhandle, 4);
|
||||
name = "float";
|
||||
break;
|
||||
|
||||
case T_DOUBLE:
|
||||
ret = debug_make_float_type (dhandle, 8);
|
||||
name = "double";
|
||||
break;
|
||||
|
||||
case T_LNGDBL:
|
||||
ret = debug_make_float_type (dhandle, 12);
|
||||
name = "long double";
|
||||
break;
|
||||
|
||||
case T_UCHAR:
|
||||
ret = debug_make_int_type (dhandle, 1, true);
|
||||
name = "unsigned char";
|
||||
break;
|
||||
|
||||
case T_USHORT:
|
||||
ret = debug_make_int_type (dhandle, 2, true);
|
||||
name = "unsigned short";
|
||||
break;
|
||||
|
||||
case T_UINT:
|
||||
ret = debug_make_int_type (dhandle, 4, true);
|
||||
name = "unsigned int";
|
||||
break;
|
||||
|
||||
case T_ULONG:
|
||||
ret = debug_make_int_type (dhandle, 4, true);
|
||||
name = "unsigned long";
|
||||
break;
|
||||
|
||||
case T_STRUCT:
|
||||
if (pauxent == NULL)
|
||||
ret = debug_make_struct_type (dhandle, true, 0,
|
||||
(debug_field *) NULL);
|
||||
else
|
||||
ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent,
|
||||
dhandle);
|
||||
|
||||
slot = coff_get_slot (types, coff_symno);
|
||||
*slot = ret;
|
||||
|
||||
set_basic = false;
|
||||
break;
|
||||
|
||||
case T_UNION:
|
||||
if (pauxent == NULL)
|
||||
ret = debug_make_struct_type (dhandle, false, 0, (debug_field *) NULL);
|
||||
else
|
||||
ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent,
|
||||
dhandle);
|
||||
|
||||
slot = coff_get_slot (types, coff_symno);
|
||||
*slot = ret;
|
||||
|
||||
set_basic = false;
|
||||
break;
|
||||
|
||||
case T_ENUM:
|
||||
if (pauxent == NULL)
|
||||
ret = debug_make_enum_type (dhandle, (const char **) NULL,
|
||||
(bfd_signed_vma *) NULL);
|
||||
else
|
||||
ret = parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle);
|
||||
|
||||
slot = coff_get_slot (types, coff_symno);
|
||||
*slot = ret;
|
||||
|
||||
set_basic = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (name != NULL)
|
||||
ret = debug_name_type (dhandle, name, ret);
|
||||
|
||||
if (set_basic
|
||||
&& ntype >= 0
|
||||
&& ntype <= T_MAX)
|
||||
types->basic[ntype] = ret;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Parse a struct type. */
|
||||
|
||||
static debug_type
|
||||
parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle)
|
||||
bfd *abfd;
|
||||
struct coff_symbols *symbols;
|
||||
struct coff_types *types;
|
||||
int ntype;
|
||||
union internal_auxent *pauxent;
|
||||
PTR dhandle;
|
||||
{
|
||||
long symend;
|
||||
int alloc;
|
||||
debug_field *fields;
|
||||
int count;
|
||||
boolean done;
|
||||
|
||||
symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l;
|
||||
|
||||
alloc = 10;
|
||||
fields = (debug_field *) xmalloc (alloc * sizeof *fields);
|
||||
count = 0;
|
||||
|
||||
done = false;
|
||||
while (! done
|
||||
&& symbols->coff_symno < symend
|
||||
&& symbols->symno < symbols->symcount)
|
||||
{
|
||||
asymbol *sym;
|
||||
long this_coff_symno;
|
||||
struct internal_syment syment;
|
||||
union internal_auxent auxent;
|
||||
union internal_auxent *psubaux;
|
||||
bfd_vma bitpos = 0, bitsize = 0;
|
||||
|
||||
sym = symbols->syms[symbols->symno];
|
||||
|
||||
if (! bfd_coff_get_syment (abfd, sym, &syment))
|
||||
{
|
||||
non_fatal (_("bfd_coff_get_syment failed: %s"),
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
return DEBUG_TYPE_NULL;
|
||||
}
|
||||
|
||||
this_coff_symno = symbols->coff_symno;
|
||||
|
||||
++symbols->symno;
|
||||
symbols->coff_symno += 1 + syment.n_numaux;
|
||||
|
||||
if (syment.n_numaux == 0)
|
||||
psubaux = NULL;
|
||||
else
|
||||
{
|
||||
if (! bfd_coff_get_auxent (abfd, sym, 0, &auxent))
|
||||
{
|
||||
non_fatal (_("bfd_coff_get_auxent failed: %s"),
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
return DEBUG_TYPE_NULL;
|
||||
}
|
||||
psubaux = &auxent;
|
||||
}
|
||||
|
||||
switch (syment.n_sclass)
|
||||
{
|
||||
case C_MOS:
|
||||
case C_MOU:
|
||||
bitpos = 8 * bfd_asymbol_value (sym);
|
||||
bitsize = 0;
|
||||
break;
|
||||
|
||||
case C_FIELD:
|
||||
bitpos = bfd_asymbol_value (sym);
|
||||
bitsize = auxent.x_sym.x_misc.x_lnsz.x_size;
|
||||
break;
|
||||
|
||||
case C_EOS:
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (! done)
|
||||
{
|
||||
debug_type ftype;
|
||||
debug_field f;
|
||||
|
||||
ftype = parse_coff_type (abfd, symbols, types, this_coff_symno,
|
||||
syment.n_type, psubaux, true, dhandle);
|
||||
f = debug_make_field (dhandle, bfd_asymbol_name (sym), ftype,
|
||||
bitpos, bitsize, DEBUG_VISIBILITY_PUBLIC);
|
||||
if (f == DEBUG_FIELD_NULL)
|
||||
return DEBUG_TYPE_NULL;
|
||||
|
||||
if (count + 1 >= alloc)
|
||||
{
|
||||
alloc += 10;
|
||||
fields = ((debug_field *)
|
||||
xrealloc (fields, alloc * sizeof *fields));
|
||||
}
|
||||
|
||||
fields[count] = f;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
fields[count] = DEBUG_FIELD_NULL;
|
||||
|
||||
return debug_make_struct_type (dhandle, ntype == T_STRUCT,
|
||||
pauxent->x_sym.x_misc.x_lnsz.x_size,
|
||||
fields);
|
||||
}
|
||||
|
||||
/* Parse an enum type. */
|
||||
|
||||
static debug_type
|
||||
parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle)
|
||||
bfd *abfd;
|
||||
struct coff_symbols *symbols;
|
||||
struct coff_types *types ATTRIBUTE_UNUSED;
|
||||
union internal_auxent *pauxent;
|
||||
PTR dhandle;
|
||||
{
|
||||
long symend;
|
||||
int alloc;
|
||||
const char **names;
|
||||
bfd_signed_vma *vals;
|
||||
int count;
|
||||
boolean done;
|
||||
|
||||
symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l;
|
||||
|
||||
alloc = 10;
|
||||
names = (const char **) xmalloc (alloc * sizeof *names);
|
||||
vals = (bfd_signed_vma *) xmalloc (alloc * sizeof *vals);
|
||||
count = 0;
|
||||
|
||||
done = false;
|
||||
while (! done
|
||||
&& symbols->coff_symno < symend
|
||||
&& symbols->symno < symbols->symcount)
|
||||
{
|
||||
asymbol *sym;
|
||||
struct internal_syment syment;
|
||||
|
||||
sym = symbols->syms[symbols->symno];
|
||||
|
||||
if (! bfd_coff_get_syment (abfd, sym, &syment))
|
||||
{
|
||||
non_fatal (_("bfd_coff_get_syment failed: %s"),
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
return DEBUG_TYPE_NULL;
|
||||
}
|
||||
|
||||
++symbols->symno;
|
||||
symbols->coff_symno += 1 + syment.n_numaux;
|
||||
|
||||
switch (syment.n_sclass)
|
||||
{
|
||||
case C_MOE:
|
||||
if (count + 1 >= alloc)
|
||||
{
|
||||
alloc += 10;
|
||||
names = ((const char **)
|
||||
xrealloc (names, alloc * sizeof *names));
|
||||
vals = ((bfd_signed_vma *)
|
||||
xrealloc (vals, alloc * sizeof *vals));
|
||||
}
|
||||
|
||||
names[count] = bfd_asymbol_name (sym);
|
||||
vals[count] = bfd_asymbol_value (sym);
|
||||
++count;
|
||||
break;
|
||||
|
||||
case C_EOS:
|
||||
done = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
names[count] = NULL;
|
||||
|
||||
return debug_make_enum_type (dhandle, names, vals);
|
||||
}
|
||||
|
||||
/* Handle a single COFF symbol. */
|
||||
|
||||
static boolean
|
||||
parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type,
|
||||
within_function)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
struct coff_types *types;
|
||||
asymbol *sym;
|
||||
long coff_symno;
|
||||
struct internal_syment *psyment;
|
||||
PTR dhandle;
|
||||
debug_type type;
|
||||
boolean within_function;
|
||||
{
|
||||
switch (psyment->n_sclass)
|
||||
{
|
||||
case C_NULL:
|
||||
break;
|
||||
|
||||
case C_AUTO:
|
||||
if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
|
||||
DEBUG_LOCAL, bfd_asymbol_value (sym)))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case C_WEAKEXT:
|
||||
case C_EXT:
|
||||
if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
|
||||
DEBUG_GLOBAL, bfd_asymbol_value (sym)))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case C_STAT:
|
||||
if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
|
||||
(within_function
|
||||
? DEBUG_LOCAL_STATIC
|
||||
: DEBUG_STATIC),
|
||||
bfd_asymbol_value (sym)))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case C_REG:
|
||||
/* FIXME: We may need to convert the register number. */
|
||||
if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type,
|
||||
DEBUG_REGISTER, bfd_asymbol_value (sym)))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case C_LABEL:
|
||||
break;
|
||||
|
||||
case C_ARG:
|
||||
if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type,
|
||||
DEBUG_PARM_STACK, bfd_asymbol_value (sym)))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case C_REGPARM:
|
||||
/* FIXME: We may need to convert the register number. */
|
||||
if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type,
|
||||
DEBUG_PARM_REG, bfd_asymbol_value (sym)))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case C_TPDEF:
|
||||
type = debug_name_type (dhandle, bfd_asymbol_name (sym), type);
|
||||
if (type == DEBUG_TYPE_NULL)
|
||||
return false;
|
||||
break;
|
||||
|
||||
case C_STRTAG:
|
||||
case C_UNTAG:
|
||||
case C_ENTAG:
|
||||
{
|
||||
debug_type *slot;
|
||||
|
||||
type = debug_tag_type (dhandle, bfd_asymbol_name (sym), type);
|
||||
if (type == DEBUG_TYPE_NULL)
|
||||
return false;
|
||||
|
||||
/* Store the named type into the slot, so that references get
|
||||
the name. */
|
||||
slot = coff_get_slot (types, coff_symno);
|
||||
*slot = type;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Determine if a symbol has external visibility. */
|
||||
|
||||
static boolean
|
||||
external_coff_symbol_p (sym_class)
|
||||
int sym_class;
|
||||
{
|
||||
switch (sym_class)
|
||||
{
|
||||
case C_EXT:
|
||||
case C_WEAKEXT:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* This is the main routine. It looks through all the symbols and
|
||||
handles them. */
|
||||
|
||||
boolean
|
||||
parse_coff (abfd, syms, symcount, dhandle)
|
||||
bfd *abfd;
|
||||
asymbol **syms;
|
||||
long symcount;
|
||||
PTR dhandle;
|
||||
{
|
||||
struct coff_symbols symbols;
|
||||
struct coff_types types;
|
||||
int i;
|
||||
long next_c_file;
|
||||
const char *fnname;
|
||||
int fnclass;
|
||||
int fntype;
|
||||
bfd_vma fnend;
|
||||
alent *linenos;
|
||||
boolean within_function;
|
||||
long this_coff_symno;
|
||||
|
||||
symbols.syms = syms;
|
||||
symbols.symcount = symcount;
|
||||
symbols.symno = 0;
|
||||
symbols.coff_symno = 0;
|
||||
|
||||
types.slots = NULL;
|
||||
for (i = 0; i <= T_MAX; i++)
|
||||
types.basic[i] = DEBUG_TYPE_NULL;
|
||||
|
||||
next_c_file = -1;
|
||||
fnname = NULL;
|
||||
fnclass = 0;
|
||||
fntype = 0;
|
||||
fnend = 0;
|
||||
linenos = NULL;
|
||||
within_function = false;
|
||||
|
||||
while (symbols.symno < symcount)
|
||||
{
|
||||
asymbol *sym;
|
||||
const char *name;
|
||||
struct internal_syment syment;
|
||||
union internal_auxent auxent;
|
||||
union internal_auxent *paux;
|
||||
debug_type type;
|
||||
|
||||
sym = syms[symbols.symno];
|
||||
|
||||
if (! bfd_coff_get_syment (abfd, sym, &syment))
|
||||
{
|
||||
non_fatal (_("bfd_coff_get_syment failed: %s"),
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
return false;
|
||||
}
|
||||
|
||||
name = bfd_asymbol_name (sym);
|
||||
|
||||
this_coff_symno = symbols.coff_symno;
|
||||
|
||||
++symbols.symno;
|
||||
symbols.coff_symno += 1 + syment.n_numaux;
|
||||
|
||||
/* We only worry about the first auxent, because that is the
|
||||
only one which is relevant for debugging information. */
|
||||
if (syment.n_numaux == 0)
|
||||
paux = NULL;
|
||||
else
|
||||
{
|
||||
if (! bfd_coff_get_auxent (abfd, sym, 0, &auxent))
|
||||
{
|
||||
non_fatal (_("bfd_coff_get_auxent failed: %s"),
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
return false;
|
||||
}
|
||||
paux = &auxent;
|
||||
}
|
||||
|
||||
if (this_coff_symno == next_c_file && syment.n_sclass != C_FILE)
|
||||
{
|
||||
/* The last C_FILE symbol points to the first external
|
||||
symbol. */
|
||||
if (! debug_set_filename (dhandle, "*globals*"))
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (syment.n_sclass)
|
||||
{
|
||||
case C_EFCN:
|
||||
case C_EXTDEF:
|
||||
case C_ULABEL:
|
||||
case C_USTATIC:
|
||||
case C_LINE:
|
||||
case C_ALIAS:
|
||||
case C_HIDDEN:
|
||||
/* Just ignore these classes. */
|
||||
break;
|
||||
|
||||
case C_FILE:
|
||||
next_c_file = syment.n_value;
|
||||
if (! debug_set_filename (dhandle, name))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case C_STAT:
|
||||
/* Ignore static symbols with a type of T_NULL. These
|
||||
represent section entries. */
|
||||
if (syment.n_type == T_NULL)
|
||||
break;
|
||||
/* Fall through. */
|
||||
case C_WEAKEXT:
|
||||
case C_EXT:
|
||||
if (ISFCN (syment.n_type))
|
||||
{
|
||||
fnname = name;
|
||||
fnclass = syment.n_sclass;
|
||||
fntype = syment.n_type;
|
||||
if (syment.n_numaux > 0)
|
||||
fnend = bfd_asymbol_value (sym) + auxent.x_sym.x_misc.x_fsize;
|
||||
else
|
||||
fnend = 0;
|
||||
linenos = BFD_SEND (abfd, _get_lineno, (abfd, sym));
|
||||
break;
|
||||
}
|
||||
type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
|
||||
syment.n_type, paux, true, dhandle);
|
||||
if (type == DEBUG_TYPE_NULL)
|
||||
return false;
|
||||
if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment,
|
||||
dhandle, type, within_function))
|
||||
return false;
|
||||
break;
|
||||
|
||||
case C_FCN:
|
||||
if (strcmp (name, ".bf") == 0)
|
||||
{
|
||||
if (fnname == NULL)
|
||||
{
|
||||
non_fatal (_("%ld: .bf without preceding function"),
|
||||
this_coff_symno);
|
||||
return false;
|
||||
}
|
||||
|
||||
type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
|
||||
DECREF (fntype), paux, false, dhandle);
|
||||
if (type == DEBUG_TYPE_NULL)
|
||||
return false;
|
||||
|
||||
if (! debug_record_function (dhandle, fnname, type,
|
||||
external_coff_symbol_p (fnclass),
|
||||
bfd_asymbol_value (sym)))
|
||||
return false;
|
||||
|
||||
if (linenos != NULL)
|
||||
{
|
||||
int base;
|
||||
bfd_vma addr;
|
||||
|
||||
if (syment.n_numaux == 0)
|
||||
base = 0;
|
||||
else
|
||||
base = auxent.x_sym.x_misc.x_lnsz.x_lnno - 1;
|
||||
|
||||
addr = bfd_get_section_vma (abfd, bfd_get_section (sym));
|
||||
|
||||
++linenos;
|
||||
|
||||
while (linenos->line_number != 0)
|
||||
{
|
||||
if (! debug_record_line (dhandle,
|
||||
linenos->line_number + base,
|
||||
linenos->u.offset + addr))
|
||||
return false;
|
||||
++linenos;
|
||||
}
|
||||
}
|
||||
|
||||
fnname = NULL;
|
||||
linenos = NULL;
|
||||
fnclass = 0;
|
||||
fntype = 0;
|
||||
|
||||
within_function = true;
|
||||
}
|
||||
else if (strcmp (name, ".ef") == 0)
|
||||
{
|
||||
if (! within_function)
|
||||
{
|
||||
non_fatal (_("%ld: unexpected .ef\n"), this_coff_symno);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (bfd_asymbol_value (sym) > fnend)
|
||||
fnend = bfd_asymbol_value (sym);
|
||||
if (! debug_end_function (dhandle, fnend))
|
||||
return false;
|
||||
|
||||
fnend = 0;
|
||||
within_function = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case C_BLOCK:
|
||||
if (strcmp (name, ".bb") == 0)
|
||||
{
|
||||
if (! debug_start_block (dhandle, bfd_asymbol_value (sym)))
|
||||
return false;
|
||||
}
|
||||
else if (strcmp (name, ".eb") == 0)
|
||||
{
|
||||
if (! debug_end_block (dhandle, bfd_asymbol_value (sym)))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
type = parse_coff_type (abfd, &symbols, &types, this_coff_symno,
|
||||
syment.n_type, paux, true, dhandle);
|
||||
if (type == DEBUG_TYPE_NULL)
|
||||
return false;
|
||||
if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment,
|
||||
dhandle, type, within_function))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
458
binutils/rddbg.c
458
binutils/rddbg.c
@@ -1,458 +0,0 @@
|
||||
/* rddbg.c -- Read debugging information into a generic form.
|
||||
Copyright 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor <ian@cygnus.com>.
|
||||
|
||||
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 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. */
|
||||
|
||||
/* This file reads debugging information into a generic form. This
|
||||
file knows how to dig the debugging information out of an object
|
||||
file. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
#include "libiberty.h"
|
||||
#include "debug.h"
|
||||
#include "budbg.h"
|
||||
|
||||
static boolean read_section_stabs_debugging_info
|
||||
PARAMS ((bfd *, asymbol **, long, PTR, boolean *));
|
||||
static boolean read_symbol_stabs_debugging_info
|
||||
PARAMS ((bfd *, asymbol **, long, PTR, boolean *));
|
||||
static boolean read_ieee_debugging_info PARAMS ((bfd *, PTR, boolean *));
|
||||
static void save_stab PARAMS ((int, int, bfd_vma, const char *));
|
||||
static void stab_context PARAMS ((void));
|
||||
static void free_saved_stabs PARAMS ((void));
|
||||
|
||||
/* Read debugging information from a BFD. Returns a generic debugging
|
||||
pointer. */
|
||||
|
||||
PTR
|
||||
read_debugging_info (abfd, syms, symcount)
|
||||
bfd *abfd;
|
||||
asymbol **syms;
|
||||
long symcount;
|
||||
{
|
||||
PTR dhandle;
|
||||
boolean found;
|
||||
|
||||
dhandle = debug_init ();
|
||||
if (dhandle == NULL)
|
||||
return NULL;
|
||||
|
||||
if (! read_section_stabs_debugging_info (abfd, syms, symcount, dhandle,
|
||||
&found))
|
||||
return NULL;
|
||||
|
||||
if (bfd_get_flavour (abfd) == bfd_target_aout_flavour)
|
||||
{
|
||||
if (! read_symbol_stabs_debugging_info (abfd, syms, symcount, dhandle,
|
||||
&found))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (bfd_get_flavour (abfd) == bfd_target_ieee_flavour)
|
||||
{
|
||||
if (! read_ieee_debugging_info (abfd, dhandle, &found))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Try reading the COFF symbols if we didn't find any stabs in COFF
|
||||
sections. */
|
||||
if (! found
|
||||
&& bfd_get_flavour (abfd) == bfd_target_coff_flavour
|
||||
&& symcount > 0)
|
||||
{
|
||||
if (! parse_coff (abfd, syms, symcount, dhandle))
|
||||
return NULL;
|
||||
found = true;
|
||||
}
|
||||
|
||||
if (! found)
|
||||
{
|
||||
non_fatal (_("%s: no recognized debugging information"),
|
||||
bfd_get_filename (abfd));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return dhandle;
|
||||
}
|
||||
|
||||
/* Read stabs in sections debugging information from a BFD. */
|
||||
|
||||
static boolean
|
||||
read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound)
|
||||
bfd *abfd;
|
||||
asymbol **syms;
|
||||
long symcount;
|
||||
PTR dhandle;
|
||||
boolean *pfound;
|
||||
{
|
||||
static struct
|
||||
{
|
||||
const char *secname;
|
||||
const char *strsecname;
|
||||
} names[] = { { ".stab", ".stabstr" } };
|
||||
unsigned int i;
|
||||
PTR shandle;
|
||||
|
||||
*pfound = false;
|
||||
shandle = NULL;
|
||||
|
||||
for (i = 0; i < sizeof names / sizeof names[0]; i++)
|
||||
{
|
||||
asection *sec, *strsec;
|
||||
|
||||
sec = bfd_get_section_by_name (abfd, names[i].secname);
|
||||
strsec = bfd_get_section_by_name (abfd, names[i].strsecname);
|
||||
if (sec != NULL && strsec != NULL)
|
||||
{
|
||||
bfd_size_type stabsize, strsize;
|
||||
bfd_byte *stabs, *strings;
|
||||
bfd_byte *stab;
|
||||
bfd_size_type stroff, next_stroff;
|
||||
|
||||
stabsize = bfd_section_size (abfd, sec);
|
||||
stabs = (bfd_byte *) xmalloc (stabsize);
|
||||
if (! bfd_get_section_contents (abfd, sec, stabs, 0, stabsize))
|
||||
{
|
||||
fprintf (stderr, "%s: %s: %s\n",
|
||||
bfd_get_filename (abfd), names[i].secname,
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
return false;
|
||||
}
|
||||
|
||||
strsize = bfd_section_size (abfd, strsec);
|
||||
strings = (bfd_byte *) xmalloc (strsize);
|
||||
if (! bfd_get_section_contents (abfd, strsec, strings, 0, strsize))
|
||||
{
|
||||
fprintf (stderr, "%s: %s: %s\n",
|
||||
bfd_get_filename (abfd), names[i].strsecname,
|
||||
bfd_errmsg (bfd_get_error ()));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (shandle == NULL)
|
||||
{
|
||||
shandle = start_stab (dhandle, abfd, true, syms, symcount);
|
||||
if (shandle == NULL)
|
||||
return false;
|
||||
}
|
||||
|
||||
*pfound = true;
|
||||
|
||||
stroff = 0;
|
||||
next_stroff = 0;
|
||||
for (stab = stabs; stab < stabs + stabsize; stab += 12)
|
||||
{
|
||||
unsigned int strx;
|
||||
int type;
|
||||
int other;
|
||||
int desc;
|
||||
bfd_vma value;
|
||||
|
||||
/* This code presumes 32 bit values. */
|
||||
|
||||
strx = bfd_get_32 (abfd, stab);
|
||||
type = bfd_get_8 (abfd, stab + 4);
|
||||
other = bfd_get_8 (abfd, stab + 5);
|
||||
desc = bfd_get_16 (abfd, stab + 6);
|
||||
value = bfd_get_32 (abfd, stab + 8);
|
||||
|
||||
if (type == 0)
|
||||
{
|
||||
/* Special type 0 stabs indicate the offset to the
|
||||
next string table. */
|
||||
stroff = next_stroff;
|
||||
next_stroff += value;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *f, *s;
|
||||
|
||||
f = NULL;
|
||||
|
||||
if (stroff + strx > strsize)
|
||||
{
|
||||
fprintf (stderr, "%s: %s: stab entry %d is corrupt, strx = 0x%x, type = %d\n",
|
||||
bfd_get_filename (abfd), names[i].secname,
|
||||
(stab - stabs) / 12, strx, type);
|
||||
continue;
|
||||
}
|
||||
|
||||
s = (char *) strings + stroff + strx;
|
||||
|
||||
while (s[strlen (s) - 1] == '\\'
|
||||
&& stab + 12 < stabs + stabsize)
|
||||
{
|
||||
char *p;
|
||||
|
||||
stab += 12;
|
||||
p = s + strlen (s) - 1;
|
||||
*p = '\0';
|
||||
s = concat (s,
|
||||
((char *) strings
|
||||
+ stroff
|
||||
+ bfd_get_32 (abfd, stab)),
|
||||
(const char *) NULL);
|
||||
|
||||
/* We have to restore the backslash, because, if
|
||||
the linker is hashing stabs strings, we may
|
||||
see the same string more than once. */
|
||||
*p = '\\';
|
||||
|
||||
if (f != NULL)
|
||||
free (f);
|
||||
f = s;
|
||||
}
|
||||
|
||||
save_stab (type, desc, value, s);
|
||||
|
||||
if (! parse_stab (dhandle, shandle, type, desc, value, s))
|
||||
{
|
||||
stab_context ();
|
||||
free_saved_stabs ();
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Don't free f, since I think the stabs code
|
||||
expects strings to hang around. This should be
|
||||
straightened out. FIXME. */
|
||||
}
|
||||
}
|
||||
|
||||
free_saved_stabs ();
|
||||
free (stabs);
|
||||
|
||||
/* Don't free strings, since I think the stabs code expects
|
||||
the strings to hang around. This should be straightened
|
||||
out. FIXME. */
|
||||
}
|
||||
}
|
||||
|
||||
if (shandle != NULL)
|
||||
{
|
||||
if (! finish_stab (dhandle, shandle))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Read stabs in the symbol table. */
|
||||
|
||||
static boolean
|
||||
read_symbol_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound)
|
||||
bfd *abfd;
|
||||
asymbol **syms;
|
||||
long symcount;
|
||||
PTR dhandle;
|
||||
boolean *pfound;
|
||||
{
|
||||
PTR shandle;
|
||||
asymbol **ps, **symend;
|
||||
|
||||
shandle = NULL;
|
||||
symend = syms + symcount;
|
||||
for (ps = syms; ps < symend; ps++)
|
||||
{
|
||||
symbol_info i;
|
||||
|
||||
bfd_get_symbol_info (abfd, *ps, &i);
|
||||
|
||||
if (i.type == '-')
|
||||
{
|
||||
const char *s;
|
||||
char *f;
|
||||
|
||||
if (shandle == NULL)
|
||||
{
|
||||
shandle = start_stab (dhandle, abfd, false, syms, symcount);
|
||||
if (shandle == NULL)
|
||||
return false;
|
||||
}
|
||||
|
||||
*pfound = true;
|
||||
|
||||
s = i.name;
|
||||
f = NULL;
|
||||
while (s[strlen (s) - 1] == '\\'
|
||||
&& ps + 1 < symend)
|
||||
{
|
||||
char *sc, *n;
|
||||
|
||||
++ps;
|
||||
sc = xstrdup (s);
|
||||
sc[strlen (sc) - 1] = '\0';
|
||||
n = concat (sc, bfd_asymbol_name (*ps), (const char *) NULL);
|
||||
free (sc);
|
||||
if (f != NULL)
|
||||
free (f);
|
||||
f = n;
|
||||
s = n;
|
||||
}
|
||||
|
||||
save_stab (i.stab_type, i.stab_desc, i.value, s);
|
||||
|
||||
if (! parse_stab (dhandle, shandle, i.stab_type, i.stab_desc,
|
||||
i.value, s))
|
||||
{
|
||||
stab_context ();
|
||||
free_saved_stabs ();
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Don't free f, since I think the stabs code expects
|
||||
strings to hang around. This should be straightened out.
|
||||
FIXME. */
|
||||
}
|
||||
}
|
||||
|
||||
free_saved_stabs ();
|
||||
|
||||
if (shandle != NULL)
|
||||
{
|
||||
if (! finish_stab (dhandle, shandle))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Read IEEE debugging information. */
|
||||
|
||||
static boolean
|
||||
read_ieee_debugging_info (abfd, dhandle, pfound)
|
||||
bfd *abfd;
|
||||
PTR dhandle;
|
||||
boolean *pfound;
|
||||
{
|
||||
asection *dsec;
|
||||
bfd_size_type size;
|
||||
bfd_byte *contents;
|
||||
|
||||
/* The BFD backend puts the debugging information into a section
|
||||
named .debug. */
|
||||
|
||||
dsec = bfd_get_section_by_name (abfd, ".debug");
|
||||
if (dsec == NULL)
|
||||
return true;
|
||||
|
||||
size = bfd_section_size (abfd, dsec);
|
||||
contents = (bfd_byte *) xmalloc (size);
|
||||
if (! bfd_get_section_contents (abfd, dsec, contents, 0, size))
|
||||
return false;
|
||||
|
||||
if (! parse_ieee (dhandle, abfd, contents, size))
|
||||
return false;
|
||||
|
||||
free (contents);
|
||||
|
||||
*pfound = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Record stabs strings, so that we can give some context for errors. */
|
||||
|
||||
#define SAVE_STABS_COUNT (16)
|
||||
|
||||
struct saved_stab
|
||||
{
|
||||
int type;
|
||||
int desc;
|
||||
bfd_vma value;
|
||||
char *string;
|
||||
};
|
||||
|
||||
static struct saved_stab saved_stabs[SAVE_STABS_COUNT];
|
||||
static int saved_stabs_index;
|
||||
|
||||
/* Save a stabs string. */
|
||||
|
||||
static void
|
||||
save_stab (type, desc, value, string)
|
||||
int type;
|
||||
int desc;
|
||||
bfd_vma value;
|
||||
const char *string;
|
||||
{
|
||||
if (saved_stabs[saved_stabs_index].string != NULL)
|
||||
free (saved_stabs[saved_stabs_index].string);
|
||||
saved_stabs[saved_stabs_index].type = type;
|
||||
saved_stabs[saved_stabs_index].desc = desc;
|
||||
saved_stabs[saved_stabs_index].value = value;
|
||||
saved_stabs[saved_stabs_index].string = xstrdup (string);
|
||||
saved_stabs_index = (saved_stabs_index + 1) % SAVE_STABS_COUNT;
|
||||
}
|
||||
|
||||
/* Provide context for an error. */
|
||||
|
||||
static void
|
||||
stab_context ()
|
||||
{
|
||||
int i;
|
||||
|
||||
fprintf (stderr, _("Last stabs entries before error:\n"));
|
||||
fprintf (stderr, "n_type n_desc n_value string\n");
|
||||
|
||||
i = saved_stabs_index;
|
||||
do
|
||||
{
|
||||
struct saved_stab *stabp;
|
||||
|
||||
stabp = saved_stabs + i;
|
||||
if (stabp->string != NULL)
|
||||
{
|
||||
const char *s;
|
||||
|
||||
s = bfd_get_stab_name (stabp->type);
|
||||
if (s != NULL)
|
||||
fprintf (stderr, "%-6s", s);
|
||||
else if (stabp->type == 0)
|
||||
fprintf (stderr, "HdrSym");
|
||||
else
|
||||
fprintf (stderr, "%-6d", stabp->type);
|
||||
fprintf (stderr, " %-6d ", stabp->desc);
|
||||
fprintf_vma (stderr, stabp->value);
|
||||
if (stabp->type != 0)
|
||||
fprintf (stderr, " %s", stabp->string);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
i = (i + 1) % SAVE_STABS_COUNT;
|
||||
}
|
||||
while (i != saved_stabs_index);
|
||||
}
|
||||
|
||||
/* Free the saved stab strings. */
|
||||
|
||||
static void
|
||||
free_saved_stabs ()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SAVE_STABS_COUNT; i++)
|
||||
{
|
||||
if (saved_stabs[i].string != NULL)
|
||||
{
|
||||
free (saved_stabs[i].string);
|
||||
saved_stabs[i].string = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
saved_stabs_index = 0;
|
||||
}
|
||||
8881
binutils/readelf.c
8881
binutils/readelf.c
File diff suppressed because it is too large
Load Diff
@@ -1,220 +0,0 @@
|
||||
/* rename.c -- rename a file, preserving symlinks.
|
||||
Copyright 1999 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_GOOD_UTIME_H
|
||||
#include <utime.h>
|
||||
#else /* ! HAVE_GOOD_UTIME_H */
|
||||
#ifdef HAVE_UTIMES
|
||||
#include <sys/time.h>
|
||||
#endif /* HAVE_UTIMES */
|
||||
#endif /* ! HAVE_GOOD_UTIME_H */
|
||||
|
||||
/* We need to open the file in binary modes on system where that makes
|
||||
a difference. */
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
||||
static int simple_copy PARAMS ((const char *, const char *));
|
||||
|
||||
/* The number of bytes to copy at once. */
|
||||
#define COPY_BUF 8192
|
||||
|
||||
/* Copy file FROM to file TO, performing no translations.
|
||||
Return 0 if ok, -1 if error. */
|
||||
|
||||
static int
|
||||
simple_copy (from, to)
|
||||
const char *from;
|
||||
const char *to;
|
||||
{
|
||||
int fromfd, tofd, nread;
|
||||
int saved;
|
||||
char buf[COPY_BUF];
|
||||
|
||||
fromfd = open (from, O_RDONLY | O_BINARY);
|
||||
if (fromfd < 0)
|
||||
return -1;
|
||||
#ifdef O_CREAT
|
||||
tofd = open (to, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0777);
|
||||
#else
|
||||
tofd = creat (to, 0777);
|
||||
#endif
|
||||
if (tofd < 0)
|
||||
{
|
||||
saved = errno;
|
||||
close (fromfd);
|
||||
errno = saved;
|
||||
return -1;
|
||||
}
|
||||
while ((nread = read (fromfd, buf, sizeof buf)) > 0)
|
||||
{
|
||||
if (write (tofd, buf, nread) != nread)
|
||||
{
|
||||
saved = errno;
|
||||
close (fromfd);
|
||||
close (tofd);
|
||||
errno = saved;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
saved = errno;
|
||||
close (fromfd);
|
||||
close (tofd);
|
||||
if (nread < 0)
|
||||
{
|
||||
errno = saved;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set the times of the file DESTINATION to be the same as those in
|
||||
STATBUF. */
|
||||
|
||||
void
|
||||
set_times (destination, statbuf)
|
||||
const char *destination;
|
||||
const struct stat *statbuf;
|
||||
{
|
||||
int result;
|
||||
|
||||
{
|
||||
#ifdef HAVE_GOOD_UTIME_H
|
||||
struct utimbuf tb;
|
||||
|
||||
tb.actime = statbuf->st_atime;
|
||||
tb.modtime = statbuf->st_mtime;
|
||||
result = utime (destination, &tb);
|
||||
#else /* ! HAVE_GOOD_UTIME_H */
|
||||
#ifndef HAVE_UTIMES
|
||||
long tb[2];
|
||||
|
||||
tb[0] = statbuf->st_atime;
|
||||
tb[1] = statbuf->st_mtime;
|
||||
result = utime (destination, tb);
|
||||
#else /* HAVE_UTIMES */
|
||||
struct timeval tv[2];
|
||||
|
||||
tv[0].tv_sec = statbuf->st_atime;
|
||||
tv[0].tv_usec = 0;
|
||||
tv[1].tv_sec = statbuf->st_mtime;
|
||||
tv[1].tv_usec = 0;
|
||||
result = utimes (destination, tv);
|
||||
#endif /* HAVE_UTIMES */
|
||||
#endif /* ! HAVE_GOOD_UTIME_H */
|
||||
}
|
||||
|
||||
if (result != 0)
|
||||
non_fatal (_("%s: cannot set time: %s"), destination, strerror (errno));
|
||||
}
|
||||
|
||||
#ifndef S_ISLNK
|
||||
#ifdef S_IFLNK
|
||||
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
|
||||
#else
|
||||
#define S_ISLNK(m) 0
|
||||
#define lstat stat
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Rename FROM to TO, copying if TO is a link.
|
||||
Return 0 if ok, -1 if error. */
|
||||
|
||||
int
|
||||
smart_rename (from, to, preserve_dates)
|
||||
const char *from;
|
||||
const char *to;
|
||||
int preserve_dates;
|
||||
{
|
||||
boolean exists;
|
||||
struct stat s;
|
||||
int ret = 0;
|
||||
|
||||
exists = lstat (to, &s) == 0;
|
||||
|
||||
#if defined (_WIN32) && !defined (__CYGWIN32__)
|
||||
/* Win32, unlike unix, will not erase `to' in `rename(from, to)' but
|
||||
fail instead. Also, chown is not present. */
|
||||
|
||||
if (exists)
|
||||
remove (to);
|
||||
|
||||
ret = rename (from, to);
|
||||
if (ret != 0)
|
||||
{
|
||||
/* We have to clean up here. */
|
||||
|
||||
non_fatal (_("%s: rename: %s"), to, strerror (errno));
|
||||
unlink (from);
|
||||
}
|
||||
#else
|
||||
/* Use rename only if TO is not a symbolic link and has
|
||||
only one hard link. */
|
||||
if (! exists || (!S_ISLNK (s.st_mode) && s.st_nlink == 1))
|
||||
{
|
||||
ret = rename (from, to);
|
||||
if (ret == 0)
|
||||
{
|
||||
if (exists)
|
||||
{
|
||||
/* Try to preserve the permission bits and ownership of
|
||||
TO. First get the mode right except for the setuid
|
||||
bit. Then change the ownership. Then fix the setuid
|
||||
bit. We do the chmod before the chown because if the
|
||||
chown succeeds, and we are a normal user, we won't be
|
||||
able to do the chmod afterward. We don't bother to
|
||||
fix the setuid bit first because that might introduce
|
||||
a fleeting security problem, and because the chown
|
||||
will clear the setuid bit anyhow. We only fix the
|
||||
setuid bit if the chown succeeds, because we don't
|
||||
want to introduce an unexpected setuid file owned by
|
||||
the user running objcopy. */
|
||||
chmod (to, s.st_mode & 0777);
|
||||
if (chown (to, s.st_uid, s.st_gid) >= 0)
|
||||
chmod (to, s.st_mode & 07777);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We have to clean up here. */
|
||||
non_fatal (_("%s: rename: %s"), to, strerror (errno));
|
||||
unlink (from);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = simple_copy (from, to);
|
||||
if (ret != 0)
|
||||
non_fatal (_("%s: simple_copy: %s"), to, strerror (errno));
|
||||
|
||||
if (preserve_dates)
|
||||
set_times (to, &s);
|
||||
unlink (from);
|
||||
}
|
||||
#endif /* _WIN32 && !__CYGWIN32__ */
|
||||
|
||||
return ret;
|
||||
}
|
||||
2387
binutils/resbin.c
2387
binutils/resbin.c
File diff suppressed because it is too large
Load Diff
@@ -1,785 +0,0 @@
|
||||
/* rescoff.c -- read and write resources in Windows COFF files.
|
||||
Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Cygnus Support.
|
||||
|
||||
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 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. */
|
||||
|
||||
/* This file contains function that read and write Windows resources
|
||||
in COFF files. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
#include "libiberty.h"
|
||||
#include "windres.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
/* In order to use the address of a resource data entry, we need to
|
||||
get the image base of the file. Right now we extract it from
|
||||
internal BFD information. FIXME. */
|
||||
|
||||
#include "coff/internal.h"
|
||||
#include "libcoff.h"
|
||||
|
||||
/* Information we extract from the file. */
|
||||
|
||||
struct coff_file_info
|
||||
{
|
||||
/* File name. */
|
||||
const char *filename;
|
||||
/* Data read from the file. */
|
||||
const bfd_byte *data;
|
||||
/* End of data read from file. */
|
||||
const bfd_byte *data_end;
|
||||
/* Address of the resource section minus the image base of the file. */
|
||||
bfd_vma secaddr;
|
||||
/* Non-zero if the file is big endian. */
|
||||
int big_endian;
|
||||
};
|
||||
|
||||
/* A resource directory table in a COFF file. */
|
||||
|
||||
struct extern_res_directory
|
||||
{
|
||||
/* Characteristics. */
|
||||
bfd_byte characteristics[4];
|
||||
/* Time stamp. */
|
||||
bfd_byte time[4];
|
||||
/* Major version number. */
|
||||
bfd_byte major[2];
|
||||
/* Minor version number. */
|
||||
bfd_byte minor[2];
|
||||
/* Number of named directory entries. */
|
||||
bfd_byte name_count[2];
|
||||
/* Number of directory entries with IDs. */
|
||||
bfd_byte id_count[2];
|
||||
};
|
||||
|
||||
/* A resource directory entry in a COFF file. */
|
||||
|
||||
struct extern_res_entry
|
||||
{
|
||||
/* Name or ID. */
|
||||
bfd_byte name[4];
|
||||
/* Address of resource entry or subdirectory. */
|
||||
bfd_byte rva[4];
|
||||
};
|
||||
|
||||
/* A resource data entry in a COFF file. */
|
||||
|
||||
struct extern_res_data
|
||||
{
|
||||
/* Address of resource data. This is apparently a file relative
|
||||
address, rather than a section offset. */
|
||||
bfd_byte rva[4];
|
||||
/* Size of resource data. */
|
||||
bfd_byte size[4];
|
||||
/* Code page. */
|
||||
bfd_byte codepage[4];
|
||||
/* Reserved. */
|
||||
bfd_byte reserved[4];
|
||||
};
|
||||
|
||||
/* Macros to swap in values. */
|
||||
|
||||
#define getfi_16(fi, s) ((fi)->big_endian ? bfd_getb16 (s) : bfd_getl16 (s))
|
||||
#define getfi_32(fi, s) ((fi)->big_endian ? bfd_getb32 (s) : bfd_getl32 (s))
|
||||
|
||||
/* Local functions. */
|
||||
|
||||
static void overrun PARAMS ((const struct coff_file_info *, const char *));
|
||||
static struct res_directory *read_coff_res_dir
|
||||
PARAMS ((const bfd_byte *, const struct coff_file_info *,
|
||||
const struct res_id *, int));
|
||||
static struct res_resource *read_coff_data_entry
|
||||
PARAMS ((const bfd_byte *, const struct coff_file_info *,
|
||||
const struct res_id *));
|
||||
|
||||
/* Read the resources in a COFF file. */
|
||||
|
||||
struct res_directory *
|
||||
read_coff_rsrc (filename, target)
|
||||
const char *filename;
|
||||
const char *target;
|
||||
{
|
||||
bfd *abfd;
|
||||
char **matching;
|
||||
asection *sec;
|
||||
bfd_size_type size;
|
||||
bfd_byte *data;
|
||||
struct coff_file_info finfo;
|
||||
|
||||
if (filename == NULL)
|
||||
fatal (_("filename required for COFF input"));
|
||||
|
||||
abfd = bfd_openr (filename, target);
|
||||
if (abfd == NULL)
|
||||
bfd_fatal (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);
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
sec = bfd_get_section_by_name (abfd, ".rsrc");
|
||||
if (sec == NULL)
|
||||
{
|
||||
fatal (_("%s: no resource section"), filename);
|
||||
}
|
||||
|
||||
size = bfd_section_size (abfd, sec);
|
||||
data = (bfd_byte *) res_alloc (size);
|
||||
|
||||
if (! bfd_get_section_contents (abfd, sec, data, 0, size))
|
||||
bfd_fatal (_("can't read resource section"));
|
||||
|
||||
finfo.filename = filename;
|
||||
finfo.data = data;
|
||||
finfo.data_end = data + size;
|
||||
finfo.secaddr = (bfd_get_section_vma (abfd, sec)
|
||||
- pe_data (abfd)->pe_opthdr.ImageBase);
|
||||
finfo.big_endian = bfd_big_endian (abfd);
|
||||
|
||||
bfd_close (abfd);
|
||||
|
||||
/* Now just read in the top level resource directory. Note that we
|
||||
don't free data, since we create resource entries that point into
|
||||
it. If we ever want to free up the resource information we read,
|
||||
this will have to be cleaned up. */
|
||||
|
||||
return read_coff_res_dir (data, &finfo, (const struct res_id *) NULL, 0);
|
||||
}
|
||||
|
||||
/* Give an error if we are out of bounds. */
|
||||
|
||||
static void
|
||||
overrun (finfo, msg)
|
||||
const struct coff_file_info *finfo;
|
||||
const char *msg;
|
||||
{
|
||||
fatal (_("%s: %s: address out of bounds"), finfo->filename, msg);
|
||||
}
|
||||
|
||||
/* Read a resource directory. */
|
||||
|
||||
static struct res_directory *
|
||||
read_coff_res_dir (data, finfo, type, level)
|
||||
const bfd_byte *data;
|
||||
const struct coff_file_info *finfo;
|
||||
const struct res_id *type;
|
||||
int level;
|
||||
{
|
||||
const struct extern_res_directory *erd;
|
||||
struct res_directory *rd;
|
||||
int name_count, id_count, i;
|
||||
struct res_entry **pp;
|
||||
const struct extern_res_entry *ere;
|
||||
|
||||
if ((size_t) (finfo->data_end - data) < sizeof (struct extern_res_directory))
|
||||
overrun (finfo, _("directory"));
|
||||
|
||||
erd = (const struct extern_res_directory *) data;
|
||||
|
||||
rd = (struct res_directory *) res_alloc (sizeof *rd);
|
||||
rd->characteristics = getfi_32 (finfo, erd->characteristics);
|
||||
rd->time = getfi_32 (finfo, erd->time);
|
||||
rd->major = getfi_16 (finfo, erd->major);
|
||||
rd->minor = getfi_16 (finfo, erd->minor);
|
||||
rd->entries = NULL;
|
||||
|
||||
name_count = getfi_16 (finfo, erd->name_count);
|
||||
id_count = getfi_16 (finfo, erd->id_count);
|
||||
|
||||
pp = &rd->entries;
|
||||
|
||||
/* The resource directory entries immediately follow the directory
|
||||
table. */
|
||||
ere = (const struct extern_res_entry *) (erd + 1);
|
||||
|
||||
for (i = 0; i < name_count; i++, ere++)
|
||||
{
|
||||
unsigned long name, rva;
|
||||
struct res_entry *re;
|
||||
const bfd_byte *ers;
|
||||
int length, j;
|
||||
|
||||
if ((const bfd_byte *) ere >= finfo->data_end)
|
||||
overrun (finfo, _("named directory entry"));
|
||||
|
||||
name = getfi_32 (finfo, ere->name);
|
||||
rva = getfi_32 (finfo, ere->rva);
|
||||
|
||||
/* For some reason the high bit in NAME is set. */
|
||||
name &=~ 0x80000000;
|
||||
|
||||
if (name > (size_t) (finfo->data_end - finfo->data))
|
||||
overrun (finfo, _("directory entry name"));
|
||||
|
||||
ers = finfo->data + name;
|
||||
|
||||
re = (struct res_entry *) res_alloc (sizeof *re);
|
||||
re->next = NULL;
|
||||
re->id.named = 1;
|
||||
length = getfi_16 (finfo, ers);
|
||||
re->id.u.n.length = length;
|
||||
re->id.u.n.name = (unichar *) res_alloc (length * sizeof (unichar));
|
||||
for (j = 0; j < length; j++)
|
||||
re->id.u.n.name[j] = getfi_16 (finfo, ers + j * 2 + 2);
|
||||
|
||||
if (level == 0)
|
||||
type = &re->id;
|
||||
|
||||
if ((rva & 0x80000000) != 0)
|
||||
{
|
||||
rva &=~ 0x80000000;
|
||||
if (rva >= (size_t) (finfo->data_end - finfo->data))
|
||||
overrun (finfo, _("named subdirectory"));
|
||||
re->subdir = 1;
|
||||
re->u.dir = read_coff_res_dir (finfo->data + rva, finfo, type,
|
||||
level + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rva >= (size_t) (finfo->data_end - finfo->data))
|
||||
overrun (finfo, _("named resource"));
|
||||
re->subdir = 0;
|
||||
re->u.res = read_coff_data_entry (finfo->data + rva, finfo, type);
|
||||
}
|
||||
|
||||
*pp = re;
|
||||
pp = &re->next;
|
||||
}
|
||||
|
||||
for (i = 0; i < id_count; i++, ere++)
|
||||
{
|
||||
unsigned long name, rva;
|
||||
struct res_entry *re;
|
||||
|
||||
if ((const bfd_byte *) ere >= finfo->data_end)
|
||||
overrun (finfo, _("ID directory entry"));
|
||||
|
||||
name = getfi_32 (finfo, ere->name);
|
||||
rva = getfi_32 (finfo, ere->rva);
|
||||
|
||||
re = (struct res_entry *) res_alloc (sizeof *re);
|
||||
re->next = NULL;
|
||||
re->id.named = 0;
|
||||
re->id.u.id = name;
|
||||
|
||||
if (level == 0)
|
||||
type = &re->id;
|
||||
|
||||
if ((rva & 0x80000000) != 0)
|
||||
{
|
||||
rva &=~ 0x80000000;
|
||||
if (rva >= (size_t) (finfo->data_end - finfo->data))
|
||||
overrun (finfo, _("ID subdirectory"));
|
||||
re->subdir = 1;
|
||||
re->u.dir = read_coff_res_dir (finfo->data + rva, finfo, type,
|
||||
level + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rva >= (size_t) (finfo->data_end - finfo->data))
|
||||
overrun (finfo, _("ID resource"));
|
||||
re->subdir = 0;
|
||||
re->u.res = read_coff_data_entry (finfo->data + rva, finfo, type);
|
||||
}
|
||||
|
||||
*pp = re;
|
||||
pp = &re->next;
|
||||
}
|
||||
|
||||
return rd;
|
||||
}
|
||||
|
||||
/* Read a resource data entry. */
|
||||
|
||||
static struct res_resource *
|
||||
read_coff_data_entry (data, finfo, type)
|
||||
const bfd_byte *data;
|
||||
const struct coff_file_info *finfo;
|
||||
const struct res_id *type;
|
||||
{
|
||||
const struct extern_res_data *erd;
|
||||
struct res_resource *r;
|
||||
unsigned long size, rva;
|
||||
const bfd_byte *resdata;
|
||||
|
||||
if (type == NULL)
|
||||
fatal (_("resource type unknown"));
|
||||
|
||||
if ((size_t) (finfo->data_end - data) < sizeof (struct extern_res_data))
|
||||
overrun (finfo, _("data entry"));
|
||||
|
||||
erd = (const struct extern_res_data *) data;
|
||||
|
||||
size = getfi_32 (finfo, erd->size);
|
||||
rva = getfi_32 (finfo, erd->rva);
|
||||
if (rva < finfo->secaddr
|
||||
|| rva - finfo->secaddr >= (size_t) (finfo->data_end - finfo->data))
|
||||
overrun (finfo, _("resource data"));
|
||||
|
||||
resdata = finfo->data + (rva - finfo->secaddr);
|
||||
|
||||
if (size > (size_t) (finfo->data_end - resdata))
|
||||
overrun (finfo, _("resource data size"));
|
||||
|
||||
r = bin_to_res (*type, resdata, size, finfo->big_endian);
|
||||
|
||||
memset (&r->res_info, 0, sizeof (struct res_res_info));
|
||||
r->coff_info.codepage = getfi_32 (finfo, erd->codepage);
|
||||
r->coff_info.reserved = getfi_32 (finfo, erd->reserved);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/* This structure is used to build a list of bindata structures. */
|
||||
|
||||
struct bindata_build
|
||||
{
|
||||
/* The data. */
|
||||
struct bindata *d;
|
||||
/* The last structure we have added to the list. */
|
||||
struct bindata *last;
|
||||
/* The size of the list as a whole. */
|
||||
unsigned long length;
|
||||
};
|
||||
|
||||
/* This structure keeps track of information as we build the directory
|
||||
tree. */
|
||||
|
||||
struct coff_write_info
|
||||
{
|
||||
/* These fields are based on the BFD. */
|
||||
/* The BFD itself. */
|
||||
bfd *abfd;
|
||||
/* Non-zero if the file is big endian. */
|
||||
int big_endian;
|
||||
/* Pointer to section symbol used to build RVA relocs. */
|
||||
asymbol **sympp;
|
||||
|
||||
/* These fields are computed initially, and then not changed. */
|
||||
/* Length of directory tables and entries. */
|
||||
unsigned long dirsize;
|
||||
/* Length of directory entry strings. */
|
||||
unsigned long dirstrsize;
|
||||
/* Length of resource data entries. */
|
||||
unsigned long dataentsize;
|
||||
|
||||
/* These fields are updated as we add data. */
|
||||
/* Directory tables and entries. */
|
||||
struct bindata_build dirs;
|
||||
/* Directory entry strings. */
|
||||
struct bindata_build dirstrs;
|
||||
/* Resource data entries. */
|
||||
struct bindata_build dataents;
|
||||
/* Actual resource data. */
|
||||
struct bindata_build resources;
|
||||
/* Relocations. */
|
||||
arelent **relocs;
|
||||
/* Number of relocations. */
|
||||
unsigned int reloc_count;
|
||||
};
|
||||
|
||||
/* Macros to swap out values. */
|
||||
|
||||
#define putcwi_16(cwi, v, s) \
|
||||
((cwi->big_endian) ? bfd_putb16 ((v), (s)) : bfd_putl16 ((v), (s)))
|
||||
#define putcwi_32(cwi, v, s) \
|
||||
((cwi->big_endian) ? bfd_putb32 ((v), (s)) : bfd_putl32 ((v), (s)))
|
||||
|
||||
static void coff_bin_sizes
|
||||
PARAMS ((const struct res_directory *, struct coff_write_info *));
|
||||
static unsigned char *coff_alloc PARAMS ((struct bindata_build *, size_t));
|
||||
static void coff_to_bin
|
||||
PARAMS ((const struct res_directory *, struct coff_write_info *));
|
||||
static void coff_res_to_bin
|
||||
PARAMS ((const struct res_resource *, struct coff_write_info *));
|
||||
|
||||
/* Write resources to a COFF file. RESOURCES should already be
|
||||
sorted.
|
||||
|
||||
Right now we always create a new file. Someday we should also
|
||||
offer the ability to merge resources into an existing file. This
|
||||
would require doing the basic work of objcopy, just modifying or
|
||||
adding the .rsrc section. */
|
||||
|
||||
void
|
||||
write_coff_file (filename, target, resources)
|
||||
const char *filename;
|
||||
const char *target;
|
||||
const struct res_directory *resources;
|
||||
{
|
||||
bfd *abfd;
|
||||
asection *sec;
|
||||
struct coff_write_info cwi;
|
||||
struct bindata *d;
|
||||
unsigned long length, offset;
|
||||
|
||||
if (filename == NULL)
|
||||
fatal (_("filename required for COFF output"));
|
||||
|
||||
abfd = bfd_openw (filename, target);
|
||||
if (abfd == NULL)
|
||||
bfd_fatal (filename);
|
||||
|
||||
if (! bfd_set_format (abfd, bfd_object))
|
||||
bfd_fatal ("bfd_set_format");
|
||||
|
||||
#if defined DLLTOOL_SH
|
||||
if (! bfd_set_arch_mach (abfd, bfd_arch_sh, 0))
|
||||
bfd_fatal ("bfd_set_arch_mach(sh)");
|
||||
#elif defined DLLTOOL_MIPS
|
||||
if (! bfd_set_arch_mach (abfd, bfd_arch_mips, 0))
|
||||
bfd_fatal ("bfd_set_arch_mach(mips)");
|
||||
#elif defined DLLTOOL_ARM
|
||||
if (! bfd_set_arch_mach (abfd, bfd_arch_arm, 0))
|
||||
bfd_fatal ("bfd_set_arch_mach(arm)");
|
||||
#else
|
||||
/* FIXME: This is obviously i386 specific. */
|
||||
if (! bfd_set_arch_mach (abfd, bfd_arch_i386, 0))
|
||||
bfd_fatal ("bfd_set_arch_mach(i386)");
|
||||
#endif
|
||||
|
||||
if (! bfd_set_file_flags (abfd, HAS_SYMS | HAS_RELOC))
|
||||
bfd_fatal ("bfd_set_file_flags");
|
||||
|
||||
sec = bfd_make_section (abfd, ".rsrc");
|
||||
if (sec == NULL)
|
||||
bfd_fatal ("bfd_make_section");
|
||||
|
||||
if (! bfd_set_section_flags (abfd, sec,
|
||||
(SEC_HAS_CONTENTS | SEC_ALLOC
|
||||
| SEC_LOAD | SEC_DATA)))
|
||||
bfd_fatal ("bfd_set_section_flags");
|
||||
|
||||
if (! bfd_set_symtab (abfd, sec->symbol_ptr_ptr, 1))
|
||||
bfd_fatal ("bfd_set_symtab");
|
||||
|
||||
/* Requiring this is probably a bug in BFD. */
|
||||
sec->output_section = sec;
|
||||
|
||||
/* The order of data in the .rsrc section is
|
||||
resource directory tables and entries
|
||||
resource directory strings
|
||||
resource data entries
|
||||
actual resource data
|
||||
|
||||
We build these different types of data in different lists. */
|
||||
|
||||
cwi.abfd = abfd;
|
||||
cwi.big_endian = bfd_big_endian (abfd);
|
||||
cwi.sympp = sec->symbol_ptr_ptr;
|
||||
cwi.dirsize = 0;
|
||||
cwi.dirstrsize = 0;
|
||||
cwi.dataentsize = 0;
|
||||
cwi.dirs.d = NULL;
|
||||
cwi.dirs.last = NULL;
|
||||
cwi.dirs.length = 0;
|
||||
cwi.dirstrs.d = NULL;
|
||||
cwi.dirstrs.last = NULL;
|
||||
cwi.dirstrs.length = 0;
|
||||
cwi.dataents.d = NULL;
|
||||
cwi.dataents.last = NULL;
|
||||
cwi.dataents.length = 0;
|
||||
cwi.resources.d = NULL;
|
||||
cwi.resources.last = NULL;
|
||||
cwi.resources.length = 0;
|
||||
cwi.relocs = NULL;
|
||||
cwi.reloc_count = 0;
|
||||
|
||||
/* Work out the sizes of the resource directory entries, so that we
|
||||
know the various offsets we will need. */
|
||||
coff_bin_sizes (resources, &cwi);
|
||||
|
||||
/* Force the directory strings to be 32 bit aligned. Every other
|
||||
structure is 32 bit aligned anyhow. */
|
||||
cwi.dirstrsize = (cwi.dirstrsize + 3) &~ 3;
|
||||
|
||||
/* Actually convert the resources to binary. */
|
||||
coff_to_bin (resources, &cwi);
|
||||
|
||||
/* Add another 2 bytes to the directory strings if needed for
|
||||
alignment. */
|
||||
if ((cwi.dirstrs.length & 3) != 0)
|
||||
{
|
||||
unsigned char *ex;
|
||||
|
||||
ex = coff_alloc (&cwi.dirstrs, 2);
|
||||
ex[0] = 0;
|
||||
ex[1] = 0;
|
||||
}
|
||||
|
||||
/* Make sure that the data we built came out to the same size as we
|
||||
calculated initially. */
|
||||
assert (cwi.dirs.length == cwi.dirsize);
|
||||
assert (cwi.dirstrs.length == cwi.dirstrsize);
|
||||
assert (cwi.dataents.length == cwi.dataentsize);
|
||||
|
||||
length = (cwi.dirsize
|
||||
+ cwi.dirstrsize
|
||||
+ cwi.dataentsize
|
||||
+ cwi.resources.length);
|
||||
|
||||
if (! bfd_set_section_size (abfd, sec, length))
|
||||
bfd_fatal ("bfd_set_section_size");
|
||||
|
||||
bfd_set_reloc (abfd, sec, cwi.relocs, cwi.reloc_count);
|
||||
|
||||
offset = 0;
|
||||
for (d = cwi.dirs.d; d != NULL; d = d->next)
|
||||
{
|
||||
if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
|
||||
bfd_fatal ("bfd_set_section_contents");
|
||||
offset += d->length;
|
||||
}
|
||||
for (d = cwi.dirstrs.d; d != NULL; d = d->next)
|
||||
{
|
||||
if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
|
||||
bfd_fatal ("bfd_set_section_contents");
|
||||
offset += d->length;
|
||||
}
|
||||
for (d = cwi.dataents.d; d != NULL; d = d->next)
|
||||
{
|
||||
if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
|
||||
bfd_fatal ("bfd_set_section_contents");
|
||||
offset += d->length;
|
||||
}
|
||||
for (d = cwi.resources.d; d != NULL; d = d->next)
|
||||
{
|
||||
if (! bfd_set_section_contents (abfd, sec, d->data, offset, d->length))
|
||||
bfd_fatal ("bfd_set_section_contents");
|
||||
offset += d->length;
|
||||
}
|
||||
|
||||
assert (offset == length);
|
||||
|
||||
if (! bfd_close (abfd))
|
||||
bfd_fatal ("bfd_close");
|
||||
|
||||
/* We allocated the relocs array using malloc. */
|
||||
free (cwi.relocs);
|
||||
}
|
||||
|
||||
/* Work out the sizes of the various fixed size resource directory
|
||||
entries. This updates fields in CWI. */
|
||||
|
||||
static void
|
||||
coff_bin_sizes (resdir, cwi)
|
||||
const struct res_directory *resdir;
|
||||
struct coff_write_info *cwi;
|
||||
{
|
||||
const struct res_entry *re;
|
||||
|
||||
cwi->dirsize += sizeof (struct extern_res_directory);
|
||||
|
||||
for (re = resdir->entries; re != NULL; re = re->next)
|
||||
{
|
||||
cwi->dirsize += sizeof (struct extern_res_entry);
|
||||
|
||||
if (re->id.named)
|
||||
cwi->dirstrsize += re->id.u.n.length * 2 + 2;
|
||||
|
||||
if (re->subdir)
|
||||
coff_bin_sizes (re->u.dir, cwi);
|
||||
else
|
||||
cwi->dataentsize += sizeof (struct extern_res_data);
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate data for a particular list. */
|
||||
|
||||
static unsigned char *
|
||||
coff_alloc (bb, size)
|
||||
struct bindata_build *bb;
|
||||
size_t size;
|
||||
{
|
||||
struct bindata *d;
|
||||
|
||||
d = (struct bindata *) reswr_alloc (sizeof *d);
|
||||
|
||||
d->next = NULL;
|
||||
d->data = (unsigned char *) reswr_alloc (size);
|
||||
d->length = size;
|
||||
|
||||
if (bb->d == NULL)
|
||||
bb->d = d;
|
||||
else
|
||||
bb->last->next = d;
|
||||
bb->last = d;
|
||||
bb->length += size;
|
||||
|
||||
return d->data;
|
||||
}
|
||||
|
||||
/* Convert the resource directory RESDIR to binary. */
|
||||
|
||||
static void
|
||||
coff_to_bin (resdir, cwi)
|
||||
const struct res_directory *resdir;
|
||||
struct coff_write_info *cwi;
|
||||
{
|
||||
struct extern_res_directory *erd;
|
||||
int ci, cn;
|
||||
const struct res_entry *e;
|
||||
struct extern_res_entry *ere;
|
||||
|
||||
/* Write out the directory table. */
|
||||
|
||||
erd = ((struct extern_res_directory *)
|
||||
coff_alloc (&cwi->dirs, sizeof (*erd)));
|
||||
|
||||
putcwi_32 (cwi, resdir->characteristics, erd->characteristics);
|
||||
putcwi_32 (cwi, resdir->time, erd->time);
|
||||
putcwi_16 (cwi, resdir->major, erd->major);
|
||||
putcwi_16 (cwi, resdir->minor, erd->minor);
|
||||
|
||||
ci = 0;
|
||||
cn = 0;
|
||||
for (e = resdir->entries; e != NULL; e = e->next)
|
||||
{
|
||||
if (e->id.named)
|
||||
++cn;
|
||||
else
|
||||
++ci;
|
||||
}
|
||||
|
||||
putcwi_16 (cwi, cn, erd->name_count);
|
||||
putcwi_16 (cwi, ci, erd->id_count);
|
||||
|
||||
/* Write out the data entries. Note that we allocate space for all
|
||||
the entries before writing them out. That permits a recursive
|
||||
call to work correctly when writing out subdirectories. */
|
||||
|
||||
ere = ((struct extern_res_entry *)
|
||||
coff_alloc (&cwi->dirs, (ci + cn) * sizeof (*ere)));
|
||||
for (e = resdir->entries; e != NULL; e = e->next, ere++)
|
||||
{
|
||||
if (! e->id.named)
|
||||
putcwi_32 (cwi, e->id.u.id, ere->name);
|
||||
else
|
||||
{
|
||||
unsigned char *str;
|
||||
int i;
|
||||
|
||||
/* For some reason existing files seem to have the high bit
|
||||
set on the address of the name, although that is not
|
||||
documented. */
|
||||
putcwi_32 (cwi,
|
||||
0x80000000 | (cwi->dirsize + cwi->dirstrs.length),
|
||||
ere->name);
|
||||
|
||||
str = coff_alloc (&cwi->dirstrs, e->id.u.n.length * 2 + 2);
|
||||
putcwi_16 (cwi, e->id.u.n.length, str);
|
||||
for (i = 0; i < e->id.u.n.length; i++)
|
||||
putcwi_16 (cwi, e->id.u.n.name[i], str + i * 2 + 2);
|
||||
}
|
||||
|
||||
if (e->subdir)
|
||||
{
|
||||
putcwi_32 (cwi, 0x80000000 | cwi->dirs.length, ere->rva);
|
||||
coff_to_bin (e->u.dir, cwi);
|
||||
}
|
||||
else
|
||||
{
|
||||
putcwi_32 (cwi,
|
||||
cwi->dirsize + cwi->dirstrsize + cwi->dataents.length,
|
||||
ere->rva);
|
||||
|
||||
coff_res_to_bin (e->u.res, cwi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Convert the resource RES to binary. */
|
||||
|
||||
static void
|
||||
coff_res_to_bin (res, cwi)
|
||||
const struct res_resource *res;
|
||||
struct coff_write_info *cwi;
|
||||
{
|
||||
arelent *r;
|
||||
struct extern_res_data *erd;
|
||||
struct bindata *d;
|
||||
unsigned long length;
|
||||
|
||||
/* For some reason, although every other address is a section
|
||||
offset, the address of the resource data itself is an RVA. That
|
||||
means that we need to generate a relocation for it. We allocate
|
||||
the relocs array using malloc so that we can use realloc. FIXME:
|
||||
This relocation handling is correct for the i386, but probably
|
||||
not for any other target. */
|
||||
|
||||
r = (arelent *) reswr_alloc (sizeof (arelent));
|
||||
r->sym_ptr_ptr = cwi->sympp;
|
||||
r->address = cwi->dirsize + cwi->dirstrsize + cwi->dataents.length;
|
||||
r->addend = 0;
|
||||
r->howto = bfd_reloc_type_lookup (cwi->abfd, BFD_RELOC_RVA);
|
||||
if (r->howto == NULL)
|
||||
bfd_fatal (_("can't get BFD_RELOC_RVA relocation type"));
|
||||
|
||||
cwi->relocs = xrealloc (cwi->relocs,
|
||||
(cwi->reloc_count + 2) * sizeof (arelent *));
|
||||
cwi->relocs[cwi->reloc_count] = r;
|
||||
cwi->relocs[cwi->reloc_count + 1] = NULL;
|
||||
++cwi->reloc_count;
|
||||
|
||||
erd = (struct extern_res_data *) coff_alloc (&cwi->dataents, sizeof (*erd));
|
||||
|
||||
putcwi_32 (cwi,
|
||||
(cwi->dirsize
|
||||
+ cwi->dirstrsize
|
||||
+ cwi->dataentsize
|
||||
+ cwi->resources.length),
|
||||
erd->rva);
|
||||
putcwi_32 (cwi, res->coff_info.codepage, erd->codepage);
|
||||
putcwi_32 (cwi, res->coff_info.reserved, erd->reserved);
|
||||
|
||||
d = res_to_bin (res, cwi->big_endian);
|
||||
|
||||
if (cwi->resources.d == NULL)
|
||||
cwi->resources.d = d;
|
||||
else
|
||||
cwi->resources.last->next = d;
|
||||
|
||||
length = 0;
|
||||
for (; d->next != NULL; d = d->next)
|
||||
length += d->length;
|
||||
length += d->length;
|
||||
cwi->resources.last = d;
|
||||
cwi->resources.length += length;
|
||||
|
||||
putcwi_32 (cwi, length, erd->size);
|
||||
|
||||
/* Force the next resource to have 32 bit alignment. */
|
||||
|
||||
if ((length & 3) != 0)
|
||||
{
|
||||
int add;
|
||||
unsigned char *ex;
|
||||
|
||||
add = 4 - (length & 3);
|
||||
|
||||
ex = coff_alloc (&cwi->resources, add);
|
||||
memset (ex, 0, add);
|
||||
}
|
||||
}
|
||||
2670
binutils/resrc.c
2670
binutils/resrc.c
File diff suppressed because it is too large
Load Diff
@@ -1,663 +0,0 @@
|
||||
/* resres.c: read_res_file and write_res_file implementation for windres.
|
||||
Copyright 1998, 1999 Free Software Foundation, Inc.
|
||||
Written by Anders Norlander <anorland@hem2.passagen.se>.
|
||||
|
||||
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 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. */
|
||||
|
||||
/* FIXME: This file does not work correctly in a cross configuration.
|
||||
It assumes that it can use fread and fwrite to read and write
|
||||
integers. It does no swapping. */
|
||||
|
||||
#include "bfd.h"
|
||||
#include "bucomm.h"
|
||||
#include "libiberty.h"
|
||||
#include "windres.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <time.h>
|
||||
|
||||
struct res_hdr
|
||||
{
|
||||
unsigned long data_size;
|
||||
unsigned long header_size;
|
||||
};
|
||||
|
||||
static void write_res_directory
|
||||
PARAMS ((const struct res_directory *,
|
||||
const struct res_id *, const struct res_id *,
|
||||
int *, int));
|
||||
static void write_res_resource
|
||||
PARAMS ((const struct res_id *, const struct res_id *,
|
||||
const struct res_resource *, int *));
|
||||
static void write_res_bin
|
||||
PARAMS ((const struct res_resource *, const struct res_id *,
|
||||
const struct res_id *, const struct res_res_info *));
|
||||
|
||||
static void write_res_id PARAMS ((const struct res_id *));
|
||||
static void write_res_info PARAMS ((const struct res_res_info *));
|
||||
static void write_res_data PARAMS ((const void *, size_t, int));
|
||||
static void write_res_header
|
||||
PARAMS ((unsigned long, const struct res_id *, const struct res_id *,
|
||||
const struct res_res_info *));
|
||||
|
||||
static int read_resource_entry PARAMS ((void));
|
||||
static void read_res_data PARAMS ((void *, size_t, int));
|
||||
static void read_res_id PARAMS ((struct res_id *));
|
||||
static unichar *read_unistring PARAMS ((int *));
|
||||
static void skip_null_resource PARAMS ((void));
|
||||
|
||||
static unsigned long get_id_size PARAMS ((const struct res_id *));
|
||||
static void res_align_file PARAMS ((void));
|
||||
|
||||
static void
|
||||
res_add_resource
|
||||
PARAMS ((struct res_resource *, const struct res_id *,
|
||||
const struct res_id *, int, int));
|
||||
|
||||
void
|
||||
res_append_resource
|
||||
PARAMS ((struct res_directory **, struct res_resource *,
|
||||
int, const struct res_id *, int));
|
||||
|
||||
static struct res_directory *resources = NULL;
|
||||
|
||||
static FILE *fres;
|
||||
static const char *filename;
|
||||
|
||||
extern char *program_name;
|
||||
|
||||
/* Read resource file */
|
||||
struct res_directory *
|
||||
read_res_file (fn)
|
||||
const char *fn;
|
||||
{
|
||||
filename = fn;
|
||||
fres = fopen (filename, "rb");
|
||||
if (fres == NULL)
|
||||
fatal ("can't open `%s' for output: %s", filename, strerror (errno));
|
||||
|
||||
skip_null_resource ();
|
||||
|
||||
while (read_resource_entry ())
|
||||
;
|
||||
|
||||
fclose (fres);
|
||||
|
||||
return resources;
|
||||
}
|
||||
|
||||
/* Write resource file */
|
||||
void
|
||||
write_res_file (fn, resdir)
|
||||
const char *fn;
|
||||
const struct res_directory *resdir;
|
||||
{
|
||||
int language;
|
||||
static const unsigned char sign[] =
|
||||
{0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
long fpos;
|
||||
|
||||
filename = fn;
|
||||
|
||||
fres = fopen (filename, "wb");
|
||||
if (fres == NULL)
|
||||
fatal ("can't open `%s' for output: %s", filename, strerror (errno));
|
||||
|
||||
/* Write 32 bit resource signature */
|
||||
write_res_data (sign, sizeof (sign), 1);
|
||||
|
||||
/* write resources */
|
||||
|
||||
language = -1;
|
||||
write_res_directory (resdir, (const struct res_id *) NULL,
|
||||
(const struct res_id *) NULL, &language, 1);
|
||||
|
||||
/* end file on DWORD boundary */
|
||||
fpos = ftell (fres);
|
||||
if (fpos % 4)
|
||||
write_res_data (sign, fpos % 4, 1);
|
||||
|
||||
fclose (fres);
|
||||
}
|
||||
|
||||
/* Read a resource entry, returns 0 when all resources are read */
|
||||
static int
|
||||
read_resource_entry (void)
|
||||
{
|
||||
struct res_id type;
|
||||
struct res_id name;
|
||||
struct res_res_info resinfo;
|
||||
struct res_hdr reshdr;
|
||||
long version;
|
||||
void *buff;
|
||||
|
||||
struct res_resource *r;
|
||||
|
||||
res_align_file ();
|
||||
|
||||
/* Read header */
|
||||
if (fread (&reshdr, sizeof (reshdr), 1, fres) != 1)
|
||||
return 0;
|
||||
|
||||
/* read resource type */
|
||||
read_res_id (&type);
|
||||
/* read resource id */
|
||||
read_res_id (&name);
|
||||
|
||||
res_align_file ();
|
||||
|
||||
/* Read additional resource header */
|
||||
read_res_data (&resinfo.version, sizeof (resinfo.version), 1);
|
||||
read_res_data (&resinfo.memflags, sizeof (resinfo.memflags), 1);
|
||||
read_res_data (&resinfo.language, sizeof (resinfo.language), 1);
|
||||
read_res_data (&version, sizeof (version), 1);
|
||||
read_res_data (&resinfo.characteristics, sizeof (resinfo.characteristics), 1);
|
||||
|
||||
res_align_file ();
|
||||
|
||||
/* Allocate buffer for data */
|
||||
buff = res_alloc (reshdr.data_size);
|
||||
/* Read data */
|
||||
read_res_data (buff, reshdr.data_size, 1);
|
||||
/* Convert binary data to resource */
|
||||
r = bin_to_res (type, buff, reshdr.data_size, 0);
|
||||
r->res_info = resinfo;
|
||||
/* Add resource to resource directory */
|
||||
res_add_resource (r, &type, &name, resinfo.language, 0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* write resource directory to binary resource file */
|
||||
static void
|
||||
write_res_directory (rd, type, name, language, level)
|
||||
const struct res_directory *rd;
|
||||
const struct res_id *type;
|
||||
const struct res_id *name;
|
||||
int *language;
|
||||
int level;
|
||||
{
|
||||
const struct res_entry *re;
|
||||
|
||||
for (re = rd->entries; re != NULL; re = re->next)
|
||||
{
|
||||
switch (level)
|
||||
{
|
||||
case 1:
|
||||
/* If we're at level 1, the key of this resource is the
|
||||
type. This normally duplicates the information we have
|
||||
stored with the resource itself, but we need to remember
|
||||
the type if this is a user define resource type. */
|
||||
type = &re->id;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
/* If we're at level 2, the key of this resource is the name
|
||||
we are going to use in the rc printout. */
|
||||
name = &re->id;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* If we're at level 3, then this key represents a language.
|
||||
Use it to update the current language. */
|
||||
if (!re->id.named
|
||||
&& re->id.u.id != (unsigned long) *language
|
||||
&& (re->id.u.id & 0xffff) == re->id.u.id)
|
||||
{
|
||||
*language = re->id.u.id;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (re->subdir)
|
||||
write_res_directory (re->u.dir, type, name, language, level + 1);
|
||||
else
|
||||
{
|
||||
if (level == 3)
|
||||
{
|
||||
/* This is the normal case: the three levels are
|
||||
TYPE/NAME/LANGUAGE. NAME will have been set at level
|
||||
2, and represents the name to use. We probably just
|
||||
set LANGUAGE, and it will probably match what the
|
||||
resource itself records if anything. */
|
||||
write_res_resource (type, name, re->u.res, language);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf (stderr, "// Resource at unexpected level %d\n", level);
|
||||
write_res_resource (type, (struct res_id *) NULL, re->u.res,
|
||||
language);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
write_res_resource (type, name, res, language)
|
||||
const struct res_id *type;
|
||||
const struct res_id *name;
|
||||
const struct res_resource *res;
|
||||
int *language ATTRIBUTE_UNUSED;
|
||||
{
|
||||
int rt;
|
||||
|
||||
switch (res->type)
|
||||
{
|
||||
default:
|
||||
abort ();
|
||||
|
||||
case RES_TYPE_ACCELERATOR:
|
||||
rt = RT_ACCELERATOR;
|
||||
break;
|
||||
|
||||
case RES_TYPE_BITMAP:
|
||||
rt = RT_BITMAP;
|
||||
break;
|
||||
|
||||
case RES_TYPE_CURSOR:
|
||||
rt = RT_CURSOR;
|
||||
break;
|
||||
|
||||
case RES_TYPE_GROUP_CURSOR:
|
||||
rt = RT_GROUP_CURSOR;
|
||||
break;
|
||||
|
||||
case RES_TYPE_DIALOG:
|
||||
rt = RT_DIALOG;
|
||||
break;
|
||||
|
||||
case RES_TYPE_FONT:
|
||||
rt = RT_FONT;
|
||||
break;
|
||||
|
||||
case RES_TYPE_FONTDIR:
|
||||
rt = RT_FONTDIR;
|
||||
break;
|
||||
|
||||
case RES_TYPE_ICON:
|
||||
rt = RT_ICON;
|
||||
break;
|
||||
|
||||
case RES_TYPE_GROUP_ICON:
|
||||
rt = RT_GROUP_ICON;
|
||||
break;
|
||||
|
||||
case RES_TYPE_MENU:
|
||||
rt = RT_MENU;
|
||||
break;
|
||||
|
||||
case RES_TYPE_MESSAGETABLE:
|
||||
rt = RT_MESSAGETABLE;
|
||||
break;
|
||||
|
||||
case RES_TYPE_RCDATA:
|
||||
rt = RT_RCDATA;
|
||||
break;
|
||||
|
||||
case RES_TYPE_STRINGTABLE:
|
||||
rt = RT_STRING;
|
||||
break;
|
||||
|
||||
case RES_TYPE_USERDATA:
|
||||
rt = 0;
|
||||
break;
|
||||
|
||||
case RES_TYPE_VERSIONINFO:
|
||||
rt = RT_VERSION;
|
||||
break;
|
||||
}
|
||||
|
||||
if (rt != 0
|
||||
&& type != NULL
|
||||
&& (type->named || type->u.id != (unsigned long) rt))
|
||||
{
|
||||
fprintf (stderr, "// Unexpected resource type mismatch: ");
|
||||
res_id_print (stderr, *type, 1);
|
||||
fprintf (stderr, " != %d", rt);
|
||||
abort ();
|
||||
}
|
||||
|
||||
write_res_bin (res, type, name, &res->res_info);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Write a resource in binary resource format */
|
||||
static void
|
||||
write_res_bin (res, type, name, resinfo)
|
||||
const struct res_resource *res;
|
||||
const struct res_id *type;
|
||||
const struct res_id *name;
|
||||
const struct res_res_info *resinfo;
|
||||
{
|
||||
unsigned long datasize = 0;
|
||||
const struct bindata *bin_rep, *data;
|
||||
|
||||
bin_rep = res_to_bin (res, 0);
|
||||
for (data = bin_rep; data != NULL; data = data->next)
|
||||
datasize += data->length;
|
||||
|
||||
write_res_header (datasize, type, name, resinfo);
|
||||
|
||||
for (data = bin_rep; data != NULL; data = data->next)
|
||||
write_res_data (data->data, data->length, 1);
|
||||
}
|
||||
|
||||
/* Get number of bytes needed to store an id in binary format */
|
||||
static unsigned long
|
||||
get_id_size (id)
|
||||
const struct res_id *id;
|
||||
{
|
||||
if (id->named)
|
||||
return sizeof (unichar) * (id->u.n.length + 1);
|
||||
else
|
||||
return sizeof (unichar) * 2;
|
||||
}
|
||||
|
||||
/* Write a resource header */
|
||||
static void
|
||||
write_res_header (datasize, type, name, resinfo)
|
||||
unsigned long datasize;
|
||||
const struct res_id *type;
|
||||
const struct res_id *name;
|
||||
const struct res_res_info *resinfo;
|
||||
{
|
||||
struct res_hdr reshdr;
|
||||
reshdr.data_size = datasize;
|
||||
reshdr.header_size = 24 + get_id_size (type) + get_id_size (name);
|
||||
|
||||
reshdr.header_size = (reshdr.header_size + 3) & ~3;
|
||||
|
||||
res_align_file ();
|
||||
write_res_data (&reshdr, sizeof (reshdr), 1);
|
||||
write_res_id (type);
|
||||
write_res_id (name);
|
||||
|
||||
res_align_file ();
|
||||
|
||||
write_res_info (resinfo);
|
||||
res_align_file ();
|
||||
}
|
||||
|
||||
|
||||
/* Write data to file, abort on failure */
|
||||
static void
|
||||
write_res_data (data, size, count)
|
||||
const void *data;
|
||||
size_t size;
|
||||
int count;
|
||||
{
|
||||
if (fwrite (data, size, count, fres) != (size_t) count)
|
||||
fatal ("%s: could not write to file", filename);
|
||||
}
|
||||
|
||||
/* Read data from file, abort on failure */
|
||||
static void
|
||||
read_res_data (data, size, count)
|
||||
void *data;
|
||||
size_t size;
|
||||
int count;
|
||||
{
|
||||
if (fread (data, size, count, fres) != (size_t) count)
|
||||
fatal ("%s: unexpected end of file", filename);
|
||||
}
|
||||
|
||||
/* Write a resource id */
|
||||
static void
|
||||
write_res_id (id)
|
||||
const struct res_id *id;
|
||||
{
|
||||
if (id->named)
|
||||
{
|
||||
unsigned long len = id->u.n.length;
|
||||
unichar null_term = 0;
|
||||
write_res_data (id->u.n.name, len * sizeof (unichar), 1);
|
||||
write_res_data (&null_term, sizeof (null_term), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned short i = 0xFFFF;
|
||||
write_res_data (&i, sizeof (i), 1);
|
||||
i = id->u.id;
|
||||
write_res_data (&i, sizeof (i), 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Write resource info */
|
||||
static void
|
||||
write_res_info (info)
|
||||
const struct res_res_info *info;
|
||||
{
|
||||
write_res_data (&info->version, sizeof (info->version), 1);
|
||||
write_res_data (&info->memflags, sizeof (info->memflags), 1);
|
||||
write_res_data (&info->language, sizeof (info->language), 1);
|
||||
write_res_data (&info->version, sizeof (info->version), 1);
|
||||
write_res_data (&info->characteristics, sizeof (info->characteristics), 1);
|
||||
}
|
||||
|
||||
/* read a resource identifier */
|
||||
void
|
||||
read_res_id (id)
|
||||
struct res_id *id;
|
||||
{
|
||||
unsigned short ord;
|
||||
unichar *id_s = NULL;
|
||||
int len;
|
||||
|
||||
read_res_data (&ord, sizeof (ord), 1);
|
||||
if (ord == 0xFFFF) /* an ordinal id */
|
||||
{
|
||||
read_res_data (&ord, sizeof (ord), 1);
|
||||
id->named = 0;
|
||||
id->u.id = ord;
|
||||
}
|
||||
else
|
||||
/* named id */
|
||||
{
|
||||
if (fseek (fres, -sizeof (ord), SEEK_CUR) != 0)
|
||||
fatal ("%s: %s: could not seek in file", program_name, filename);
|
||||
id_s = read_unistring (&len);
|
||||
id->named = 1;
|
||||
id->u.n.length = len;
|
||||
id->u.n.name = id_s;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read a null terminated UNICODE string */
|
||||
static unichar *
|
||||
read_unistring (len)
|
||||
int *len;
|
||||
{
|
||||
unichar *s;
|
||||
unichar c;
|
||||
unichar *p;
|
||||
int l;
|
||||
|
||||
*len = 0;
|
||||
l = 0;
|
||||
|
||||
/* there are hardly any names longer than 256 characters */
|
||||
p = s = (unichar *) xmalloc (sizeof (unichar) * 256);
|
||||
do
|
||||
{
|
||||
read_res_data (&c, sizeof (c), 1);
|
||||
*p++ = c;
|
||||
if (c != 0)
|
||||
l++;
|
||||
}
|
||||
while (c != 0);
|
||||
*len = l;
|
||||
return s;
|
||||
}
|
||||
|
||||
/* align file on DWORD boundary */
|
||||
static void
|
||||
res_align_file (void)
|
||||
{
|
||||
int pos = ftell (fres);
|
||||
int skip = ((pos + 3) & ~3) - pos;
|
||||
if (fseek (fres, skip, SEEK_CUR) != 0)
|
||||
fatal ("%s: %s: unable to align file", program_name, filename);
|
||||
}
|
||||
|
||||
/* Check if file is a win32 binary resource file, if so
|
||||
skip past the null resource. Returns 0 if successful, -1 on
|
||||
error.
|
||||
*/
|
||||
static void
|
||||
skip_null_resource (void)
|
||||
{
|
||||
struct res_hdr reshdr =
|
||||
{0, 0};
|
||||
read_res_data (&reshdr, sizeof (reshdr), 1);
|
||||
if ((reshdr.data_size != 0) || (reshdr.header_size != 0x20))
|
||||
goto skip_err;
|
||||
|
||||
/* Subtract size of HeaderSize and DataSize */
|
||||
if (fseek (fres, reshdr.header_size - 8, SEEK_CUR) != 0)
|
||||
goto skip_err;
|
||||
|
||||
return;
|
||||
|
||||
skip_err:
|
||||
fprintf (stderr, "%s: %s: Not a valid WIN32 resource file\n", program_name,
|
||||
filename);
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
/* Add a resource to resource directory */
|
||||
void
|
||||
res_add_resource (r, type, id, language, dupok)
|
||||
struct res_resource *r;
|
||||
const struct res_id *type;
|
||||
const struct res_id *id;
|
||||
int language;
|
||||
int dupok;
|
||||
{
|
||||
struct res_id a[3];
|
||||
|
||||
a[0] = *type;
|
||||
a[1] = *id;
|
||||
a[2].named = 0;
|
||||
a[2].u.id = language;
|
||||
res_append_resource (&resources, r, 3, a, dupok);
|
||||
}
|
||||
|
||||
/* Append a resource to resource directory.
|
||||
This is just copied from define_resource
|
||||
and modified to add an existing resource.
|
||||
*/
|
||||
void
|
||||
res_append_resource (resources, resource, cids, ids, dupok)
|
||||
struct res_directory **resources;
|
||||
struct res_resource *resource;
|
||||
int cids;
|
||||
const struct res_id *ids;
|
||||
int dupok;
|
||||
{
|
||||
struct res_entry *re = NULL;
|
||||
int i;
|
||||
|
||||
assert (cids > 0);
|
||||
for (i = 0; i < cids; i++)
|
||||
{
|
||||
struct res_entry **pp;
|
||||
|
||||
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 = timeval;
|
||||
(*resources)->major = 0;
|
||||
(*resources)->minor = 0;
|
||||
(*resources)->entries = NULL;
|
||||
}
|
||||
|
||||
for (pp = &(*resources)->entries; *pp != NULL; pp = &(*pp)->next)
|
||||
if (res_id_cmp ((*pp)->id, ids[i]) == 0)
|
||||
break;
|
||||
|
||||
if (*pp != NULL)
|
||||
re = *pp;
|
||||
else
|
||||
{
|
||||
re = (struct res_entry *) res_alloc (sizeof *re);
|
||||
re->next = NULL;
|
||||
re->id = ids[i];
|
||||
if ((i + 1) < cids)
|
||||
{
|
||||
re->subdir = 1;
|
||||
re->u.dir = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
re->subdir = 0;
|
||||
re->u.res = NULL;
|
||||
}
|
||||
|
||||
*pp = re;
|
||||
}
|
||||
|
||||
if ((i + 1) < cids)
|
||||
{
|
||||
if (!re->subdir)
|
||||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
res_ids_print (stderr, i, ids);
|
||||
fprintf (stderr, ": expected to be a directory\n");
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
resources = &re->u.dir;
|
||||
}
|
||||
}
|
||||
|
||||
if (re->subdir)
|
||||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
res_ids_print (stderr, cids, ids);
|
||||
fprintf (stderr, ": expected to be a leaf\n");
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
if (re->u.res != NULL)
|
||||
{
|
||||
if (dupok)
|
||||
return;
|
||||
|
||||
fprintf (stderr, "%s: warning: ", program_name);
|
||||
res_ids_print (stderr, cids, ids);
|
||||
fprintf (stderr, ": duplicate value\n");
|
||||
}
|
||||
|
||||
re->u.res = resource;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
#!/bin/sh
|
||||
### quick sanity test for the binutils.
|
||||
###
|
||||
### This file was written and is maintained by K. Richard Pixley,
|
||||
### rich@cygnus.com.
|
||||
|
||||
### fail on errors
|
||||
set -e
|
||||
|
||||
### first arg is directory in which binaries to be tested reside.
|
||||
case "$1" in
|
||||
"") BIN=. ;;
|
||||
*) BIN="$1" ;;
|
||||
esac
|
||||
|
||||
### size
|
||||
for i in size objdump nm ar strip ranlib ; do
|
||||
${BIN}/size ${BIN}/$i > /dev/null
|
||||
done
|
||||
|
||||
### objdump
|
||||
for i in size objdump nm ar strip ranlib ; do
|
||||
${BIN}/objdump -ahifdrtxsl ${BIN}/$i > /dev/null
|
||||
done
|
||||
|
||||
### nm
|
||||
for i in size objdump nm ar strip ranlib ; do
|
||||
${BIN}/nm ${BIN}/$i > /dev/null
|
||||
done
|
||||
|
||||
### strip
|
||||
TMPDIR=./binutils-$$
|
||||
mkdir ${TMPDIR}
|
||||
|
||||
cp ${BIN}/strip ${TMPDIR}/strip
|
||||
|
||||
for i in size objdump nm ar ranlib ; do
|
||||
cp ${BIN}/$i ${TMPDIR}/$i
|
||||
${BIN}/strip ${TMPDIR}/$i
|
||||
cp ${BIN}/$i ${TMPDIR}/$i
|
||||
${TMPDIR}/strip ${TMPDIR}/$i
|
||||
done
|
||||
|
||||
### ar
|
||||
|
||||
### ranlib
|
||||
|
||||
rm -rf ${TMPDIR}
|
||||
|
||||
exit 0
|
||||
527
binutils/size.c
527
binutils/size.c
@@ -1,527 +0,0 @@
|
||||
/* size.c -- report size of various sections of an executable file.
|
||||
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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. */
|
||||
|
||||
/* Extensions/incompatibilities:
|
||||
o - BSD output has filenames at the end.
|
||||
o - BSD output can appear in different radicies.
|
||||
o - SysV output has less redundant whitespace. Filename comes at end.
|
||||
o - SysV output doesn't show VMA which is always the same as the PMA.
|
||||
o - We also handle core files.
|
||||
o - We also handle archives.
|
||||
If you write shell scripts which manipulate this info then you may be
|
||||
out of luck; there's no --compatibility or --pedantic option.
|
||||
*/
|
||||
|
||||
#include "bfd.h"
|
||||
#include "getopt.h"
|
||||
#include "bucomm.h"
|
||||
#include "libiberty.h"
|
||||
|
||||
#ifndef BSD_DEFAULT
|
||||
#define BSD_DEFAULT 1
|
||||
#endif
|
||||
|
||||
/* Program options. */
|
||||
|
||||
enum
|
||||
{
|
||||
decimal, octal, hex
|
||||
} radix = decimal;
|
||||
int berkeley_format = BSD_DEFAULT; /* 0 means use AT&T-style output. */
|
||||
int show_version = 0;
|
||||
int show_help = 0;
|
||||
|
||||
/* Program exit status. */
|
||||
int return_code = 0;
|
||||
|
||||
static char *target = NULL;
|
||||
|
||||
/* 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));
|
||||
|
||||
static void
|
||||
usage (stream, status)
|
||||
FILE *stream;
|
||||
int status;
|
||||
{
|
||||
fprintf (stream, _("\
|
||||
Usage: %s [-A | --format=sysv | -B | --format=berkeley]\n\
|
||||
[-o | --radix=8 | -d | --radix=10 | -h | --radix=16]\n\
|
||||
[-V | --version] [--target=bfdname] [--help] [file...]\n"),
|
||||
program_name);
|
||||
#if BSD_DEFAULT
|
||||
fputs (_("default is --format=berkeley\n"), stream);
|
||||
#else
|
||||
fputs (_("default is --format=sysv\n"), stream);
|
||||
#endif
|
||||
list_supported_targets (program_name, stream);
|
||||
if (status == 0)
|
||||
fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO);
|
||||
exit (status);
|
||||
}
|
||||
|
||||
struct option long_options[] =
|
||||
{
|
||||
{"format", required_argument, 0, 200},
|
||||
{"radix", required_argument, 0, 201},
|
||||
{"target", required_argument, 0, 202},
|
||||
{"version", no_argument, &show_version, 1},
|
||||
{"help", no_argument, &show_help, 1},
|
||||
{0, no_argument, 0, 0}
|
||||
};
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int temp;
|
||||
int c;
|
||||
|
||||
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
|
||||
setlocale (LC_MESSAGES, "");
|
||||
#endif
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
program_name = *argv;
|
||||
xmalloc_set_program_name (program_name);
|
||||
|
||||
bfd_init ();
|
||||
set_default_bfd_target ();
|
||||
|
||||
while ((c = getopt_long (argc, argv, "ABVdfox", long_options,
|
||||
(int *) 0)) != EOF)
|
||||
switch (c)
|
||||
{
|
||||
case 200: /* --format */
|
||||
switch (*optarg)
|
||||
{
|
||||
case 'B':
|
||||
case 'b':
|
||||
berkeley_format = 1;
|
||||
break;
|
||||
case 'S':
|
||||
case 's':
|
||||
berkeley_format = 0;
|
||||
break;
|
||||
default:
|
||||
non_fatal (_("invalid argument to --format: %s"), optarg);
|
||||
usage (stderr, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 202: /* --target */
|
||||
target = optarg;
|
||||
break;
|
||||
|
||||
case 201: /* --radix */
|
||||
#ifdef ANSI_LIBRARIES
|
||||
temp = strtol (optarg, NULL, 10);
|
||||
#else
|
||||
temp = atol (optarg);
|
||||
#endif
|
||||
switch (temp)
|
||||
{
|
||||
case 10:
|
||||
radix = decimal;
|
||||
break;
|
||||
case 8:
|
||||
radix = octal;
|
||||
break;
|
||||
case 16:
|
||||
radix = hex;
|
||||
break;
|
||||
default:
|
||||
non_fatal (_("Invalid radix: %s\n"), optarg);
|
||||
usage (stderr, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
berkeley_format = 0;
|
||||
break;
|
||||
case 'B':
|
||||
berkeley_format = 1;
|
||||
break;
|
||||
case 'V':
|
||||
show_version = 1;
|
||||
break;
|
||||
case 'd':
|
||||
radix = decimal;
|
||||
break;
|
||||
case 'x':
|
||||
radix = hex;
|
||||
break;
|
||||
case 'o':
|
||||
radix = octal;
|
||||
break;
|
||||
case 'f': /* FIXME : For sysv68, `-f' means `full format', i.e.
|
||||
`[fname:] M(.text) + N(.data) + O(.bss) + P(.comment) = Q'
|
||||
where `fname: ' appears only if there are >= 2 input files,
|
||||
and M, N, O, P, Q are expressed in decimal by default,
|
||||
hexa or octal if requested by `-x' or `-o'.
|
||||
Just to make things interesting, Solaris also accepts -f,
|
||||
which prints out the size of each allocatable section, the
|
||||
name of the section, and the total of the section sizes. */
|
||||
/* For the moment, accept `-f' silently, and ignore it. */
|
||||
break;
|
||||
case 0:
|
||||
break;
|
||||
case '?':
|
||||
usage (stderr, 1);
|
||||
}
|
||||
|
||||
if (show_version)
|
||||
print_version ("size");
|
||||
if (show_help)
|
||||
usage (stdout, 0);
|
||||
|
||||
if (optind == argc)
|
||||
display_file ("a.out");
|
||||
else
|
||||
for (; optind < argc;)
|
||||
display_file (argv[optind++]);
|
||||
|
||||
return return_code;
|
||||
}
|
||||
|
||||
/* Display stats on file or archive member ABFD. */
|
||||
|
||||
static void
|
||||
display_bfd (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
char **matching;
|
||||
|
||||
if (bfd_check_format (abfd, bfd_archive))
|
||||
/* An archive within an archive. */
|
||||
return;
|
||||
|
||||
if (bfd_check_format_matches (abfd, bfd_object, &matching))
|
||||
{
|
||||
print_sizes (abfd);
|
||||
printf ("\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
|
||||
{
|
||||
bfd_nonfatal (bfd_get_filename (abfd));
|
||||
list_matching_formats (matching);
|
||||
free (matching);
|
||||
return_code = 3;
|
||||
return;
|
||||
}
|
||||
|
||||
if (bfd_check_format_matches (abfd, bfd_core, &matching))
|
||||
{
|
||||
CONST char *core_cmd;
|
||||
|
||||
print_sizes (abfd);
|
||||
fputs (" (core file", stdout);
|
||||
|
||||
core_cmd = bfd_core_file_failing_command (abfd);
|
||||
if (core_cmd)
|
||||
printf (" invoked as %s", core_cmd);
|
||||
|
||||
puts (")\n");
|
||||
return;
|
||||
}
|
||||
|
||||
bfd_nonfatal (bfd_get_filename (abfd));
|
||||
|
||||
if (bfd_get_error () == bfd_error_file_ambiguously_recognized)
|
||||
{
|
||||
list_matching_formats (matching);
|
||||
free (matching);
|
||||
}
|
||||
|
||||
return_code = 3;
|
||||
}
|
||||
|
||||
static void
|
||||
display_archive (file)
|
||||
bfd *file;
|
||||
{
|
||||
bfd *arfile = (bfd *) NULL;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
bfd_set_error (bfd_error_no_error);
|
||||
|
||||
arfile = bfd_openr_next_archived_file (file, arfile);
|
||||
if (arfile == NULL)
|
||||
{
|
||||
if (bfd_get_error () != bfd_error_no_more_archived_files)
|
||||
{
|
||||
bfd_nonfatal (bfd_get_filename (file));
|
||||
return_code = 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
display_bfd (arfile);
|
||||
/* Don't close the archive elements; we need them for next_archive */
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
display_file (filename)
|
||||
char *filename;
|
||||
{
|
||||
bfd *file = bfd_openr (filename, target);
|
||||
if (file == NULL)
|
||||
{
|
||||
bfd_nonfatal (filename);
|
||||
return_code = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (bfd_check_format (file, bfd_archive) == true)
|
||||
display_archive (file);
|
||||
else
|
||||
display_bfd (file);
|
||||
|
||||
if (bfd_close (file) == false)
|
||||
{
|
||||
bfd_nonfatal (filename);
|
||||
return_code = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* This is what lexical functions are for. */
|
||||
|
||||
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;
|
||||
{
|
||||
char buffer[40];
|
||||
sprintf (buffer,
|
||||
(radix == decimal ? "%lu" :
|
||||
((radix == octal) ? "0%lo" : "0x%lx")),
|
||||
(unsigned long) num);
|
||||
|
||||
printf ("%-*s", width, buffer);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
rprint_number (width, num)
|
||||
int width;
|
||||
bfd_size_type 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;
|
||||
static bfd_size_type datasize;
|
||||
static bfd_size_type textsize;
|
||||
|
||||
static void
|
||||
berkeley_sum (abfd, sec, ignore)
|
||||
bfd *abfd ATTRIBUTE_UNUSED;
|
||||
sec_ptr sec;
|
||||
PTR ignore ATTRIBUTE_UNUSED;
|
||||
{
|
||||
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 ((flags & SEC_CODE) != 0 || (flags & SEC_READONLY) != 0)
|
||||
textsize += size;
|
||||
else if ((flags & SEC_HAS_CONTENTS) != 0)
|
||||
datasize += size;
|
||||
else
|
||||
bsssize += size;
|
||||
}
|
||||
|
||||
static void
|
||||
print_berkeley_format (abfd)
|
||||
bfd *abfd;
|
||||
{
|
||||
static int files_seen = 0;
|
||||
bfd_size_type total;
|
||||
|
||||
bsssize = 0;
|
||||
datasize = 0;
|
||||
textsize = 0;
|
||||
|
||||
bfd_map_over_sections (abfd, berkeley_sum, (PTR) NULL);
|
||||
|
||||
if (files_seen++ == 0)
|
||||
#if 0
|
||||
/* Intel doesn't like bss/stk because they don't have core files. */
|
||||
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\t data\t bss\t oct\t hex\tfilename" :
|
||||
" text\t data\t bss\t dec\t hex\tfilename");
|
||||
#endif
|
||||
|
||||
total = textsize + datasize + bsssize;
|
||||
|
||||
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);
|
||||
if (bfd_my_archive (abfd))
|
||||
printf (" (ex %s)", bfd_get_filename (bfd_my_archive (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;
|
||||
|
||||
static void
|
||||
sysv_internal_sizer (file, sec, ignore)
|
||||
bfd *file ATTRIBUTE_UNUSED;
|
||||
sec_ptr sec;
|
||||
PTR ignore ATTRIBUTE_UNUSED;
|
||||
{
|
||||
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 ATTRIBUTE_UNUSED;
|
||||
sec_ptr sec;
|
||||
PTR ignore ATTRIBUTE_UNUSED;
|
||||
{
|
||||
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))
|
||||
{
|
||||
svi_total += size;
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
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)));
|
||||
|
||||
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 ("%-*s ", svi_namelen, "Total");
|
||||
rprint_number (svi_sizelen, svi_total);
|
||||
printf ("\n\n");
|
||||
}
|
||||
|
||||
static void
|
||||
print_sizes (file)
|
||||
bfd *file;
|
||||
{
|
||||
if (berkeley_format)
|
||||
print_berkeley_format (file);
|
||||
else
|
||||
print_sysv_format (file);
|
||||
}
|
||||
2031
binutils/srconv.c
2031
binutils/srconv.c
File diff suppressed because it is too large
Load Diff
5200
binutils/stabs.c
5200
binutils/stabs.c
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
timestamp
|
||||
@@ -1,535 +0,0 @@
|
||||
/* strings -- print the strings of printable characters in files
|
||||
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
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
|
||||
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, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
/* Usage: strings [options] file...
|
||||
|
||||
Options:
|
||||
--all
|
||||
-a
|
||||
- Do not scan only the initialized data section of object files.
|
||||
|
||||
--print-file-name
|
||||
-f Print the name of the file before each string.
|
||||
|
||||
--bytes=min-len
|
||||
-n min-len
|
||||
-min-len Print graphic char sequences, MIN-LEN or more bytes long,
|
||||
that are followed by a NUL or a newline. Default is 4.
|
||||
|
||||
--radix={o,x,d}
|
||||
-t {o,x,d} Print the offset within the file before each string,
|
||||
in octal/hex/decimal.
|
||||
|
||||
-o Like -to. (Some other implementations have -o like -to,
|
||||
others like -td. We chose one arbitrarily.)
|
||||
|
||||
--target=BFDNAME
|
||||
Specify a non-default object file format.
|
||||
|
||||
--help
|
||||
-h Print the usage message on the standard output.
|
||||
|
||||
--version
|
||||
-v Print the program version number.
|
||||
|
||||
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 "bucomm.h"
|
||||
#include "libiberty.h"
|
||||
|
||||
/* Some platforms need to put stdin into binary mode, to read
|
||||
binary files. */
|
||||
#ifdef HAVE_SETMODE
|
||||
#ifndef O_BINARY
|
||||
#ifdef _O_BINARY
|
||||
#define O_BINARY _O_BINARY
|
||||
#define setmode _setmode
|
||||
#else
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
#endif
|
||||
#if O_BINARY
|
||||
#include <io.h>
|
||||
#define SET_BINARY(f) do { if (!isatty(f)) setmode(f,O_BINARY); } while (0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Not all printable characters have ASCII codes (depending upon the
|
||||
LOCALE set) but on some older systems it is not safe to test isprint
|
||||
without first testing isascii... */
|
||||
#if defined isascii && !defined HAVE_LOCALE_H
|
||||
#define isgraphic(c) (isascii (c) && (isprint (c) || (c) == '\t'))
|
||||
#else
|
||||
#define isgraphic(c) (isprint (c) || (c) == '\t')
|
||||
#endif
|
||||
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
/* The BFD section flags that identify an initialized data section. */
|
||||
#define DATA_FLAGS (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS)
|
||||
|
||||
/* Radix for printing addresses (must be 8, 10 or 16). */
|
||||
static int address_radix;
|
||||
|
||||
/* Minimum length of sequence of graphic chars to trigger output. */
|
||||
static int string_min;
|
||||
|
||||
/* true means print address within file for each string. */
|
||||
static boolean print_addresses;
|
||||
|
||||
/* true means print filename for each string. */
|
||||
static boolean print_filenames;
|
||||
|
||||
/* true means for object files scan only the data section. */
|
||||
static boolean datasection_only;
|
||||
|
||||
/* true if we found an initialized data section in the current file. */
|
||||
static boolean got_a_section;
|
||||
|
||||
/* The BFD object file format. */
|
||||
static char *target;
|
||||
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"all", no_argument, NULL, 'a'},
|
||||
{"print-file-name", no_argument, NULL, 'f'},
|
||||
{"bytes", required_argument, NULL, 'n'},
|
||||
{"radix", required_argument, NULL, 't'},
|
||||
{"target", required_argument, NULL, 'T'},
|
||||
{"help", no_argument, NULL, 'h'},
|
||||
{"version", no_argument, NULL, 'v'},
|
||||
{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 ((const char *filename, FILE *stream,
|
||||
file_ptr address, int stop_point,
|
||||
int magiccount, char *magic));
|
||||
static void usage PARAMS ((FILE *stream, int status));
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int optc;
|
||||
int exit_status = 0;
|
||||
boolean files_given = false;
|
||||
|
||||
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
|
||||
setlocale (LC_ALL, "");
|
||||
#endif
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
program_name = argv[0];
|
||||
xmalloc_set_program_name (program_name);
|
||||
string_min = -1;
|
||||
print_addresses = false;
|
||||
print_filenames = false;
|
||||
datasection_only = true;
|
||||
target = NULL;
|
||||
|
||||
while ((optc = getopt_long (argc, argv, "afn:ot:v0123456789",
|
||||
long_options, (int *) 0)) != EOF)
|
||||
{
|
||||
switch (optc)
|
||||
{
|
||||
case 'a':
|
||||
datasection_only = false;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
print_filenames = true;
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
usage (stdout, 0);
|
||||
|
||||
case 'n':
|
||||
string_min = integer_arg (optarg);
|
||||
if (string_min < 1)
|
||||
{
|
||||
fatal (_("invalid number %s"), optarg);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
print_addresses = true;
|
||||
address_radix = 8;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
print_addresses = true;
|
||||
if (optarg[1] != '\0')
|
||||
usage (stderr, 1);
|
||||
switch (optarg[0])
|
||||
{
|
||||
case 'o':
|
||||
address_radix = 8;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
address_radix = 10;
|
||||
break;
|
||||
|
||||
case 'x':
|
||||
address_radix = 16;
|
||||
break;
|
||||
|
||||
default:
|
||||
usage (stderr, 1);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
target = optarg;
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
print_version ("strings");
|
||||
break;
|
||||
|
||||
case '?':
|
||||
usage (stderr, 1);
|
||||
|
||||
default:
|
||||
if (string_min < 0)
|
||||
string_min = optc - '0';
|
||||
else
|
||||
string_min = string_min * 10 + optc - '0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (string_min < 0)
|
||||
string_min = 4;
|
||||
|
||||
bfd_init ();
|
||||
set_default_bfd_target ();
|
||||
|
||||
if (optind >= argc)
|
||||
{
|
||||
datasection_only = false;
|
||||
#ifdef SET_BINARY
|
||||
SET_BINARY (fileno (stdin));
|
||||
#endif
|
||||
print_strings ("{standard input}", stdin, 0, 0, 0, (char *) NULL);
|
||||
files_given = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (; optind < argc; ++optind)
|
||||
{
|
||||
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);
|
||||
|
||||
return (exit_status);
|
||||
}
|
||||
|
||||
/* Scan section SECT of the file ABFD, whose printable name is FILE.
|
||||
If it contains initialized data,
|
||||
set `got_a_section' and print the strings in it. */
|
||||
|
||||
static void
|
||||
strings_a_section (abfd, sect, filearg)
|
||||
bfd *abfd;
|
||||
asection *sect;
|
||||
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);
|
||||
PTR mem = xmalloc (sz);
|
||||
if (bfd_get_section_contents (abfd, sect, mem, (file_ptr) 0, sz))
|
||||
{
|
||||
got_a_section = true;
|
||||
print_strings (file, (FILE *) NULL, sect->filepos, 0, sz, mem);
|
||||
}
|
||||
free (mem);
|
||||
}
|
||||
}
|
||||
|
||||
/* Scan all of the sections in FILE, and print the strings
|
||||
in the initialized data section(s).
|
||||
|
||||
Return true if successful,
|
||||
false if not (such as if FILE is not an object file). */
|
||||
|
||||
static boolean
|
||||
strings_object_file (file)
|
||||
const char *file;
|
||||
{
|
||||
bfd *abfd = bfd_openr (file, target);
|
||||
|
||||
if (abfd == NULL)
|
||||
{
|
||||
/* Treat the file as a non-object file. */
|
||||
return false;
|
||||
}
|
||||
|
||||
/* This call is mainly for its side effect of reading in the sections.
|
||||
We follow the traditional behavior of `strings' in that we don't
|
||||
complain if we don't recognize a file to be an object file. */
|
||||
if (bfd_check_format (abfd, bfd_object) == false)
|
||||
{
|
||||
bfd_close (abfd);
|
||||
return false;
|
||||
}
|
||||
|
||||
got_a_section = false;
|
||||
bfd_map_over_sections (abfd, strings_a_section, (PTR) file);
|
||||
|
||||
if (!bfd_close (abfd))
|
||||
{
|
||||
bfd_nonfatal (file);
|
||||
return false;
|
||||
}
|
||||
|
||||
return got_a_section;
|
||||
}
|
||||
|
||||
/* Print the strings in FILE. Return true if ok, false if an error occurs. */
|
||||
|
||||
static boolean
|
||||
strings_file (file)
|
||||
char *file;
|
||||
{
|
||||
/* If we weren't told to scan the whole file,
|
||||
try to open it as an object file and only look at
|
||||
initialized data sections. If that fails, fall back to the
|
||||
whole file. */
|
||||
if (!datasection_only || !strings_object_file (file))
|
||||
{
|
||||
FILE *stream;
|
||||
|
||||
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);
|
||||
perror (file);
|
||||
return false;
|
||||
}
|
||||
|
||||
print_strings (file, stream, (file_ptr) 0, 0, 0, (char *) 0);
|
||||
|
||||
if (fclose (stream) == EOF)
|
||||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
perror (file);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Find the strings in file FILENAME, read from STREAM.
|
||||
Assume that STREAM is positioned so that the next byte read
|
||||
is at address ADDRESS in the file.
|
||||
Stop reading at address STOP_POINT in the file, if nonzero.
|
||||
|
||||
If STREAM is NULL, do not read from it.
|
||||
The caller can supply a buffer of characters
|
||||
to be processed before the data in STREAM.
|
||||
MAGIC is the address of the buffer and
|
||||
MAGICCOUNT is how many characters are in it.
|
||||
Those characters come at address ADDRESS and the data in STREAM follow. */
|
||||
|
||||
static void
|
||||
print_strings (filename, stream, address, stop_point, magiccount, magic)
|
||||
const char *filename;
|
||||
FILE *stream;
|
||||
file_ptr address;
|
||||
int stop_point;
|
||||
int magiccount;
|
||||
char *magic;
|
||||
{
|
||||
char *buf = (char *) xmalloc (string_min + 1);
|
||||
|
||||
while (1)
|
||||
{
|
||||
file_ptr start;
|
||||
int i;
|
||||
int c;
|
||||
|
||||
/* See if the next `string_min' chars are all graphic chars. */
|
||||
tryline:
|
||||
if (stop_point && address >= stop_point)
|
||||
break;
|
||||
start = address;
|
||||
for (i = 0; i < string_min; i++)
|
||||
{
|
||||
if (magiccount)
|
||||
{
|
||||
magiccount--;
|
||||
c = *magic++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (stream == NULL)
|
||||
return;
|
||||
c = getc (stream);
|
||||
if (c == EOF)
|
||||
return;
|
||||
}
|
||||
address++;
|
||||
if (!isgraphic (c))
|
||||
/* Found a non-graphic. Try again starting with next char. */
|
||||
goto tryline;
|
||||
buf[i] = c;
|
||||
}
|
||||
|
||||
/* 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 (magiccount)
|
||||
{
|
||||
magiccount--;
|
||||
c = *magic++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (stream == NULL)
|
||||
break;
|
||||
c = getc (stream);
|
||||
if (c == EOF)
|
||||
break;
|
||||
}
|
||||
address++;
|
||||
if (! isgraphic (c))
|
||||
break;
|
||||
putchar (c);
|
||||
}
|
||||
|
||||
putchar ('\n');
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse string S as an integer, using decimal radix by default,
|
||||
but allowing octal and hex numbers as in C. */
|
||||
|
||||
static int
|
||||
integer_arg (s)
|
||||
char *s;
|
||||
{
|
||||
int value;
|
||||
int radix = 10;
|
||||
char *p = s;
|
||||
int c;
|
||||
|
||||
if (*p != '0')
|
||||
radix = 10;
|
||||
else if (*++p == 'x')
|
||||
{
|
||||
radix = 16;
|
||||
p++;
|
||||
}
|
||||
else
|
||||
radix = 8;
|
||||
|
||||
value = 0;
|
||||
while (((c = *p++) >= '0' && c <= '9')
|
||||
|| (radix == 16 && (c & ~40) >= 'A' && (c & ~40) <= 'Z'))
|
||||
{
|
||||
value *= radix;
|
||||
if (c >= '0' && c <= '9')
|
||||
value += c - '0';
|
||||
else
|
||||
value += (c & ~40) - 'A';
|
||||
}
|
||||
|
||||
if (c == 'b')
|
||||
value *= 512;
|
||||
else if (c == 'B')
|
||||
value *= 1024;
|
||||
else
|
||||
p--;
|
||||
|
||||
if (*p)
|
||||
{
|
||||
fatal (_("invalid integer argument %s"), s);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
static void
|
||||
usage (stream, status)
|
||||
FILE *stream;
|
||||
int status;
|
||||
{
|
||||
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"),
|
||||
program_name);
|
||||
list_supported_targets (program_name, stream);
|
||||
if (status == 0)
|
||||
fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO);
|
||||
exit (status);
|
||||
}
|
||||
@@ -1,786 +0,0 @@
|
||||
/* Sysroff object format dumper.
|
||||
Copyright 1994, 1995, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Binutils.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 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.
|
||||
|
||||
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>.
|
||||
|
||||
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"
|
||||
|
||||
#define PROGRAM_VERSION "1.0"
|
||||
|
||||
static int dump = 1;
|
||||
static int segmented_p;
|
||||
static int code;
|
||||
static int addrsize = 4;
|
||||
static FILE *file;
|
||||
|
||||
char *
|
||||
getCHARS (ptr, idx, size, max)
|
||||
unsigned char *ptr;
|
||||
int *idx;
|
||||
int size;
|
||||
int max;
|
||||
{
|
||||
int oc = *idx / 8;
|
||||
char *r;
|
||||
int b = size;
|
||||
if (b >= max)
|
||||
{
|
||||
return "*undefined*";
|
||||
}
|
||||
|
||||
if (b == 0)
|
||||
{
|
||||
/* Got to work out the length of the string from self */
|
||||
b = ptr[oc++];
|
||||
(*idx) += 8;
|
||||
}
|
||||
|
||||
*idx += b * 8;
|
||||
r = xcalloc (b + 1, 1);
|
||||
memcpy (r, ptr + oc, b);
|
||||
r[b] = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
static void
|
||||
dh (ptr, size)
|
||||
unsigned char *ptr;
|
||||
int size;
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int span = 16;
|
||||
|
||||
printf ("\n************************************************************\n");
|
||||
|
||||
for (i = 0; i < size; i += span)
|
||||
{
|
||||
for (j = 0; j < span; j++)
|
||||
{
|
||||
if (j + i < size)
|
||||
printf ("%02x ", ptr[i + j]);
|
||||
else
|
||||
printf (" ");
|
||||
}
|
||||
|
||||
for (j = 0; j < span && j + i < size; j++)
|
||||
{
|
||||
int c = ptr[i + j];
|
||||
if (c < 32 || c > 127)
|
||||
c = '.';
|
||||
printf ("%c", c);
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
fillup (ptr)
|
||||
char *ptr;
|
||||
{
|
||||
int size;
|
||||
int sum;
|
||||
int i;
|
||||
size = getc (file) - 2;
|
||||
fread (ptr, 1, size, file);
|
||||
sum = code + size + 2;
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
sum += ptr[i];
|
||||
}
|
||||
|
||||
if ((sum & 0xff) != 0xff)
|
||||
{
|
||||
printf ("SUM IS %x\n", sum);
|
||||
}
|
||||
if (dump)
|
||||
dh (ptr, size);
|
||||
|
||||
return size - 1;
|
||||
}
|
||||
|
||||
barray
|
||||
getBARRAY (ptr, idx, dsize, max)
|
||||
unsigned char *ptr;
|
||||
int *idx;
|
||||
int dsize ATTRIBUTE_UNUSED;
|
||||
int max ATTRIBUTE_UNUSED;
|
||||
{
|
||||
barray res;
|
||||
int i;
|
||||
int byte = *idx / 8;
|
||||
int size = ptr[byte++];
|
||||
res.len = size;
|
||||
res.data = (unsigned char *) xmalloc (size);
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
res.data[i] = ptr[byte++];
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
int
|
||||
getINT (ptr, idx, size, max)
|
||||
unsigned char *ptr;
|
||||
int *idx;
|
||||
int size;
|
||||
int max;
|
||||
{
|
||||
int n = 0;
|
||||
int byte = *idx / 8;
|
||||
|
||||
if (byte >= max)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if (size == -2)
|
||||
size = addrsize;
|
||||
if (size == -1)
|
||||
size = 0;
|
||||
switch (size)
|
||||
{
|
||||
case 0:
|
||||
return 0;
|
||||
case 1:
|
||||
n = (ptr[byte]);
|
||||
break;
|
||||
case 2:
|
||||
n = (ptr[byte + 0] << 8) + ptr[byte + 1];
|
||||
break;
|
||||
case 4:
|
||||
n = (ptr[byte + 0] << 24) + (ptr[byte + 1] << 16) + (ptr[byte + 2] << 8) + (ptr[byte + 3]);
|
||||
break;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
*idx += size * 8;
|
||||
return n;
|
||||
}
|
||||
|
||||
int
|
||||
getBITS (ptr, idx, size, max)
|
||||
char *ptr;
|
||||
int *idx;
|
||||
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);
|
||||
}
|
||||
|
||||
static void
|
||||
itheader (name, code)
|
||||
char *name;
|
||||
int code;
|
||||
{
|
||||
printf ("\n%s 0x%02x\n", name, code);
|
||||
}
|
||||
|
||||
static int indent;
|
||||
static void
|
||||
p ()
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < indent; i++)
|
||||
{
|
||||
printf ("| ");
|
||||
}
|
||||
printf ("> ");
|
||||
}
|
||||
|
||||
static void
|
||||
tabout ()
|
||||
{
|
||||
p ();
|
||||
}
|
||||
|
||||
static void
|
||||
pbarray (y)
|
||||
barray *y;
|
||||
{
|
||||
int x;
|
||||
printf ("%d (", y->len);
|
||||
for (x = 0; x < y->len; x++)
|
||||
{
|
||||
printf ("(%02x %c)", y->data[x], isprint (y->data[x]) ? y->data[x] : '.');
|
||||
}
|
||||
printf (")\n");
|
||||
}
|
||||
|
||||
#define SYSROFF_PRINT
|
||||
#define SYSROFF_SWAP_IN
|
||||
|
||||
#include "sysroff.c"
|
||||
|
||||
/*
|
||||
* FIXME: sysinfo, which generates sysroff.[ch] from sysroff.info, can't
|
||||
* hack the special case of the tr block, which has no contents. So we
|
||||
* implement our own functions for reading in and printing out the tr
|
||||
* block.
|
||||
*/
|
||||
|
||||
#define IT_tr_CODE 0x7f
|
||||
void
|
||||
sysroff_swap_tr_in()
|
||||
{
|
||||
char raw[255];
|
||||
|
||||
memset(raw, 0, 255);
|
||||
fillup(raw);
|
||||
}
|
||||
|
||||
void
|
||||
sysroff_print_tr_out()
|
||||
{
|
||||
itheader("tr", IT_tr_CODE);
|
||||
}
|
||||
|
||||
static int
|
||||
getone (type)
|
||||
int type;
|
||||
{
|
||||
int c = getc (file);
|
||||
code = c;
|
||||
|
||||
if ((c & 0x7f) != type)
|
||||
{
|
||||
ungetc (c, file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (c & 0x7f)
|
||||
{
|
||||
case IT_cs_CODE:
|
||||
{
|
||||
struct IT_cs dummy;
|
||||
sysroff_swap_cs_in (&dummy);
|
||||
sysroff_print_cs_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dln_CODE:
|
||||
{
|
||||
struct IT_dln dummy;
|
||||
sysroff_swap_dln_in (&dummy);
|
||||
sysroff_print_dln_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_hd_CODE:
|
||||
{
|
||||
struct IT_hd dummy;
|
||||
sysroff_swap_hd_in (&dummy);
|
||||
addrsize = dummy.afl;
|
||||
sysroff_print_hd_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dar_CODE:
|
||||
{
|
||||
struct IT_dar dummy;
|
||||
sysroff_swap_dar_in (&dummy);
|
||||
sysroff_print_dar_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dsy_CODE:
|
||||
{
|
||||
struct IT_dsy dummy;
|
||||
sysroff_swap_dsy_in (&dummy);
|
||||
sysroff_print_dsy_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dfp_CODE:
|
||||
{
|
||||
struct IT_dfp dummy;
|
||||
sysroff_swap_dfp_in (&dummy);
|
||||
sysroff_print_dfp_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dso_CODE:
|
||||
{
|
||||
struct IT_dso dummy;
|
||||
sysroff_swap_dso_in (&dummy);
|
||||
sysroff_print_dso_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dpt_CODE:
|
||||
{
|
||||
struct IT_dpt dummy;
|
||||
sysroff_swap_dpt_in (&dummy);
|
||||
sysroff_print_dpt_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_den_CODE:
|
||||
{
|
||||
struct IT_den dummy;
|
||||
sysroff_swap_den_in (&dummy);
|
||||
sysroff_print_den_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dbt_CODE:
|
||||
{
|
||||
struct IT_dbt dummy;
|
||||
sysroff_swap_dbt_in (&dummy);
|
||||
sysroff_print_dbt_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dty_CODE:
|
||||
{
|
||||
struct IT_dty dummy;
|
||||
sysroff_swap_dty_in (&dummy);
|
||||
sysroff_print_dty_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_un_CODE:
|
||||
{
|
||||
struct IT_un dummy;
|
||||
sysroff_swap_un_in (&dummy);
|
||||
sysroff_print_un_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_sc_CODE:
|
||||
{
|
||||
struct IT_sc dummy;
|
||||
sysroff_swap_sc_in (&dummy);
|
||||
sysroff_print_sc_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_er_CODE:
|
||||
{
|
||||
struct IT_er dummy;
|
||||
sysroff_swap_er_in (&dummy);
|
||||
sysroff_print_er_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_ed_CODE:
|
||||
{
|
||||
struct IT_ed dummy;
|
||||
sysroff_swap_ed_in (&dummy);
|
||||
sysroff_print_ed_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_sh_CODE:
|
||||
{
|
||||
struct IT_sh dummy;
|
||||
sysroff_swap_sh_in (&dummy);
|
||||
sysroff_print_sh_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_ob_CODE:
|
||||
{
|
||||
struct IT_ob dummy;
|
||||
sysroff_swap_ob_in (&dummy);
|
||||
sysroff_print_ob_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_rl_CODE:
|
||||
{
|
||||
struct IT_rl dummy;
|
||||
sysroff_swap_rl_in (&dummy);
|
||||
sysroff_print_rl_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_du_CODE:
|
||||
{
|
||||
struct IT_du dummy;
|
||||
sysroff_swap_du_in (&dummy);
|
||||
|
||||
sysroff_print_du_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dus_CODE:
|
||||
{
|
||||
struct IT_dus dummy;
|
||||
sysroff_swap_dus_in (&dummy);
|
||||
sysroff_print_dus_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dul_CODE:
|
||||
{
|
||||
struct IT_dul dummy;
|
||||
sysroff_swap_dul_in (&dummy);
|
||||
sysroff_print_dul_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dss_CODE:
|
||||
{
|
||||
struct IT_dss dummy;
|
||||
sysroff_swap_dss_in (&dummy);
|
||||
sysroff_print_dss_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_hs_CODE:
|
||||
{
|
||||
struct IT_hs dummy;
|
||||
sysroff_swap_hs_in (&dummy);
|
||||
sysroff_print_hs_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_dps_CODE:
|
||||
{
|
||||
struct IT_dps dummy;
|
||||
sysroff_swap_dps_in (&dummy);
|
||||
sysroff_print_dps_out (&dummy);
|
||||
}
|
||||
break;
|
||||
case IT_tr_CODE:
|
||||
{
|
||||
sysroff_swap_tr_in ();
|
||||
sysroff_print_tr_out ();
|
||||
}
|
||||
break;
|
||||
case IT_dds_CODE:
|
||||
{
|
||||
struct IT_dds dummy;
|
||||
sysroff_swap_dds_in (&dummy);
|
||||
sysroff_print_dds_out (&dummy);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
printf ("GOT A %x\n", c);
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
opt (x)
|
||||
int x;
|
||||
{
|
||||
return getone (x);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/* This is no longer used. */
|
||||
|
||||
static void
|
||||
unit_info_list ()
|
||||
{
|
||||
while (opt (IT_un_CODE))
|
||||
{
|
||||
getone (IT_us_CODE);
|
||||
|
||||
while (getone (IT_sc_CODE))
|
||||
getone (IT_ss_CODE);
|
||||
|
||||
while (getone (IT_er_CODE))
|
||||
;
|
||||
|
||||
while (getone (IT_ed_CODE))
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
/* This is no longer used. */
|
||||
|
||||
static void
|
||||
object_body_list ()
|
||||
{
|
||||
while (getone (IT_sh_CODE))
|
||||
{
|
||||
while (getone (IT_ob_CODE))
|
||||
;
|
||||
while (getone (IT_rl_CODE))
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
must (x)
|
||||
int x;
|
||||
{
|
||||
if (!getone (x))
|
||||
{
|
||||
printf ("WANTED %x!!\n", x);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
tab (i, s)
|
||||
int i;
|
||||
char *s;
|
||||
{
|
||||
indent += i;
|
||||
if (s)
|
||||
{
|
||||
p ();
|
||||
printf (s);
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void derived_type ();
|
||||
|
||||
static void
|
||||
dump_symbol_info ()
|
||||
{
|
||||
tab (1, "SYMBOL INFO");
|
||||
while (opt (IT_dsy_CODE))
|
||||
{
|
||||
if (opt (IT_dty_CODE))
|
||||
{
|
||||
must (IT_dbt_CODE);
|
||||
derived_type ();
|
||||
must (IT_dty_CODE);
|
||||
}
|
||||
}
|
||||
tab (-1, "");
|
||||
}
|
||||
|
||||
static void
|
||||
derived_type ()
|
||||
{
|
||||
tab (1, "DERIVED TYPE");
|
||||
while (1)
|
||||
{
|
||||
if (opt (IT_dpp_CODE))
|
||||
{
|
||||
dump_symbol_info ();
|
||||
must (IT_dpp_CODE);
|
||||
}
|
||||
else if (opt (IT_dfp_CODE))
|
||||
{
|
||||
dump_symbol_info ();
|
||||
must (IT_dfp_CODE);
|
||||
}
|
||||
else if (opt (IT_den_CODE))
|
||||
{
|
||||
dump_symbol_info ();
|
||||
must (IT_den_CODE);
|
||||
}
|
||||
else if (opt (IT_den_CODE))
|
||||
{
|
||||
dump_symbol_info ();
|
||||
must (IT_den_CODE);
|
||||
}
|
||||
else if (opt (IT_dds_CODE))
|
||||
{
|
||||
dump_symbol_info ();
|
||||
must (IT_dds_CODE);
|
||||
}
|
||||
else if (opt (IT_dar_CODE))
|
||||
{
|
||||
}
|
||||
else if (opt (IT_dpt_CODE))
|
||||
{
|
||||
}
|
||||
else if (opt (IT_dul_CODE))
|
||||
{
|
||||
}
|
||||
else if (opt (IT_dse_CODE))
|
||||
{
|
||||
}
|
||||
else if (opt (IT_dot_CODE))
|
||||
{
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
tab (-1, "");
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/* This is no longer used. */
|
||||
|
||||
static void
|
||||
program_structure ()
|
||||
{
|
||||
tab (1, "PROGRAM STRUCTURE");
|
||||
while (opt (IT_dps_CODE))
|
||||
{
|
||||
must (IT_dso_CODE);
|
||||
opt (IT_dss_CODE);
|
||||
dump_symbol_info ();
|
||||
must (IT_dps_CODE);
|
||||
}
|
||||
tab (-1, "");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
/* This is no longer used. */
|
||||
|
||||
static void
|
||||
debug_list ()
|
||||
{
|
||||
tab (1, "DEBUG LIST");
|
||||
|
||||
must (IT_du_CODE);
|
||||
opt (IT_dus_CODE);
|
||||
program_structure ();
|
||||
must (IT_dln_CODE);
|
||||
|
||||
tab (-1, "");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
module ()
|
||||
{
|
||||
int c = 0;
|
||||
int l = 0;
|
||||
|
||||
tab (1, "MODULE***\n");
|
||||
|
||||
do
|
||||
{
|
||||
c = getc (file);
|
||||
ungetc (c, file);
|
||||
|
||||
c &= 0x7f;
|
||||
}
|
||||
while (getone (c) && c != IT_tr_CODE);
|
||||
|
||||
#if 0
|
||||
must (IT_cs_CODE);
|
||||
must (IT_hd_CODE);
|
||||
opt (IT_hs_CODE);
|
||||
|
||||
unit_info_list ();
|
||||
object_body_list ();
|
||||
debug_list ();
|
||||
|
||||
must (IT_tr_CODE);
|
||||
#endif
|
||||
tab (-1, "");
|
||||
|
||||
c = getc (file);
|
||||
while (c != EOF)
|
||||
{
|
||||
printf ("%02x ", c);
|
||||
l++;
|
||||
if (l == 32)
|
||||
{
|
||||
printf ("\n");
|
||||
l = 0;
|
||||
}
|
||||
c = getc (file);
|
||||
}
|
||||
}
|
||||
|
||||
char *program_name;
|
||||
|
||||
static void
|
||||
show_usage (file, status)
|
||||
FILE *file;
|
||||
int status;
|
||||
{
|
||||
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"),
|
||||
program_name);
|
||||
show_usage (stdout, 0);
|
||||
}
|
||||
|
||||
int
|
||||
main (ac, av)
|
||||
int ac;
|
||||
char **av;
|
||||
{
|
||||
char *input_file = NULL;
|
||||
int opt;
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"help", no_argument, 0, 'h'},
|
||||
{"version", no_argument, 0, 'V'},
|
||||
{NULL, no_argument, 0, 0}
|
||||
};
|
||||
|
||||
#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
|
||||
setlocale (LC_MESSAGES, "");
|
||||
#endif
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
program_name = av[0];
|
||||
xmalloc_set_program_name (program_name);
|
||||
|
||||
while ((opt = getopt_long (ac, av, "hV", long_options, (int *) NULL)) != EOF)
|
||||
{
|
||||
switch (opt)
|
||||
{
|
||||
case 'h':
|
||||
show_help ();
|
||||
/*NOTREACHED*/
|
||||
case 'V':
|
||||
printf (_("GNU %s version %s\n"), program_name, PROGRAM_VERSION);
|
||||
exit (0);
|
||||
/*NOTREACHED*/
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
show_usage (stderr, 1);
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
}
|
||||
|
||||
/* The input and output files may be named on the command line. */
|
||||
|
||||
if (optind < ac)
|
||||
{
|
||||
input_file = av[optind];
|
||||
}
|
||||
|
||||
if (!input_file)
|
||||
{
|
||||
fatal (_("no input file specified"));
|
||||
}
|
||||
|
||||
file = fopen (input_file, FOPEN_RB);
|
||||
if (!file)
|
||||
{
|
||||
fatal (_("cannot open input file %s"), input_file);
|
||||
}
|
||||
|
||||
module ();
|
||||
return 0;
|
||||
}
|
||||
@@ -1,434 +0,0 @@
|
||||
/* Copyright 2001 Free Software Foundation, Inc.
|
||||
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
|
||||
|
||||
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 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. */
|
||||
|
||||
%{
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
extern char *word;
|
||||
extern char writecode;
|
||||
extern int number;
|
||||
extern int unit;
|
||||
char nice_name[1000];
|
||||
char *it;
|
||||
int sofar;
|
||||
int width;
|
||||
int code;
|
||||
char * repeat;
|
||||
char *oldrepeat;
|
||||
char *name;
|
||||
int rdepth;
|
||||
char *loop [] = {"","n","m","/*BAD*/"};
|
||||
char *names[] = {" ","[n]","[n][m]"};
|
||||
char *pnames[]= {"","*","**"};
|
||||
%}
|
||||
|
||||
|
||||
%union {
|
||||
int i;
|
||||
char *s;
|
||||
}
|
||||
%token COND
|
||||
%token REPEAT
|
||||
%token '(' ')'
|
||||
%token <s> TYPE
|
||||
%token <s> NAME
|
||||
%token <i> NUMBER UNIT
|
||||
%type <i> attr_size
|
||||
%type <s> attr_desc attr_id attr_type
|
||||
%%
|
||||
|
||||
top: {
|
||||
switch (writecode)
|
||||
{
|
||||
case 'i':
|
||||
printf("#ifdef SYSROFF_SWAP_IN\n");
|
||||
break;
|
||||
case 'p':
|
||||
printf("#ifdef SYSROFF_p\n");
|
||||
break;
|
||||
case 'd':
|
||||
break;
|
||||
case 'g':
|
||||
printf("#ifdef SYSROFF_SWAP_OUT\n");
|
||||
break;
|
||||
case 'c':
|
||||
printf("#ifdef SYSROFF_PRINT\n");
|
||||
printf("#include <stdio.h>\n");
|
||||
printf("#include <stdlib.h>\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
it_list {
|
||||
switch (writecode) {
|
||||
case 'i':
|
||||
case 'p':
|
||||
case 'g':
|
||||
case 'c':
|
||||
printf("#endif\n");
|
||||
break;
|
||||
case 'd':
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
|
||||
it_list: it it_list
|
||||
|
|
||||
;
|
||||
|
||||
it:
|
||||
'(' NAME NUMBER
|
||||
{
|
||||
it = $2; code = $3;
|
||||
switch (writecode)
|
||||
{
|
||||
case 'd':
|
||||
printf("\n\n\n#define IT_%s_CODE 0x%x\n", it,code);
|
||||
printf("struct IT_%s { \n", it);
|
||||
break;
|
||||
case 'i':
|
||||
printf("void sysroff_swap_%s_in(ptr)\n",$2);
|
||||
printf("struct IT_%s *ptr;\n", it);
|
||||
printf("{\n");
|
||||
printf("char raw[255];\n");
|
||||
printf("\tint idx = 0 ;\n");
|
||||
printf("\tint size;\n");
|
||||
printf("memset(raw,0,255);\n");
|
||||
printf("memset(ptr,0,sizeof(*ptr));\n");
|
||||
printf("size = fillup(raw);\n");
|
||||
break;
|
||||
case 'g':
|
||||
printf("void sysroff_swap_%s_out(file,ptr)\n",$2);
|
||||
printf("FILE * file;\n");
|
||||
printf("struct IT_%s *ptr;\n", it);
|
||||
printf("{\n");
|
||||
printf("\tchar raw[255];\n");
|
||||
printf("\tint idx = 16 ;\n");
|
||||
printf("\tmemset (raw, 0, 255);\n");
|
||||
printf("\tcode = IT_%s_CODE;\n", it);
|
||||
break;
|
||||
case 'o':
|
||||
printf("void sysroff_swap_%s_out(abfd,ptr)\n",$2);
|
||||
printf("bfd * abfd;\n");
|
||||
printf("struct IT_%s *ptr;\n",it);
|
||||
printf("{\n");
|
||||
printf("int idx = 0 ;\n");
|
||||
break;
|
||||
case 'c':
|
||||
printf("void sysroff_print_%s_out(ptr)\n",$2);
|
||||
printf("struct IT_%s *ptr;\n", it);
|
||||
printf("{\n");
|
||||
printf("itheader(\"%s\", IT_%s_CODE);\n",$2,$2);
|
||||
break;
|
||||
|
||||
case 't':
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
it_field_list
|
||||
')'
|
||||
{
|
||||
switch (writecode) {
|
||||
case 'd':
|
||||
printf("};\n");
|
||||
break;
|
||||
case 'g':
|
||||
printf("\tchecksum(file,raw, idx, IT_%s_CODE);\n", it);
|
||||
|
||||
case 'i':
|
||||
|
||||
case 'o':
|
||||
case 'c':
|
||||
printf("}\n");
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
|
||||
it_field_list:
|
||||
it_field it_field_list
|
||||
| cond_it_field it_field_list
|
||||
| repeat_it_field it_field_list
|
||||
|
|
||||
;
|
||||
|
||||
repeat_it_field: '(' REPEAT NAME
|
||||
{
|
||||
rdepth++;
|
||||
switch (writecode)
|
||||
{
|
||||
case 'c':
|
||||
if (rdepth==1)
|
||||
printf("\tprintf(\"repeat %%d\\n\", %s);\n",$3);
|
||||
if (rdepth==2)
|
||||
printf("\tprintf(\"repeat %%d\\n\", %s[n]);\n",$3);
|
||||
case 'i':
|
||||
case 'g':
|
||||
case 'o':
|
||||
|
||||
if (rdepth==1)
|
||||
{
|
||||
printf("\t{ int n; for (n = 0; n < %s; n++) {\n", $3);
|
||||
}
|
||||
if (rdepth == 2) {
|
||||
printf("\t{ int m; for (m = 0; m < %s[n]; m++) {\n", $3);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
oldrepeat = repeat;
|
||||
repeat = $3;
|
||||
}
|
||||
|
||||
it_field_list ')'
|
||||
|
||||
{
|
||||
repeat = oldrepeat;
|
||||
oldrepeat =0;
|
||||
rdepth--;
|
||||
switch (writecode)
|
||||
{
|
||||
case 'i':
|
||||
case 'g':
|
||||
case 'o':
|
||||
case 'c':
|
||||
printf("\t}}\n");
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
cond_it_field: '(' COND NAME
|
||||
{
|
||||
switch (writecode)
|
||||
{
|
||||
case 'i':
|
||||
case 'g':
|
||||
case 'o':
|
||||
case 'c':
|
||||
printf("\tif (%s) {\n", $3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
it_field_list ')'
|
||||
{
|
||||
switch (writecode)
|
||||
{
|
||||
case 'i':
|
||||
case 'g':
|
||||
case 'o':
|
||||
case 'c':
|
||||
printf("\t}\n");
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
it_field:
|
||||
'(' attr_desc '(' attr_type attr_size ')' attr_id
|
||||
{name = $7; }
|
||||
enums ')'
|
||||
{
|
||||
char *desc = $2;
|
||||
char *type = $4;
|
||||
int size = $5;
|
||||
char *id = $7;
|
||||
char *p = names[rdepth];
|
||||
char *ptr = pnames[rdepth];
|
||||
switch (writecode)
|
||||
{
|
||||
case 'g':
|
||||
if (size % 8)
|
||||
{
|
||||
|
||||
printf("\twriteBITS(ptr->%s%s,raw,&idx,%d);\n",
|
||||
id,
|
||||
names[rdepth], size);
|
||||
|
||||
}
|
||||
else {
|
||||
printf("\twrite%s(ptr->%s%s,raw,&idx,%d,file);\n",
|
||||
type,
|
||||
id,
|
||||
names[rdepth],size/8);
|
||||
}
|
||||
break;
|
||||
case 'i':
|
||||
{
|
||||
|
||||
if (rdepth >= 1)
|
||||
|
||||
{
|
||||
printf("if (!ptr->%s) ptr->%s = (%s*)xcalloc(%s, sizeof(ptr->%s[0]));\n",
|
||||
id,
|
||||
id,
|
||||
type,
|
||||
repeat,
|
||||
id);
|
||||
}
|
||||
|
||||
if (rdepth == 2)
|
||||
{
|
||||
printf("if (!ptr->%s[n]) ptr->%s[n] = (%s**)xcalloc(%s[n], sizeof(ptr->%s[n][0]));\n",
|
||||
id,
|
||||
id,
|
||||
type,
|
||||
repeat,
|
||||
id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (size % 8)
|
||||
{
|
||||
printf("\tptr->%s%s = getBITS(raw,&idx, %d,size);\n",
|
||||
id,
|
||||
names[rdepth],
|
||||
size);
|
||||
}
|
||||
else {
|
||||
printf("\tptr->%s%s = get%s(raw,&idx, %d,size);\n",
|
||||
id,
|
||||
names[rdepth],
|
||||
type,
|
||||
size/8);
|
||||
}
|
||||
break;
|
||||
case 'o':
|
||||
printf("\tput%s(raw,%d,%d,&idx,ptr->%s%s);\n", type,size/8,size%8,id,names[rdepth]);
|
||||
break;
|
||||
case 'd':
|
||||
if (repeat)
|
||||
printf("\t/* repeat %s */\n", repeat);
|
||||
|
||||
if (type[0] == 'I') {
|
||||
printf("\tint %s%s; \t/* %s */\n",ptr,id, desc);
|
||||
}
|
||||
else if (type[0] =='C') {
|
||||
printf("\tchar %s*%s;\t /* %s */\n",ptr,id, desc);
|
||||
}
|
||||
else {
|
||||
printf("\tbarray %s%s;\t /* %s */\n",ptr,id, desc);
|
||||
}
|
||||
break;
|
||||
case 'c':
|
||||
printf("tabout();\n");
|
||||
printf("\tprintf(\"/*%-30s*/ ptr->%s = \");\n", desc, id);
|
||||
|
||||
if (type[0] == 'I')
|
||||
printf("\tprintf(\"%%d\\n\",ptr->%s%s);\n", id,p);
|
||||
else if (type[0] == 'C')
|
||||
printf("\tprintf(\"%%s\\n\",ptr->%s%s);\n", id,p);
|
||||
|
||||
else if (type[0] == 'B')
|
||||
{
|
||||
printf("\tpbarray(&ptr->%s%s);\n", id,p);
|
||||
}
|
||||
else abort();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
|
||||
attr_type:
|
||||
TYPE { $$ = $1; }
|
||||
| { $$ = "INT";}
|
||||
;
|
||||
|
||||
attr_desc:
|
||||
'(' NAME ')'
|
||||
{ $$ = $2; }
|
||||
;
|
||||
|
||||
attr_size:
|
||||
NUMBER UNIT
|
||||
{ $$ = $1 * $2; }
|
||||
;
|
||||
|
||||
|
||||
attr_id:
|
||||
'(' NAME ')' { $$ = $2; }
|
||||
| { $$ = "dummy";}
|
||||
;
|
||||
|
||||
enums:
|
||||
| '(' enum_list ')' ;
|
||||
|
||||
enum_list:
|
||||
|
|
||||
enum_list '(' NAME NAME ')' {
|
||||
switch (writecode)
|
||||
{
|
||||
case 'd':
|
||||
printf("#define %s %s\n", $3,$4);
|
||||
break;
|
||||
case 'c':
|
||||
printf("if (ptr->%s%s == %s) { tabout(); printf(\"%s\\n\");}\n", name, names[rdepth],$4,$3);
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
%%
|
||||
/* four modes
|
||||
|
||||
-d write structure defintions for sysroff in host format
|
||||
-i write functions to swap into sysroff format in
|
||||
-o write functions to swap into sysroff format out
|
||||
-c write code to print info in human form */
|
||||
|
||||
int yydebug;
|
||||
char writecode;
|
||||
|
||||
int
|
||||
main(ac,av)
|
||||
int ac;
|
||||
char **av;
|
||||
{
|
||||
yydebug=0;
|
||||
if (ac > 1)
|
||||
writecode = av[1][1];
|
||||
if (writecode == 'd')
|
||||
{
|
||||
printf("typedef struct { unsigned char *data; int len; } barray; \n");
|
||||
printf("typedef int INT;\n");
|
||||
printf("typedef char * CHARS;\n");
|
||||
|
||||
}
|
||||
yyparse();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
yyerror(s)
|
||||
char *s;
|
||||
{
|
||||
fprintf(stderr, "%s\n" , s);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
%{
|
||||
/* Copyright 2001 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GLD, the Gnu Linker.
|
||||
|
||||
GLD 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.
|
||||
|
||||
GLD 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 GLD; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#include "sysinfo.h"
|
||||
char *word;
|
||||
int number;
|
||||
int unit;
|
||||
|
||||
#ifndef yywrap
|
||||
static int yywrap () { return 1; }
|
||||
#endif
|
||||
%}
|
||||
%%
|
||||
"(" { return '(';}
|
||||
")" { return ')';}
|
||||
"[" { return '[';}
|
||||
"]" { return ']';}
|
||||
" " { ; }
|
||||
";".* { ; }
|
||||
"\t" { ; }
|
||||
"\n" { ; }
|
||||
"\""[^\"]*"\"" {
|
||||
yylval.s = malloc(strlen (yytext));
|
||||
strcpy(yylval.s, yytext+1);
|
||||
yylval.s[strlen(yylval.s)-1] = 0;
|
||||
return NAME;
|
||||
}
|
||||
|
||||
0x[0-9a-f]+ {
|
||||
yylval.i = strtol(yytext,0,16);
|
||||
return NUMBER;
|
||||
}
|
||||
|
||||
[0-9]+ {
|
||||
yylval.i = atoi(yytext);
|
||||
return NUMBER;
|
||||
}
|
||||
|
||||
|
||||
"bits" { yylval.i =1 ;return UNIT;}
|
||||
"bit" { yylval.i = 1; return UNIT;}
|
||||
"bytes" { yylval.i= 8; return UNIT;}
|
||||
"byte" { yylval.i = 8; return UNIT;}
|
||||
|
||||
"int" { yylval.s = "INT"; return TYPE;}
|
||||
"barray" { yylval.s = "BARRAY"; return TYPE;}
|
||||
"chars" { yylval.s = "CHARS"; return TYPE;}
|
||||
"variable" { yylval.i = 0; return NUMBER;}
|
||||
"counted" { yylval.i = -4; return NUMBER;}
|
||||
"addrsize" { yylval.i = -2; return NUMBER; }
|
||||
"segsize" { yylval.i = -1; return NUMBER; }
|
||||
"cond" { return COND;}
|
||||
"repeat" { return REPEAT;}
|
||||
@@ -1,504 +0,0 @@
|
||||
("cs" 0x0
|
||||
(("size") (1 byte) ("size"))
|
||||
|
||||
(("hd") (1 byte) ("hd"))
|
||||
(("hs") (1 byte) ("hs"))
|
||||
(("un") (1 byte) ("un"))
|
||||
(("us") (1 byte) ("us"))
|
||||
|
||||
(("sc") (1 byte) ("sc"))
|
||||
(("ss") (1 byte) ("ss"))
|
||||
(("er") (1 byte) ("er"))
|
||||
(("ed") (1 byte) ("ed"))
|
||||
|
||||
(("sh") (1 byte) ("sh"))
|
||||
(("ob") (1 byte) ("ob"))
|
||||
(("rl") (1 byte) ("rl"))
|
||||
(("du") (1 byte) ("du"))
|
||||
|
||||
(("dps") (1 byte) ("dps"))
|
||||
(("dsy") (1 byte) ("dsy"))
|
||||
(("dty") (1 byte) ("dty"))
|
||||
(("dln") (1 byte) ("dln"))
|
||||
|
||||
(("dso") (1 byte) ("dso"))
|
||||
(("dus") (1 byte) ("dus"))
|
||||
(("dss") (1 byte) ("dss"))
|
||||
(("dbt") (1 byte) ("dbt"))
|
||||
|
||||
(("dpp") (1 byte) ("dpp"))
|
||||
(("dfp") (1 byte) ("dfp"))
|
||||
(("den") (1 byte) ("den"))
|
||||
(("dds") (1 byte) ("dds"))
|
||||
|
||||
(("dar") (1 byte) ("dar"))
|
||||
(("dpt") (1 byte) ("dpt"))
|
||||
(("dul") (1 byte) ("dul"))
|
||||
(("dse") (1 byte) ("dse"))
|
||||
|
||||
(("dot") (1 byte) ("dot")))
|
||||
|
||||
|
||||
("hd" 0x04
|
||||
(("module type") (4 bits) ("mt")
|
||||
(("MTYPE_ABS_LM" "0")
|
||||
("MTYPE_REL_LM" "1")
|
||||
("MTYPE_OMS_OR_LMS" "2")
|
||||
("MTYPE_UNSPEC" "0xf")))
|
||||
(("spare")(4 bits) ("spare1"))
|
||||
(("creation date")( chars 12 bytes)( "cd"))
|
||||
(("number of units") (2 bytes) ("nu"))
|
||||
(("code") (1 byte) ("code"))
|
||||
(("version") (chars 4 bytes) ("ver"))
|
||||
(("address update") (1 byte) ("au"))
|
||||
(("segment identifier") (1 bit) ("si"))
|
||||
(("address field length") (4 bits) ("afl"))
|
||||
(("spare")(3 bits) ("spare2"))
|
||||
(("space size within segment") (1 byte) ("spcsz"))
|
||||
(("segment size") (1 byte) ("segsz"))
|
||||
(("segment shift") (1 byte) ("segsh"))
|
||||
(("entry point") (1 byte) ("ep"))
|
||||
(cond "ptr->ep"
|
||||
(cond "ptr->mt != MTYPE_ABS_LM"
|
||||
(("unit appearance number") (2 bytes) ("uan"))
|
||||
(("section appearance number") (2 bytes) ("sa")))
|
||||
(cond "segmented_p"
|
||||
(("segment address") (segsize bytes) ("sad")))
|
||||
(("address") (addrsize bytes) ("address")))
|
||||
(("os name") (chars variable bytes) ("os"))
|
||||
(("sys name") (chars variable bytes) ("sys"))
|
||||
(("module name") (chars variable bytes) ("mn"))
|
||||
(("cpu") (chars variable bytes) ("cpu")))
|
||||
|
||||
|
||||
("hs" 0x05
|
||||
(("neg number") (2 bytes) ("neg")))
|
||||
|
||||
|
||||
("un" 0x06
|
||||
(("format") (2 bits) ("format")
|
||||
(("FORMAT_LM" "0")
|
||||
("FORMAT_OM" "1")
|
||||
("FORMAT_OMS_OR_LMS" "2")))
|
||||
(("spare") (6 bits) ("spare1"))
|
||||
(("number of sections") (2 bytes) ("nsections"))
|
||||
(("number of external refs") (2 bytes) ("nextrefs"))
|
||||
(("number of external defs") (2 bytes) ("nextdefs"))
|
||||
(("unit name") (chars variable byte) ("name"))
|
||||
(("tool name") (chars variable byte) ("tool"))
|
||||
(("creation date") (chars 12 bytes) ("tcd"))
|
||||
(("linker name") (chars variable byte) ("linker"))
|
||||
(("creation date") (chars 12 bytes) ("lcd")))
|
||||
|
||||
|
||||
("us" 0x07
|
||||
(("negotiation number") (2 bytes) ("neg")))
|
||||
|
||||
|
||||
("sc" 0x08
|
||||
(("format") (2 bits) ("format"))
|
||||
(("spare") (6 bits) ("spare"))
|
||||
(("segment address") (segsize bytes) ("segadd"))
|
||||
(("address") (addrsize bytes) ("addr"))
|
||||
(("length") (addrsize bytes) ("length"))
|
||||
(("alignment") (addrsize bytes) ("align"))
|
||||
(("contents") (4 bits) ("contents")
|
||||
(("CONTENTS_CODE" "0")
|
||||
("CONTENTS_DATA" "1")
|
||||
("CONTENTS_STACK" "2")
|
||||
("CONTENTS_DUMMY" "3")
|
||||
("CONTENTS_SPECIAL" "4")
|
||||
("CONTENTS_NONSPEC" "0xf")))
|
||||
(("concat") (4 bits) ("concat")
|
||||
(("CONCAT_SIMPLE" "0")
|
||||
("CONCAT_SHAREDC" "1")
|
||||
("CONCAT_DUMMY" "2")
|
||||
("CONCAT_GROUP" "3")
|
||||
("CONCAT_SHARED" "4")
|
||||
("CONCAT_PRIVATE" "5")
|
||||
("CONCAT_UNSPEC" "0xf")))
|
||||
(("read") (2 bits) ("read"))
|
||||
(("write") (2 bits) ("write"))
|
||||
(("exec") (2 bits) ("exec"))
|
||||
(("initialized") (2 bits) ("init"))
|
||||
(("mode") (2 bits) ("mode"))
|
||||
(("spare") (6 bits) ("spare1"))
|
||||
(("name") (chars variable byte) ("name")))
|
||||
|
||||
|
||||
("ss" 0x09
|
||||
(("neg number") (2 bytes) ("neg")))
|
||||
|
||||
|
||||
("er" 0x0c
|
||||
(("symbol type") (2 bits) ("type")
|
||||
(("ER_ENTRY" "0")
|
||||
("ER_DATA" "1")
|
||||
("ER_NOTDEF" "2")
|
||||
("ER_NOTSPEC" "3")))
|
||||
(("spare") (6 bits) ("spare"))
|
||||
(("symbol name") (chars variable byte) ("name")))
|
||||
|
||||
|
||||
("ed" 0x14
|
||||
(("section appearance number") (2 bytes) ("section"))
|
||||
(("symbol type") (3 bits) ("type")
|
||||
(("ED_TYPE_ENTRY" "0")
|
||||
("ED_TYPE_DATA" "1")
|
||||
("ED_TYPE_CONST" "2")
|
||||
("ED_TYPE_NOTSPEC" "7")))
|
||||
(("spare") (5 bits) ("spare"))
|
||||
(cond "ptr->type==ED_TYPE_ENTRY || ptr->type==ED_TYPE_DATA"
|
||||
(("symbol address") (addrsize bytes) ("address")))
|
||||
(cond "ptr->type==ED_TYPE_CONST"
|
||||
(("constant value") (addrsize bytes) ("constant")))
|
||||
(("symbol name") (chars variable byte) ("name")))
|
||||
|
||||
|
||||
("sh" 0x1a
|
||||
(("unit appearance number") (2 bytes) ("unit"))
|
||||
(("section appearance number") (2 bytes) ("section")))
|
||||
|
||||
|
||||
("ob" 0x1c
|
||||
(("starting address flag") (1 bit) ("saf"))
|
||||
(("compression flag") (1 bit) ("cpf"))
|
||||
(("spare") (6 bits) ("spare"))
|
||||
(cond "ptr->saf"
|
||||
( ("starting address") (addrsize bytes) ("address")))
|
||||
(cond "ptr->cpf"
|
||||
(("comp reps") (addrsize bytes) ("compreps")))
|
||||
(("data") (barray counted byte) ("data")))
|
||||
|
||||
|
||||
("rl" 0x20
|
||||
(("boundary of relocateable area") (4 bits) ("boundary"))
|
||||
(("address polarity") (1 bit) ("apol"))
|
||||
(("segment number") (1 bit) ("segment"))
|
||||
(("sign of relocation") (1 bit) ("sign"))
|
||||
(("check range") (1 bit) ("check"))
|
||||
(("reloc address") (addrsize bytes) ("addr"))
|
||||
|
||||
(("bit loc") (1 byte) ("bitloc"))
|
||||
(("field length") (1 byte) ("flen"))
|
||||
(("bcount") (1 byte) ("bcount"))
|
||||
(("operator") (1 byte) ("op")
|
||||
(("OP_RELOC_ADDR" "1")
|
||||
("OP_SEC_REF" "0")
|
||||
("OP_EXT_REF" "2")))
|
||||
(cond "ptr->op == OP_EXT_REF"
|
||||
(("symbol number") (2 bytes) ("symn")) )
|
||||
|
||||
(cond "ptr->op == OP_SEC_REF"
|
||||
(("section number") (2 bytes) ("secn"))
|
||||
(("const opcode") (1 byte) ("copcode_is_3"))
|
||||
(("addend length") (1 byte) ("alength_is_4"))
|
||||
(("addend") (4 byte) ("addend"))
|
||||
(("plus opcode") (1 byte) ("aopcode_is_0x20")))
|
||||
|
||||
(cond "ptr->op == OP_RELOC_ADDR"
|
||||
(("dunno") (2 bytes) ("dunno")))
|
||||
|
||||
(("end") (1 byte) ("end")))
|
||||
|
||||
|
||||
("du" 0x30
|
||||
(("format") (2 bits) ("format"))
|
||||
(("optimized") (1 bit) ("optimized"))
|
||||
(("stackfrmt") (2 bits) ("stackfrmt"))
|
||||
(("spare") (3 bits) ("spare"))
|
||||
(("unit number") (2 bytes) ("unit"))
|
||||
(("sections") (2 bytes) ("sections"))
|
||||
(repeat "ptr->sections"
|
||||
(("section appearance number") (2 bytes) ("san"))
|
||||
(("address") (addrsize bytes) ("address"))
|
||||
(("section length") (addrsize bytes) ("length")))
|
||||
(("tool name") (chars variable byte) ("tool"))
|
||||
(("creation date") (chars 12 bytes) ("date")))
|
||||
|
||||
|
||||
("dsy" 0x34
|
||||
(("symbol type") (7 bits) ("type")
|
||||
(("STYPE_VAR" "0")
|
||||
("STYPE_LAB" "1")
|
||||
("STYPE_PROC" "2")
|
||||
("STYPE_FUNC" "3")
|
||||
("STYPE_TYPE" "4")
|
||||
("STYPE_CONST" "5")
|
||||
("STYPE_ENTRY" "6")
|
||||
("STYPE_MEMBER" "7")
|
||||
("STYPE_ENUM" "8")
|
||||
("STYPE_TAG" "9")
|
||||
("STYPE_PACKAGE" "10")
|
||||
("STYPE_GENERIC" "11")
|
||||
("STYPE_TASK" "12")
|
||||
("STYPE_EXCEPTION" "13")
|
||||
("STYPE_PARAMETER" "14")
|
||||
("STYPE_EQUATE" "15")
|
||||
("STYPE_UNSPEC" "0x7f")))
|
||||
(("assignment info") (1 bit) ("assign"))
|
||||
(("symbol id") (2 bytes) ("snumber"))
|
||||
(("symbol name") (chars variable bytes) ("sname"))
|
||||
(("nesting level") (2 bytes) ("nesting"))
|
||||
(cond "ptr->assign"
|
||||
(("assignment type") (1 byte) ("ainfo")
|
||||
(("AINFO_REG" "1")
|
||||
("AINFO_STATIC_EXT_DEF" "2")
|
||||
("AINFO_STATIC_EXT_REF" "3")
|
||||
("AINFO_STATIC_INT" "4")
|
||||
("AINFO_STATIC_COM" "5")
|
||||
("AINFO_AUTO" "6")
|
||||
("AINFO_CONST" "7")
|
||||
("AINFO_UNSPEC" "0xff")))
|
||||
(("data length") (addrsize bytes) ("dlength"))
|
||||
(cond "ptr->ainfo == AINFO_STATIC_EXT_DEF
|
||||
|| ptr->ainfo == AINFO_STATIC_INT
|
||||
|| ptr->ainfo == AINFO_STATIC_COM"
|
||||
(("section number") (2 bytes) ("section")))
|
||||
(cond "ptr->ainfo == AINFO_STATIC_EXT_DEF
|
||||
|| ptr->ainfo == AINFO_STATIC_INT
|
||||
|| ptr->ainfo == AINFO_STATIC_COM
|
||||
|| ptr->ainfo == AINFO_AUTO"
|
||||
(("address") (addrsize bytes) ("address")))
|
||||
(cond "ptr->ainfo == AINFO_REG"
|
||||
(("register name") (chars variable bytes) ("reg")))
|
||||
(cond "ptr->ainfo == AINFO_STATIC_EXT_DEF
|
||||
|| ptr->ainfo == AINFO_STATIC_EXT_REF"
|
||||
(("external name") (chars variable bytes) ("ename")))
|
||||
(cond "ptr->ainfo == AINFO_CONST"
|
||||
(("constant") (chars variable bytes) ("constant"))))
|
||||
(cond "ptr->type == STYPE_MEMBER"
|
||||
(("assignment unit") (1 bit) ("bitunit"))
|
||||
(("spare") (7 bits) ("spare2"))
|
||||
(("field length") (addrsize bytes) ("field_len"))
|
||||
(("field offset") (addrsize bytes) ("field_off"))
|
||||
(cond "ptr->bitunit"
|
||||
(("bit offset") (addrsize bytes) ("field_bitoff"))))
|
||||
(cond "ptr->type== STYPE_ENUM"
|
||||
(("value length") (1 byte) ("evallen"))
|
||||
(("value") (4 bytes) ("evalue")))
|
||||
(cond "ptr->type == STYPE_CONST"
|
||||
(("value") (chars variable bytes) ("cvalue")))
|
||||
(cond "ptr->type == STYPE_EQUATE"
|
||||
(("value length") (1 byte) ("qvallen"))
|
||||
(("value") (4 bytes) ("qvalue"))
|
||||
(("basic type") (1 byte) ("btype"))
|
||||
(("size information") (addrsize bytes) ("sizeinfo"))
|
||||
(("sign") (2 bits) ("sign"))
|
||||
(("floating point type") (6 bits) ("flt_type")))
|
||||
(("source file number") (2 bytes) ("sfn"))
|
||||
(("source line number") (2 bytes) ("sln"))
|
||||
(("negotiation number") (2 bytes) ("neg"))
|
||||
(cond "ptr->type == STYPE_TAG"
|
||||
(("magic") (1 byte) ("magic"))))
|
||||
|
||||
|
||||
|
||||
("dul" 0x52
|
||||
(("max declaration type flag") (1 bit) ("max_variable"))
|
||||
(("max spare") (7 bits) ("maxspare"))
|
||||
(cond "ptr->max_variable == 0"
|
||||
(("maximum") (addrsize bytes) ("max"))
|
||||
(("max mode") (chars variable bytes) ("maxmode")))
|
||||
|
||||
(("min declaration type flag") (1 bit) ("min_variable"))
|
||||
(("min spare") (7 bits) ("minspare"))
|
||||
(cond "ptr->min_variable == 0"
|
||||
(("minimum") (addrsize bytes) ("min"))
|
||||
(("min mode") (chars variable bytes) ("minmode"))))
|
||||
|
||||
|
||||
("dty" 0x36
|
||||
(("end flag") (1 bit) ("end"))
|
||||
(("spare") (7 bits) ("spare"))
|
||||
(cond "!ptr->end"
|
||||
(("negotiation") (2 bytes) ("neg"))))
|
||||
|
||||
|
||||
("dbt" 0x44
|
||||
(("basic type") (1 byte) ("btype")
|
||||
(("BTYPE_VOID" "0")
|
||||
("BTYPE_UNDEF" "1")
|
||||
("BTYPE_CHAR" "2")
|
||||
("BTYPE_INT" "3")
|
||||
("BTYPE_FLOAT" "4")
|
||||
("BTYPE_BIT" "5")
|
||||
("BTYPE_STRING" "6")
|
||||
("BTYPE_DECIMAL" "7")
|
||||
("BTYPE_ENUM" "8")
|
||||
("BTYPE_STRUCT" "9")
|
||||
("BTYPE_TYPE" "10")
|
||||
("BTYPE_TAG" "11")
|
||||
("BTYPE_UNSPEC" "0xff")))
|
||||
(("size info") (addrsize bytes) ("bitsize"))
|
||||
(("sign") (2 bits) ("sign")
|
||||
(("SIGN_SIGNED" "0")
|
||||
("SIGN_UNSIGNED" "1")
|
||||
("SIGN_UNSPEC" "3")))
|
||||
(("floating point type") (6 bits) ("fptype")
|
||||
(("FPTYPE_SINGLE" "0")
|
||||
("FPTYPE_DOUBLE" "1")
|
||||
("FPTYPE_EXTENDED" "2")
|
||||
("FPTYPE_NOTSPEC" "0x3f")))
|
||||
(cond "ptr->btype==BTYPE_TAG || ptr->btype == BTYPE_TYPE"
|
||||
(("symbol id") (2 bytes) ("sid")))
|
||||
(("negotiation") (2 bytes) ("neg")))
|
||||
|
||||
("dar" 0x4e
|
||||
(("element length" ) (addrsize bytes) ("length"))
|
||||
(("dims") (1 byte) ("dims"))
|
||||
(repeat "ptr->dims"
|
||||
(("variable flag") (1 bit) ("variable")
|
||||
(("VARIABLE_FIXED" "0")
|
||||
("VARIABLE_VARIABLE" "1")))
|
||||
|
||||
(("subscript type") (1 bit) ("subtype")
|
||||
(("SUB_INTEGER" "0")
|
||||
("SUB_TYPE" "1")))
|
||||
|
||||
(("spare") (6 bits) ("spare"))
|
||||
|
||||
(cond "ptr->subtype[n] == SUB_TYPE"
|
||||
(("sub symbol id") (2 bytes) ("sid")))
|
||||
|
||||
(cond "ptr->subtype[n] == SUB_INTEGER"
|
||||
(("max declaration type flag") (1 bit) ("max_variable"))
|
||||
(("max spare") (7 bits) ("maxspare"))
|
||||
;; FIXME: next field should be conditional on max_variable,
|
||||
(("maximum") (addrsize bytes) ("max"))
|
||||
|
||||
(("min declaration type flag") (1 bit) ("min_variable"))
|
||||
(("min spare") (7 bits) ("minspare"))
|
||||
;; FIXME: next field should be conditional on min_variable
|
||||
(("minimum") (addrsize bytes) ("min"))))
|
||||
(("negotiation") (2 bytes) ("neg")))
|
||||
|
||||
|
||||
("dso" 0x3a
|
||||
(("function name") (2 bytes) ("sid"))
|
||||
(("sp update count") (4 bytes) ("spupdates"))
|
||||
(repeat "ptr->spupdates"
|
||||
(("update address") (addrsize bytes) ("address"))
|
||||
(("offset") (addrsize bytes) ("offset"))))
|
||||
|
||||
("dln" 0x38
|
||||
(("number of lines") (2 bytes) ("nln"))
|
||||
(repeat "ptr->nln"
|
||||
(("source file number") (2 bytes) ("sfn"))
|
||||
(("source line number") (2 bytes) ("sln"))
|
||||
(("section number") (2 bytes) ("section"))
|
||||
(("from address") (addrsize bytes) ("from_address"))
|
||||
(("to address") (addrsize bytes) ("to_address"))
|
||||
(("call count") (2 bytes) ("cc"))
|
||||
)
|
||||
(("neg") (2 bytes) ("neg")))
|
||||
|
||||
("dpp" 0x46
|
||||
(("start/end") (1 bit) ("end"))
|
||||
(("spare") (7 bits) ("spare"))
|
||||
(cond "!ptr->end"
|
||||
(("params") (1 byte) ("params"))
|
||||
(("neg number") (2 bytes) ("neg"))))
|
||||
|
||||
("den" 0x4a
|
||||
(("start/end") (1 bit) ("end"))
|
||||
(("spare") (7 bits) ("spare"))
|
||||
(cond "!ptr->end"
|
||||
(("neg number") (2 bytes) ("neg"))))
|
||||
|
||||
("dfp" 0x48
|
||||
(("start/end flag") (1 bit) ("end"))
|
||||
(("spare") (7 bits) ("spare"))
|
||||
(cond "!ptr->end"
|
||||
(("number of parameters") (1 byte) ("nparams"))
|
||||
(("neg number") (2 bytes) ("neg"))))
|
||||
|
||||
("dds" 0x4c
|
||||
(("start/end") (1 bit) ("end"))
|
||||
(("spare") (7 bits) ("spare"))
|
||||
(cond "!ptr->end"
|
||||
(("neg number") (2 bytes) ("neg"))))
|
||||
|
||||
("dpt" 0x50
|
||||
(("neg number") (2 bytes) ("neg"))
|
||||
(("dunno") (1 byte) ("dunno")))
|
||||
|
||||
("dse" 0x54
|
||||
(("neg number") (2 bytes) ("neg"))
|
||||
(("dunno") (1 byte) ("dunno")))
|
||||
|
||||
("dot" 0x56
|
||||
(("unknown") (1 byte) ("unknown")))
|
||||
; FIXME: unknown field should be repeated symbol number?
|
||||
|
||||
|
||||
("dss" 0x42
|
||||
(("type") (1 byte) ("type"))
|
||||
(("external/internal") (1 bit) ("internal"))
|
||||
(("spare") (7 bits) ("spare"))
|
||||
(cond "!ptr->internal"
|
||||
( ("package name") (chars variable byte) ("package")))
|
||||
(cond "ptr->internal"
|
||||
(("symbol id") (2 bytes) ("id")))
|
||||
(("record type") (2 bytes) ("record"))
|
||||
(("rules") (chars variable byte) ("rules"))
|
||||
(("number of symbols") (2 bytes) ("nsymbols"))
|
||||
(("unknown" ) (2 bytes) ("fixme")))
|
||||
|
||||
("pss" 0x40
|
||||
(("negotiation number") (2 bytes) ("efn"))
|
||||
(("number of source files") (2 bytes) ("ns"))
|
||||
(repeat "ptr->ns"
|
||||
(("directory reference bit") (1 bit) ("drb"))
|
||||
(("spare") (7 bits) ("spare"))
|
||||
(("completed file name") (chars variable byte) ("fname"))
|
||||
(cond "ptr->drb[n]"
|
||||
(("directory apperance number") (2 bytes) ("dan"))))
|
||||
|
||||
(("number of directories") (2 bytes) ("ndir"))
|
||||
(repeat "ptr->ndir"
|
||||
(("directory name") (chars variable bytes) ("dname"))))
|
||||
|
||||
|
||||
; FIXME: the tr block has no contents. sysinfo, etc. aren't prepared
|
||||
; to deal with that.
|
||||
; ("tr" 0x7f)
|
||||
|
||||
|
||||
("dus" 0x40
|
||||
(("negotiation number") (2 bytes) ("efn"))
|
||||
(("number of source files") (2 bytes) ("ns"))
|
||||
(repeat "ptr->ns"
|
||||
(("directory reference bit") (1 bit) ("drb"))
|
||||
(("spare") (7 bits) ("spare"))
|
||||
(("completed file name") (chars variable byte) ("fname"))
|
||||
(cond "ptr->drb[n]"
|
||||
(("directory apperance number") (2 bytes) ("dan"))))
|
||||
(("number of directories") (2 bytes) ("ndir"))
|
||||
(repeat "ptr->ndir"
|
||||
(("directory name") (chars variable bytes) ("dname"))))
|
||||
|
||||
|
||||
("dps" 0x32
|
||||
(("start/end flag") (1 bit) ("end"))
|
||||
(("block type") (7 bits) ("type")
|
||||
(("BLOCK_TYPE_COMPUNIT" "0")
|
||||
("BLOCK_TYPE_PROCEDURE" "2")
|
||||
("BLOCK_TYPE_FUNCTION" "3")
|
||||
("BLOCK_TYPE_BLOCK" "4")
|
||||
("BLOCK_TYPE_BASIC" "9")))
|
||||
(cond "!ptr->end"
|
||||
(("optimization") (1 byte) ("opt"))
|
||||
(("section number") (2 bytes) ("san"))
|
||||
(("address") (addrsize bytes) ("address"))
|
||||
(("block size") (addrsize bytes) ("block_size"))
|
||||
(("nesting") (1 byte) ("nesting"))
|
||||
(cond "ptr->type == BLOCK_TYPE_PROCEDURE
|
||||
|| ptr->type == BLOCK_TYPE_FUNCTION"
|
||||
(("return address") (1 bit) ("retaddr"))
|
||||
(("interrupt function flag") (1 bit) ("intrflag"))
|
||||
(("stack update flag") (1 bit) ("stackflag"))
|
||||
(("intra page JMP") (1 bit) ("intrpagejmp"))
|
||||
(("spare") (4 bits) ("spare")))
|
||||
(("neg number") (2 bytes) ("neg"))))
|
||||
|
||||
@@ -1,799 +0,0 @@
|
||||
2001-07-27 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* binutils-all/windres/windres.exp: Don't set xfail for
|
||||
bmpalign (compare) on none-ix86/pe targets.
|
||||
|
||||
2001-07-24 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* binutils-all/windres/windres.exp: Set xfail on none-ix86/pe
|
||||
targets.
|
||||
|
||||
2001-07-18 DJ Delorie <dj@redhat.com>
|
||||
|
||||
* config/default.exp (WINDRES): Add.
|
||||
* binutils-all/windres/windres.exp: New.
|
||||
* binutils-all/windres/README: New.
|
||||
* binutils-all/windres/bmp1.bmp: New.
|
||||
* binutils-all/windres/bmpalign.rc: New.
|
||||
* binutils-all/windres/bmpalign.rsd: New.
|
||||
* binutils-all/windres/lang.rc: New.
|
||||
* binutils-all/windres/lang.rsd: New.
|
||||
* binutils-all/windres/msupdate: New.
|
||||
* binutils-all/windres/strtab1.rc: New.
|
||||
* binutils-all/windres/strtab1.rsd: New.
|
||||
|
||||
2001-07-05 Ben Elliston <bje@redhat.com>
|
||||
|
||||
* lib/utils-lib.exp (target_assemble): Remove duplicate copy.
|
||||
(default_target_assemble): Likewise.
|
||||
|
||||
2001-06-18 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
|
||||
|
||||
* binutils-all/readelf.exp: Typo.
|
||||
|
||||
2001-06-19 Andreas Jaeger <aj@suse.de>
|
||||
|
||||
* binutils-all/readelf.r: Don't check for specific info value to
|
||||
pass testsuite on ia64 and alpha.
|
||||
|
||||
2001-06-07 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* binutils-all/readelf.ss-mips: Support stabs.
|
||||
* binutils-all/readelf.ss-tmips: Likewise.
|
||||
|
||||
2001-05-25 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* binutils-all/readelf.exp (readelf_test): Set target_machine
|
||||
to tmips for traditional mips.
|
||||
|
||||
* binutils-all/readelf.s: Support traditional mips.
|
||||
|
||||
* binutils-all/readelf.ss-tmips: New for traditional mips.
|
||||
|
||||
2001-05-25 Alan Modra <amodra@one.net.au>
|
||||
|
||||
* binutils-all/readelf.exp: Replace linuxoldld with linux*oldld
|
||||
and linuxaout with linux*aout.
|
||||
* binutils-all/objcopy.exp: Remove xfail for linuxaout.
|
||||
|
||||
2001-05-24 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* binutils-all/objdump.exp (cpus_expected): Add s390.
|
||||
|
||||
2001-03-30 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* binutils-all/readelf.exp: Run on more ELF targets.
|
||||
|
||||
2001-02-11 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* config/default.exp: Set up gcc_gas_flag.
|
||||
|
||||
* binutils-all/objcopy.exp (copy_setup): Process gcc_gas_flag
|
||||
for Linux only.
|
||||
|
||||
* binutils-all/testprog.c: Include <string.h> and don't use
|
||||
exit ().
|
||||
|
||||
2001-01-16 Matthew Green <mrg@redhat.com>
|
||||
|
||||
* binutils-all/readelf.s-64: Match readelf -S output.
|
||||
|
||||
2000-12-09 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* binutils-all/objdump.exp (cpus_expected): Add tic54x and
|
||||
tms320c54x.
|
||||
|
||||
2000-11-28 Hans-Peter Nilsson <hp@axis.com>
|
||||
|
||||
* binutils-all/readelf.s: Adjust to readelf.c formatting changes.
|
||||
|
||||
2000-11-02 Chris Demetriou <cgd@sibyte.com>
|
||||
|
||||
* binutils-all/readelf.exp (regexp_diff): Add code
|
||||
from gas testsuite to treat "#..." at beginning of line
|
||||
as an indicator to skip extra non-matching lines at that
|
||||
location.
|
||||
(readelf_test): Add support for using a machine-specific
|
||||
regexp comparison file.
|
||||
(readelf -S test, readelf -s test): Remove v850*-*-* and
|
||||
mips*-*-* from list of expected failures.
|
||||
* binutils-all/readelf.s: Accomodate changes due to
|
||||
additional sections (and therefore section numbering
|
||||
differences) on v850*-*-* and mips*-*-* targets.
|
||||
* binutils-all/readelf.ss: Likewise.
|
||||
* binutils-all/readelf.ss-mips: New file, which matches
|
||||
expected output of readelf -s test for mips*-*-*.
|
||||
|
||||
2000-10-25 Hans-Peter Nilsson <hp@axis.com>
|
||||
|
||||
* binutils-all/readelf.exp (-wi test): Add cris-*-* to xfails.
|
||||
|
||||
2000-10-19 Chris Demetriou <cgd@sibyte.com>
|
||||
|
||||
* binutils-all/readelf.exp (readelf_test): Work properly
|
||||
when multiple targets expect failtures.
|
||||
(readelf -S test, readelf -s test): Expect mips*-*-*
|
||||
to fail.
|
||||
|
||||
2000-07-10 Alan Modra <alan@linuxcare.com.au>
|
||||
|
||||
* lib/utils-lib.exp (default_binutils_assemble): Don't do the hppa
|
||||
sed fudges for hppa-linux.
|
||||
|
||||
2000-07-01 Frank Ch. Eigler <fche@redhat.com>
|
||||
|
||||
* binutils-all/objdump.exp (cpus_expected, cpus_regex): Reorganize
|
||||
syntax to display more tcl nature.
|
||||
|
||||
2000-06-18 Stephane Carrez <stcarrez@worldnet.fr>
|
||||
|
||||
* binutils-all/objdump.exp (cpus_expected): Recognize m68hc11 and
|
||||
m68hc12.
|
||||
|
||||
2000-06-18 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* binutils-all/readelf.wi: Do not assume the compilation tag to be
|
||||
unit 1.
|
||||
|
||||
* binutils-all/objcopy.exp: Expect all arm variants to fail the
|
||||
copying executable test.
|
||||
|
||||
2000-06-14 Hans-Peter Nilsson <hp@bitrange.com>
|
||||
|
||||
* binutils-all/readelf.exp (regexp_diff): Do not break when a
|
||||
mismatching line is found.
|
||||
(readelf_find_size): New.
|
||||
(readelf_size): New global variable.
|
||||
(readelf_test): Add newline to send_log of command.
|
||||
If $srcdir/$subdir/$regexp_file-$readelf_size exists, use it
|
||||
instead of $srcdir/$subdir/$regexp_file.
|
||||
(*-*elf test): Fix typo in message.
|
||||
* binutils-all/readelf.s-64: New.
|
||||
* binutils-all/readelf.ss-64: New.
|
||||
|
||||
2000-05-02 Alan Modra <alan@linuxcare.com.au>
|
||||
|
||||
* binutils-all/objcopy.exp (simple copy): Clear xfail for hppa-linux.
|
||||
|
||||
* binutils-all/hppa/objdump.exp: Disable test for elf.
|
||||
|
||||
2000-03-13 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* binutils-all/readelf.s: Adjust to match new format of readelf
|
||||
output.
|
||||
* binutils-all/readelf.ss: Adjust to match new format of readelf
|
||||
output.
|
||||
|
||||
1999-11-01 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Expect simple objcopy test to fail
|
||||
for COFF based ARM and Thumb ports.
|
||||
|
||||
Tue Sep 14 00:28:17 1999 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* binutils-all/hppa/objdump.exp: Do not run for PA64.
|
||||
|
||||
1999-09-04 Steve Chamberlain <sac@pobox.com>
|
||||
|
||||
* binutils-all/objdump.exp: Add pj to cpus_expected.
|
||||
|
||||
Sat Aug 28 00:24:27 1999 Jerry Quinn <jquinn@nortelnetworks.com>
|
||||
|
||||
* binutils-all/hppa/freg.s: New file.
|
||||
* binutils-all/hppa/objdump.exp: Add freg.s test.
|
||||
|
||||
1999-08-09 Ian Lance Taylor <ian@zembu.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Add setup_xfail for simple copy test
|
||||
for i*86-*-msdos*.
|
||||
|
||||
1999-07-21 H.J. Lu <hjl@gnu.org>
|
||||
|
||||
* binutils-all/testprog.c: Include <stdio.h>.
|
||||
|
||||
1999-06-29 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* binutils-all/objdump.exp: Add fr30 and MCore to expected cpus
|
||||
list.
|
||||
|
||||
* binutils-all/readelf.r: Do not assume a fixed number of spaces
|
||||
in the output.
|
||||
|
||||
1999-06-10 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* binutils-all/readelf.wi: Update to match latest output.
|
||||
* binutils-all/readelf.h: Update to match latest output.
|
||||
|
||||
Wed Jun 9 11:59:22 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
|
||||
|
||||
* binutils-all/objdump.exp: Tighten regexp to match `objdump -i'
|
||||
output to avoid massive exponential behaviour.
|
||||
|
||||
1999-05-28 Ian Lance Taylor <ian@zembu.com>
|
||||
|
||||
* binutils-all/readelf.h: Update for changes of 1999-04-08.
|
||||
|
||||
1999-03-12 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* binutils-all/readelf.wi: Remove FR30 specific components.
|
||||
* binutils-all/readelf.s: Remove RELA specific components.
|
||||
|
||||
1999-02-16 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* binutils-all/readelf.s: Do not assume section alignment is 4.
|
||||
* binutils-all/readelf.r: Do not assume rela's are being used.
|
||||
* binutils-all/readelf.exp: disable tests for non ELF based
|
||||
targets.
|
||||
|
||||
1999-02-02 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* binutils-all/readelf.wi: Amend to match new readelf output.
|
||||
* binutils-all/readelf.r: Do not assume that RELAs will be used.
|
||||
|
||||
1999-01-29 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* config/default.exp: Add definitions of READELF and READELFFLAGS.
|
||||
|
||||
* binutils-all/readelf.exp: New file: Readelf tests
|
||||
* binutils-all/readelf.h: New file: Expected results for 'readelf -h'
|
||||
* binutils-all/readelf.s: New file: Expected results for 'readelf -S'
|
||||
* binutils-all/readelf.ss: New file: Expected results for 'readelf -s'
|
||||
* binutils-all/readelf.r: New file: Expected results for 'readelf -r'
|
||||
* binutils-all/readelf.wi: New file: Expected results for 'readelf -wi'
|
||||
|
||||
Wed Dec 9 19:11:39 1998 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* binutils-all/objcopy.exp (copy_executable): Expect comparison
|
||||
failure for mips*-*-elf.
|
||||
|
||||
Fri Oct 16 22:57:12 1998 Felix Lee <flee@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: fix "no symbols" message.
|
||||
|
||||
Tue Jul 28 15:14:04 1998 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* binutils-all/objcopy.exp: Keep "main" and "_main" for strip with
|
||||
saving symbol tests. Look for either "main" or "_main" in the output
|
||||
file. Fix test for "no symbols" in the output file.
|
||||
|
||||
1998-07-22 Vladimir N. Makarov <vmakarov@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Polish output about fail for objcopy
|
||||
(simple copy), strip with/without saving a symbol for object file
|
||||
and executable.
|
||||
|
||||
Wed Jul 1 16:27:40 1998 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: ARM simple objcopy now passes.
|
||||
|
||||
Wed Jun 24 09:20:21 1998 Nick Clifton <nickc@cygnus.com>
|
||||
|
||||
* binutils-all/objdump.exp: Look for '.data' rather than 'data'
|
||||
when parsing output of objdump -h.
|
||||
* binutils-all/size.exp: Look for '.data' rather than 'data' when
|
||||
parsing output of size -A.
|
||||
|
||||
1998-07-20 Vladimir N. Makarov <vmakarov@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Two new tests - strip object file with
|
||||
saving a symbol and strip executable file with saving a symbol.
|
||||
|
||||
Fri May 29 14:50:24 1998 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Don't xfail the simple objcopy test
|
||||
when cross compiling.
|
||||
|
||||
Thu Nov 6 14:32:37 1997 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* lib/utils-lib.exp: Temporary definition of target_assemble and
|
||||
default_target_assemble so that testing can work with older
|
||||
dejagnu versions.
|
||||
|
||||
Wed Sep 24 12:09:15 1997 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp(strip_executable): Make a new copy of
|
||||
the executable being tested.
|
||||
|
||||
Mon Sep 15 21:25:20 1997 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Compile the executables to be tested
|
||||
on the target with a status wrapper (as necessary).
|
||||
|
||||
* binutils-all/ar.exp: If testing on a remote host, don't bother
|
||||
looking on the local host for the program being tested. Use the
|
||||
correct filenames on the remote host.
|
||||
|
||||
* binutils-all/nm.exp: Ditto.
|
||||
|
||||
* binutils-all/size.exp: Ditto.
|
||||
|
||||
* binutils-all/objdump.exp: Ditto.
|
||||
(cpus_expected): Add the target CPU to the regexp of CPUs to be
|
||||
expected, if it's not already there.
|
||||
|
||||
Thu Aug 28 09:57:27 1997 Doug Evans <dje@canuck.cygnus.com>
|
||||
|
||||
* binutils-all/objdump.exp (cpus_expected): Add arc.
|
||||
|
||||
Tue Aug 5 00:03:20 1997 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* config/default.exp: Look for nm-new and strip-new.
|
||||
|
||||
Tue Jun 3 17:12:54 1997 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* config/default.exp: Remove expect_before statement.
|
||||
|
||||
* binutils-all/objcopy.exp: Don't use global exec_output variable;
|
||||
the output is returned from remote_load instead.
|
||||
|
||||
Mon May 12 22:14:20 1997 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp(strip_test): Tests that
|
||||
fail to compile are untested, not unresolved.
|
||||
(copy_setup): Ditto.
|
||||
|
||||
* lib/utils-lib.exp(default_binutils_assemble): Call
|
||||
target_assemble instead of target_compile.
|
||||
|
||||
Wed Apr 30 20:37:51 1997 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
Changes to support multilib and remote hosted testing, along with
|
||||
general cleanups and simplifications.
|
||||
|
||||
* lib/utils-lib.exp(binutil_version): Use remote_exec.
|
||||
(default_binutils_run): Ditto.
|
||||
(default_binutils_assemble): Remove first argument; call
|
||||
target_compile to actually do the assembly.
|
||||
(default_binutils_compile,default_binutils_remove,prune_warnings):
|
||||
Delete.
|
||||
|
||||
* config/default.exp: Remove AS and ASFLAGS.
|
||||
(binutils_compile,binutils_remove): Delete.
|
||||
(binutils_assemble): Remove first argument.
|
||||
|
||||
* binutils-all/ar.exp: See if we're running the tests on
|
||||
a remote host, and download/upload files as appropriate.
|
||||
Replace calls to binutils_remove with remote_file. Replace
|
||||
calls to binutils_compile with target_compile. Remove initial
|
||||
argument to binutils_assemble. Use remote_load to execute
|
||||
programs on the target.
|
||||
* binutils-all/nm.exp: Ditto.
|
||||
* binutils-all/objcopy.exp: Ditto.
|
||||
* binutils-all/objdump.exp: Ditto.
|
||||
* binutils-all/size.exp: Ditto.
|
||||
|
||||
Mon Apr 14 12:36:41 1997 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/ar.exp (long_filenames): Check for a file system
|
||||
with a 14 character file name length limit.
|
||||
|
||||
Tue Apr 1 09:52:15 1997 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* binutils-all/objdump.exp: Handle d10v.
|
||||
|
||||
Fri Feb 7 16:45:34 1997 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* binutils-all/ar.exp: Use prune_warnings instead of
|
||||
prune_system_crud.
|
||||
* binutils-all/objcopy.exp: Ditto.
|
||||
|
||||
Wed Jan 29 00:16:43 1997 Bob Manson <manson@charmed.cygnus.com>
|
||||
|
||||
* binutils-all/nm.exp: Use / between $srcdir and $subdir.
|
||||
* binutils-all/objcopy.exp: Ditto.
|
||||
* binutils-all/objdump.exp: Ditto.
|
||||
* binutils-all/size.exp: Ditto.
|
||||
* binutils-all/hppa/objdump.exp: Ditto.
|
||||
|
||||
|
||||
Wed Oct 16 22:57:59 1996 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* binutils-all/objdump.exp: Add mn10200 and mn10300 to expected
|
||||
cpus list.
|
||||
|
||||
Tue Oct 1 15:06:55 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* lib/utils-lib.exp (binutil_version): Fix for current version
|
||||
printing.
|
||||
|
||||
Sun Aug 4 22:25:40 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Fix end of line matching in srec tests
|
||||
to work with TCL 7.5.
|
||||
|
||||
Sat Jun 29 12:51:30 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Simple copy test works for i960 b.out
|
||||
targets.
|
||||
|
||||
Mon Jun 24 14:33:04 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: On OSF/1, the simple copy test will
|
||||
succeed with gas, and fail with /bin/as, so mark it as an expected
|
||||
failure only if it fails.
|
||||
|
||||
Tue Mar 26 16:55:08 1996 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* binutils-all/objcopy.exp: No longer expect adjust-section-vma
|
||||
test to fail for hppa*-*-proelf*.
|
||||
|
||||
Mon Mar 11 08:25:14 1996 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* binutils-all/objdump.exp: Look for "$CODE$", not just "CODE".
|
||||
|
||||
Wed Jan 31 11:55:13 1996 Jeffrey A Law (law@cygnus.com)
|
||||
|
||||
* binutils-all/objcopy.exp: Expect adjust-section-vma tests to
|
||||
fail for hppa*-*-proelf* targets.
|
||||
|
||||
Thu Jan 25 13:53:04 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objdump.exp: Update for objdump -h format change.
|
||||
* binutils-all/objcopy.exp: Likewise.
|
||||
|
||||
Mon Jan 15 18:14:14 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Use the lma, not the vma, when testing
|
||||
address adjustments.
|
||||
|
||||
Fri Dec 15 16:31:55 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objdump.exp: Update objdump -i test for current
|
||||
objdump output.
|
||||
|
||||
Mon Nov 27 15:15:09 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Correct fail calls to always use the
|
||||
same string as the pass call.
|
||||
|
||||
Wed Nov 22 13:18:58 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* lib/utils-lib.exp (prune_system_crud): Discard -g -O warnings
|
||||
from native compilers on OSF/1 and SunOS.
|
||||
|
||||
Fri Nov 17 10:36:09 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* lib/utils-lib.exp (default_binutils_compiler: Change error
|
||||
message to say compilation rather than assembly.
|
||||
|
||||
Wed Nov 15 18:34:42 1995 Ken Raeburn <raeburn@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Simple copy test does appear to work
|
||||
on i*86-svr4.
|
||||
|
||||
Wed Nov 15 12:19:28 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: If assembly fails, call unresolved.
|
||||
Test running objcopy and strip on a final executable.
|
||||
* binutils-all/testprog.c: New file.
|
||||
* config/default.exp (STRIP, STRIPFLAGS): Define.
|
||||
(binutils_compile): New procedure.
|
||||
* lib/utils-lib.exp (default_binutils_compile): New procedure.
|
||||
|
||||
Fri Nov 3 13:22:33 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* lib/utils-lib.exp (default_binutils_run): Don't use verbose
|
||||
-log, reverting part of Oct 2 change.
|
||||
|
||||
Wed Nov 1 15:09:57 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 <manfred@lts.sel.alcatel.de>
|
||||
|
||||
* binutils-all/objcopy.exp: Add setup_xfails for
|
||||
m68*-motorola-sysv* and m88*-motorola-sysv*.
|
||||
|
||||
Wed Oct 4 14:38:31 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/nm.exp: Add setup_xfails for XCOFF.
|
||||
|
||||
Mon Oct 2 12:41:48 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/ar.exp: New file.
|
||||
* binutils-all/bintest.s: Make text_symbol and data_symbol global.
|
||||
Add new static symbols static_text_symbol and static_data_symbol.
|
||||
* binutils-all/nm.exp: Adjust accordingly.
|
||||
* config/default.exp (AR): Set if not set.
|
||||
(binutils_remove): New procedure.
|
||||
* lib/utils-lib.exp (default_binutils_run): Call
|
||||
prune_system_crud on program output. Use verbose -log instead of
|
||||
both verbose and send_log.
|
||||
(default_binutils_remove): New procedure.
|
||||
|
||||
* lib/utils-lib.exp (default_binutils_assemble): Call
|
||||
prune_system_crud on assembler output.
|
||||
|
||||
Tue Sep 26 14:07:05 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Add setup_xfails for simple copy test
|
||||
for i386 COFF targets.
|
||||
|
||||
Wed Sep 13 13:20:21 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* lib/utils-lib.exp (prune_system_crud): Define if not defined.
|
||||
* binutils-all/objcopy.exp: Call prune_system_crud on cmp output.
|
||||
|
||||
Sat Aug 19 17:38:06 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Add xfail for i*86-*-aout* for simple
|
||||
copy test.
|
||||
|
||||
Wed Aug 16 16:52:53 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/nm.exp: Add setup_xfail for mips*-sony-bsd* for
|
||||
tests which fail on ECOFF targets.
|
||||
|
||||
* binutils-all/objcopy.exp: Change i*86-*-linux xfail for simple
|
||||
copy test to check for i*86-*-linuxaout* instead.
|
||||
|
||||
Tue Aug 8 17:48:37 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Add setup_xfail for a29k-*-vxworks*
|
||||
for simple copy test.
|
||||
|
||||
Tue Jul 25 11:57:12 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Change setup_xfail for simple copy
|
||||
test from i960-*-vxworks5.1 to i960-*-vxworks*.
|
||||
|
||||
Mon Jul 10 12:25:46 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Add setup_xfail for z8*-*-coff for
|
||||
simple copy test.
|
||||
* binutils-all/objdump.exp (cpus_expected): Add z8001 and z8002.
|
||||
|
||||
Sun May 21 20:32:53 1995 Jeff Law (law@snake.cs.utah.edu)
|
||||
|
||||
* binutils-all/hppa/objdump.exp (addendbug): Handle PA ELF targets
|
||||
too.
|
||||
* binutils-all/objcopy.exp (simple copy): Don't expect PA ELF
|
||||
targets to fail.
|
||||
|
||||
Tue Apr 4 14:52:08 1995 Jeff Law (law@snake.cs.utah.edu)
|
||||
|
||||
* binutils-all/hppa: Renamed from binutils-hppa.
|
||||
|
||||
Wed Mar 29 12:02:43 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Add setup_xfail for simple copy test
|
||||
for h8500-*-hms and h8500-*-coff.
|
||||
|
||||
Tue Mar 28 11:18:28 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Add setup_xfail for simple copy test
|
||||
for m68*-ericsson-ose and m88*-*-coff.
|
||||
|
||||
Mon Mar 27 11:27:31 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Add setup_xfail for simple copy test
|
||||
for m68*-*-vxworks*.
|
||||
|
||||
Fri Mar 24 11:44:25 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-hppa/objdump.exp: Correct hppa*-*-* check.
|
||||
|
||||
Tue Mar 21 10:48:45 1995 Jeff Law (law@snake.cs.utah.edu)
|
||||
|
||||
* binutils-hppa/addendbug.s: New testcase.
|
||||
* binutils-hppa/objdump.exp: Run it.
|
||||
|
||||
Mon Mar 20 11:31:05 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* lib/utils-lib.exp (default_binutils_run): Quote any dollar signs
|
||||
in progargs before passing it to exec.
|
||||
|
||||
Fri Mar 17 16:39:31 1995 Jeff Law (law@snake.cs.utah.edu)
|
||||
|
||||
* config/hppa.sed: Sed script to transform bintest.s into proper
|
||||
PA assembly code.
|
||||
* binutils-all/nm.exp: Enable these tests on the PA.
|
||||
* binutils-all/objcopy.exp: Enable these tests on the PA. Expect
|
||||
simple copy to fail.
|
||||
* binutils-all/objdump.exp: Enable these tests on the PA. Handle
|
||||
"CODE" as a section name.
|
||||
* binutils-all/size.exp: Enable these tests on the PA.
|
||||
* lib/utils-lib.exp (default_binutils_assemble): For "hppa*-*-*",
|
||||
run the assembly through a sed script before passing it to the
|
||||
assembler.
|
||||
|
||||
Wed Mar 15 16:47:13 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/objdump.exp: Force section sizes to be interpreted
|
||||
in hex. Change objdump -h failure mode to always use the same
|
||||
string.
|
||||
|
||||
Thu Jan 5 13:01:43 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
* binutils-all/nm.exp: Just check for irix4*, rather than
|
||||
irix\[0-4\]*, to avoid DejaGnu bug.
|
||||
|
||||
Thu Dec 15 19:35:31 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Expect simple-objcopy test to fail
|
||||
for various other targets for which gas doesn't use bfd: sh-hms,
|
||||
m68k-hpux, m68k-sunos, m68k-coff, i386-linux, a29k-udi, a29k-coff,
|
||||
i960-vxworks5.1, i960-coff, h8300-hms, h8300-coff.
|
||||
|
||||
Wed Dec 14 15:54:46 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
|
||||
|
||||
* binutils-all/size.exp: Skip tests requiring bintest.o on hppa,
|
||||
since it (correctly) generates syntax errors on that platform.
|
||||
* binutils-all/objdump.exp: Ditto.
|
||||
* binutils-all/nm.exp: Ditto.
|
||||
* binutils-all/objcopy.exp: Ditto. Also, move setup_xfail for
|
||||
sh-coff to branch where objcopy execution produced no error
|
||||
messages. Expect failure for hp300 also.
|
||||
|
||||
Thu Dec 8 14:36:15 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
|
||||
|
||||
* binutils-all/objdump.exp (cpus_expected): New variable, taken
|
||||
from objdump -i test, added ns32k and powerpc, sorted.
|
||||
(objdump -i, -f tests): Use $cpus_expected.
|
||||
|
||||
* binutils-all/objcopy.exp: For simple-copy test, expect failure
|
||||
for sh-coff.
|
||||
|
||||
Tue Oct 25 16:00:14 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
|
||||
|
||||
* binutils-all/objcopy.exp: Adjust --adjust-section-vma tests for
|
||||
new S-record section handling.
|
||||
|
||||
Tue Oct 18 11:18:21 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
|
||||
|
||||
* binutils-all/nm.exp: nm with no arguments and nm -P do not work
|
||||
as expected on ECOFF targets; add calls to setup_xfail.
|
||||
|
||||
* binutils-all/objcopy.exp: New file.
|
||||
* config/default.exp: Initialize OBJCOPY and OBJCOPYFLAGS.
|
||||
|
||||
Fri Oct 14 14:46:22 1994 Ian Lance Taylor <ian@sanguine.cygnus.com>
|
||||
|
||||
Rewrite testsuite.
|
||||
* configure.in, Makefile.in: Remove.
|
||||
* binutils-all/configure.in, binutils-all/Makefile.in: Remove.
|
||||
* binutils-all/bintest.c: Remove.
|
||||
* binutils-all/bintest.s: New file.
|
||||
* binutils-all/nm.exp, binutils-all/objdump.exp: Rewrite.
|
||||
* binutils-all/size.exp: Rewrite.
|
||||
* config/default.exp: Load utils-lib.exp. Set AS and ASFLAGS.
|
||||
Don't go up one directory from $base_dir. Create tmpdir.
|
||||
(binutils_run, binutils-assemble): New procedures.
|
||||
* config/unix.exp: Remove.
|
||||
* config/mt-a29k-udi, config/mt-i386-aout: Remove.
|
||||
* config/mt-i960-nindy, config/mt-lynx, config/mt-m68k: Remove.
|
||||
* config/mt-mips-ecoff, config/mt-slite: Remove.
|
||||
* config/mt-sparc-aout, config/mt-vxworks: Remove.
|
||||
* lib/utils-lib.exp (binutil_version): Don't redirect standard
|
||||
input when getting version. Don't unset errorInfo.
|
||||
(default_binutils_run): New procedure.
|
||||
(default_binutils_assemble): New procedure.
|
||||
|
||||
Thu Sep 29 12:45:39 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* VMS does not permit `.' in directory names: renamed binutils.all
|
||||
to binutils-all.
|
||||
* configure.in (configdirs): Change binutils.all to binutils-all.
|
||||
|
||||
Fri Sep 23 16:01:14 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* configure.in: Use mt-m68k for m68k*-*-aout* and m68k*-*-coff*,
|
||||
not for m68k-*-*.
|
||||
|
||||
Fri Sep 23 13:54:50 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
|
||||
|
||||
* binutils.all/objdump.exp: Added ARM to list of CPU types.
|
||||
|
||||
Thu Sep 22 11:04:50 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* binutils.all/objdump.exp: Update for new usage message.
|
||||
* binutils.all/size.exp: Use a double backslash in the string to
|
||||
get a single backslash to the regexp matcher. Accept $TEXT$,
|
||||
$DATA$ and $BSS$ as well as .text, .data and .bss, for HP/UX.
|
||||
|
||||
Fri Sep 2 12:53:10 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* config/unix.exp: If nm.new does not exist, use [transform nm].
|
||||
* config/default.exp: Likewise.
|
||||
|
||||
Wed Aug 24 12:41:37 1994 Ian Lance Taylor (ian@sanguine.cygnus.com)
|
||||
|
||||
* configure.in, binutils.all/configure.in: Change i386 to
|
||||
i[345]86.
|
||||
|
||||
Tue Jul 19 15:23:53 1994 Bill Cox (bill@rtl.cygnus.com)
|
||||
|
||||
* config/mt-mips-ecoff: Add -Tidp.ld option.
|
||||
|
||||
Thu Jun 30 12:41:55 1994 J.T. Conklin (jtc@phishhead.cygnus.com)
|
||||
|
||||
* config/default.exp: Use nm.new, not nm, from newly built tree.
|
||||
|
||||
Tue May 17 14:04:05 1994 Bill Cox (bill@rtl.cygnus.com)
|
||||
|
||||
* config/default.exp, config/unix.exp: Replace error
|
||||
proc calls with perror.
|
||||
|
||||
Tue May 10 11:20:54 1994 Stan Shebs (shebs@andros.cygnus.com)
|
||||
|
||||
* configure.in (sparclite): Match on sparclite*-*-*.
|
||||
|
||||
Wed Apr 13 18:25:19 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
||||
|
||||
* config/unix.exp: Use nm.new, not nm, from newly built tree.
|
||||
|
||||
* binutils.all/objdump.exp: Add more wildcards to list of
|
||||
single-letter options in pattern for usage message.
|
||||
|
||||
* binutils.all/nm.exp: Deleted debug-symbols test, since it only
|
||||
works for a.out/stabs systems. Fixed regexps to make underscores
|
||||
optional, since some C compilers don't prepend them. Deleted
|
||||
check for foo.o symbol, since again some systems don't generate
|
||||
it.
|
||||
|
||||
Mon Apr 11 10:31:00 1994 Bill Cox (bill@rtl.cygnus.com)
|
||||
|
||||
* Makefile.in (check): Set TCL_LIBRARY for runtest.
|
||||
|
||||
Mon Feb 14 19:34:03 1994 Rob Savoye (rob@darkstar.cygnus.com)
|
||||
|
||||
* Makefile.in: Use new config features of DejaGnu in site.exp
|
||||
file. "Make check" should now work for all crosses.
|
||||
|
||||
Fri Jan 28 18:00:29 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
||||
|
||||
* binutils.all/objdump.exp: In usage message, accept
|
||||
"section-name" as well as "section_name".
|
||||
|
||||
Mon Jan 17 16:57:02 1994 Ken Raeburn (raeburn@cujo.cygnus.com)
|
||||
|
||||
* binutils.all/objdump.exp: Trim list of format names expected,
|
||||
and accept any known CPU type.
|
||||
|
||||
Thu Dec 2 20:50:24 1993 Rob Savoye (rob@darkstar.cygnus.com)
|
||||
|
||||
* Makefile.in: Remove some stuff from the site.exp file.
|
||||
* config/unix.exp: Add global before seeing if the variables for
|
||||
nm, objdump, and size exist.
|
||||
|
||||
Wed Nov 3 11:12:32 1993 Rob Savoye (rob@darkstar.cygnus.com)
|
||||
|
||||
* config/udi.exp,unix.exp: Transform tool name.
|
||||
* binutils.all/*.exp: Clear errorInfo after exec.
|
||||
|
||||
Fri Jul 2 12:41:20 1993 Ian Lance Taylor (ian@cygnus.com)
|
||||
|
||||
* binutils.all/*.exp: Use -- for long arguments rather than +.
|
||||
|
||||
Fri Jun 4 10:52:29 1993 david d `zoo' zuhn (zoo@cirdan.cygnus.com)
|
||||
|
||||
* configure.in: change srctrigger to Makefile.in
|
||||
|
||||
Wed May 26 17:27:46 1993 Ian Lance Taylor (ian@cygnus.com)
|
||||
|
||||
* Makefile.in (FLAGS_TO_PASS): Pass down CC and CFLAGS.
|
||||
|
||||
Fri May 7 13:58:44 1993 Ian Lance Taylor (ian@cygnus.com)
|
||||
|
||||
* binutils.all/objdump.exp: Update for new usage message.
|
||||
|
||||
Mon Apr 19 14:08:52 1993 Rob Savoye (rob@darkstar.cygnus.com)
|
||||
|
||||
* binutils.all/*.exp: Use the new util_test proc.
|
||||
* Makefile.in: Create a local site.exp file with config info.
|
||||
|
||||
Thu Mar 25 05:38:47 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com)
|
||||
|
||||
* nm.all/configure.in (srcname): Delete extra quote.
|
||||
|
||||
Mon Feb 22 07:54:03 1993 Mike Werner (mtw@poseidon.cygnus.com)
|
||||
|
||||
* binutils/testsuite: made modifications to testcases, etc., to allow
|
||||
them to work properly given the reorganization of deja-gnu and the
|
||||
relocation of the testcases from deja-gnu to a "tool" subdirectory.
|
||||
|
||||
Sun Feb 21 10:55:55 1993 Mike Werner (mtw@poseidon.cygnus.com)
|
||||
|
||||
* binutils/testsuite: Initial creation of binutils/testsuite.
|
||||
Migrated dejagnu testcases and support files for testing nm to
|
||||
binutils/testsuite from deja-gnu. These files were moved "as is"
|
||||
with no modifications. This migration is part of a major overhaul
|
||||
of dejagnu. The modifications to these testcases, etc., which
|
||||
will allow them to work with the new version of dejagnu will be
|
||||
made in a future update.
|
||||
@@ -1,219 +0,0 @@
|
||||
# Copyright 1995, 1997 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
|
||||
# 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.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-dejagnu@prep.ai.mit.edu
|
||||
|
||||
# Written by Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
if ![is_remote host] {
|
||||
if {[which $AR] == 0} then {
|
||||
perror "$AR does not exist"
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
# send_user "Version [binutil_version $AR]"
|
||||
|
||||
# Test long file name support
|
||||
|
||||
proc long_filenames { } {
|
||||
global AR
|
||||
global host_triplet
|
||||
|
||||
set testname "ar long file names"
|
||||
|
||||
set n1 "abcdefghijklmnopqrstuvwxyz1"
|
||||
set n2 "abcdefghijklmnopqrstuvwxyz2"
|
||||
set file1 tmpdir/$n1
|
||||
set file2 tmpdir/$n2
|
||||
|
||||
remote_file build delete $file1
|
||||
|
||||
# Some file systems truncate file names at 14 characters, which
|
||||
# makes it impossible to run this test. Check for that now.
|
||||
set status [catch "set f [open tmpdir/$n1 w]" errs]
|
||||
if { $status != 0 } {
|
||||
verbose -log "open tmpdir/$n1 returned $errs"
|
||||
unsupported $testname
|
||||
return
|
||||
}
|
||||
puts $f "first"
|
||||
close $f
|
||||
|
||||
|
||||
remote_file build delete $file2
|
||||
|
||||
set status [catch "set f [open tmpdir/$n2 w]" errs]
|
||||
if { $status != 0 } {
|
||||
verbose -log "open tmpdir/$n2 returned $errs"
|
||||
unsupported $testname
|
||||
return
|
||||
}
|
||||
puts $f "second"
|
||||
close $f
|
||||
|
||||
if [is_remote host] {
|
||||
set file1 [remote_download host $file1];
|
||||
set file2 [remote_download host $file2];
|
||||
set dest artest.a
|
||||
} else {
|
||||
set dest tmpdir/artest.a
|
||||
}
|
||||
|
||||
remote_file host delete $dest;
|
||||
|
||||
set got [binutils_run $AR "rc $dest $file1 $file2"]
|
||||
if [is_remote host] {
|
||||
remote_upload host $file1 tmpdir/$n1
|
||||
}
|
||||
|
||||
set f [open tmpdir/$n1 r]
|
||||
gets $f string
|
||||
close $f
|
||||
if ![string match "first" $string] {
|
||||
verbose -log "reading tmpdir/$n1 returned $string"
|
||||
unsupported $testname
|
||||
return
|
||||
}
|
||||
|
||||
remote_file host delete $dest;
|
||||
set got [binutils_run $AR "rc $dest $file1 $file2"]
|
||||
|
||||
if ![string match "" $got] {
|
||||
fail $testname
|
||||
return
|
||||
}
|
||||
|
||||
remote_file build delete tmpdir/$n1
|
||||
remote_file build delete tmpdir/$n2
|
||||
|
||||
set got [binutils_run $AR "t $dest"]
|
||||
regsub "\[\r\n \t\]*$" "$got" "" got;
|
||||
if ![string match "$n1*$n2" $got] {
|
||||
fail $testname
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
remote_file host delete $file1;
|
||||
remote_file host delete $file2;
|
||||
}
|
||||
|
||||
verbose -log "$AR x $dest"
|
||||
set exec_output [binutils_run $AR "x $dest"]
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
if ![string match "" $exec_output] {
|
||||
verbose -log $exec_output
|
||||
fail $testname
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
remote_upload host $n1 tmpdir/$n1;
|
||||
remote_upload host $n2 tmpdir/$n2;
|
||||
set file1 tmpdir/$n1
|
||||
set file2 tmpdir/$n2
|
||||
} else {
|
||||
set file1 $n1
|
||||
set file2 $n2
|
||||
}
|
||||
|
||||
if ![file exists $file1] {
|
||||
verbose -log "$file1 does not exist"
|
||||
fail $testname
|
||||
return
|
||||
}
|
||||
if ![file exists $file2] {
|
||||
verbose -log "$file2 does not exist"
|
||||
fail $testname
|
||||
return
|
||||
}
|
||||
|
||||
set f [open $file1 r]
|
||||
if { [gets $f line] == -1 || $line != "first" } {
|
||||
verbose -log "$file1 contents:"
|
||||
verbose -log "$line"
|
||||
close $f
|
||||
fail $testname
|
||||
return
|
||||
}
|
||||
close $f
|
||||
|
||||
set f [open $file2 r]
|
||||
if { [gets $f line] == -1 || $line != "second" } {
|
||||
verbose -log "$file2 contents:"
|
||||
verbose -log "$line"
|
||||
close $f
|
||||
fail $testname
|
||||
return
|
||||
}
|
||||
close $f
|
||||
|
||||
pass $testname
|
||||
}
|
||||
|
||||
# Test building the symbol table.
|
||||
|
||||
proc symbol_table { } {
|
||||
global AR
|
||||
global AS
|
||||
global NM
|
||||
global srcdir
|
||||
global subdir
|
||||
|
||||
set testname "ar symbol table"
|
||||
|
||||
if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o] {
|
||||
unresolved $testname
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
set archive artest.a
|
||||
set objfile [remote_download host tmpdir/bintest.o]
|
||||
remote_file host delete $archive
|
||||
} else {
|
||||
set archive tmpdir/artest.a
|
||||
set objfile tmpdir/bintest.o
|
||||
}
|
||||
|
||||
remote_file build delete tmpdir/artest.a
|
||||
|
||||
set got [binutils_run $AR "rc $archive ${objfile}"]
|
||||
if ![string match "" $got] {
|
||||
fail $testname
|
||||
return
|
||||
}
|
||||
|
||||
set got [binutils_run $NM "--print-armap $archive"]
|
||||
if { ![string match "*text_symbol in bintest.o*" $got] \
|
||||
|| ![string match "*data_symbol in bintest.o*" $got] \
|
||||
|| ![string match "*common_symbol in bintest.o*" $got] \
|
||||
|| [string match "*static_text_symbol in bintest.o*" $got] \
|
||||
|| [string match "*static_data_symbol in bintest.o*" $got] \
|
||||
|| [string match "*external_symbol in bintest.o*" $got] } {
|
||||
fail $testname
|
||||
return
|
||||
}
|
||||
|
||||
pass $testname
|
||||
}
|
||||
|
||||
# Run the tests.
|
||||
|
||||
long_filenames
|
||||
symbol_table
|
||||
@@ -1,12 +0,0 @@
|
||||
.globl text_symbol
|
||||
.text
|
||||
text_symbol:
|
||||
static_text_symbol:
|
||||
.long 1
|
||||
.long external_symbol
|
||||
.globl data_symbol
|
||||
.data
|
||||
data_symbol:
|
||||
static_data_symbol:
|
||||
.long 2
|
||||
.comm common_symbol,4
|
||||
@@ -1,23 +0,0 @@
|
||||
.SPACE $PRIVATE$
|
||||
.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
|
||||
.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
|
||||
.SPACE $TEXT$
|
||||
.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
|
||||
.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
|
||||
.IMPORT $global$,DATA
|
||||
.IMPORT $$dyncall,MILLICODE
|
||||
; gcc_compiled.:
|
||||
.SPACE $TEXT$
|
||||
.SUBSPA $CODE$
|
||||
|
||||
.align 4
|
||||
.EXPORT initialize_char_syntax,CODE
|
||||
.EXPORT initialize_char_syntax,ENTRY,PRIV_LEV=3,RTNVAL=GR
|
||||
initialize_char_syntax
|
||||
.PROC
|
||||
.CALLINFO FRAME=64,NO_CALLS,SAVE_SP,ENTRY_GR=3
|
||||
.ENTRY
|
||||
addil L'is_idchar-$global$-32,%r27
|
||||
.EXIT
|
||||
.PROCEND
|
||||
is_idchar .comm 256
|
||||
@@ -1,23 +0,0 @@
|
||||
.LEVEL 2.0
|
||||
.SPACE $PRIVATE$
|
||||
.SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
|
||||
.SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
|
||||
.SPACE $TEXT$
|
||||
.SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
|
||||
.SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
|
||||
.IMPORT $global$,DATA
|
||||
.IMPORT $$dyncall,MILLICODE
|
||||
; gcc_compiled.:
|
||||
.SPACE $TEXT$
|
||||
.SUBSPA $CODE$
|
||||
|
||||
.align 4
|
||||
.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
|
||||
.EXPORT main,ENTRY,PRIV_LEV=3,RTNVAL=GR
|
||||
main
|
||||
.PROC
|
||||
.CALLINFO FRAME=64,CALLS,SAVE_RP
|
||||
.ENTRY
|
||||
fmpyfadd,sgl %fr4L,%fr4R,%fr5R,%fr5L
|
||||
.EXIT
|
||||
.PROCEND
|
||||
@@ -1,96 +0,0 @@
|
||||
# Copyright 1993, 1994, 1995, 1997, 1999, 2000
|
||||
# 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
|
||||
# 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.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-dejagnu@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Rob Savoye <rob@cygnus.com>
|
||||
# and rewritten by Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
if ![istarget hppa*-*-*] then {
|
||||
return
|
||||
}
|
||||
|
||||
# These tests are not suitable for wide mode.
|
||||
if [istarget hppa*w-*-*] then {
|
||||
return
|
||||
}
|
||||
|
||||
# elf hppa assembler doesn't support .subspa
|
||||
if {[istarget *-*-*elf*] || [istarget *-*-linux*]} then {
|
||||
return
|
||||
}
|
||||
|
||||
if {[which $OBJDUMP] == 0} then {
|
||||
perror "$OBJDUMP does not exist"
|
||||
return
|
||||
}
|
||||
|
||||
send_user "Version [binutil_version $OBJDUMP]"
|
||||
|
||||
if {![binutils_assemble $srcdir/$subdir/addendbug.s tmpdir/addendbug.o]} then {
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
set objfile [remote_download host tmpdir/addendbug.o]
|
||||
} else {
|
||||
set objfile tmpdir/addendbug.o
|
||||
}
|
||||
|
||||
# Make sure the SOM BFD code sign extends constants in R_DATA_OVERRIDE fixups.
|
||||
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -r $objfile"]
|
||||
|
||||
if [istarget hppa*-*-*elf*] then {
|
||||
set want "00000000 R_PARISC_DPREL21L\[ \]+is_idchar\\+0xffffffe0.*"
|
||||
} else {
|
||||
set want "00000000 R_DP_RELATIVE\[ \]+is_idchar\\+0xffffffe0.*"
|
||||
}
|
||||
|
||||
|
||||
if [regexp $want $got] then {
|
||||
pass "addendbug test"
|
||||
} else {
|
||||
fail "addendbug test"
|
||||
}
|
||||
|
||||
###########################
|
||||
# Set up the test of freg.s
|
||||
###########################
|
||||
|
||||
if {![binutils_assemble $srcdir/$subdir/freg.s tmpdir/freg.o]} then {
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
set objfile [remote_download host tmpdir/freg.o]
|
||||
} else {
|
||||
set objfile tmpdir/freg.o
|
||||
}
|
||||
|
||||
# Make sure that we get R float regs like we're supposed to
|
||||
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS --disassemble $objfile"]
|
||||
|
||||
set want "fmpyfadd,sgl fr4,fr4R,fr5R,fr5"
|
||||
|
||||
if [regexp $want $got] then {
|
||||
pass "freg test"
|
||||
} else {
|
||||
fail "freg test"
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
# Copyright 1993, 1994, 1995, 1997 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
|
||||
# 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.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-dejagnu@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Rob Savoye <rob@cygnus.com>
|
||||
# and rewritten by Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
if ![is_remote host] {
|
||||
if {[which $NM] == 0} then {
|
||||
perror "$NM does not exist"
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
send_user "Version [binutil_version $NM]"
|
||||
|
||||
|
||||
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
set tempfile [remote_download host tmpdir/bintest.o]
|
||||
} else {
|
||||
set tempfile tmpdir/bintest.o
|
||||
}
|
||||
|
||||
# Test nm with no arguments.
|
||||
|
||||
# This test does not work correctly on ECOFF targets, because ECOFF
|
||||
# stores most symbols twice, which messes up the nm output.
|
||||
setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
|
||||
setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
|
||||
setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
|
||||
|
||||
# This test does not work correctly on XCOFF targets, because XCOFF
|
||||
# does not enter static symbols in the symbol table.
|
||||
setup_xfail "*-*-aix*"
|
||||
|
||||
set got [binutils_run $NM "$NMFLAGS $tempfile"]
|
||||
|
||||
if [info exists vars] then { unset vars }
|
||||
while {[regexp "(\[a-zA-Z\]) (\[a-z_\]*_symbol)(.*)" $got all type symbol rest]} {
|
||||
set vars($symbol) $type
|
||||
set got $rest
|
||||
}
|
||||
|
||||
if {![info exists vars(text_symbol)] \
|
||||
|| $vars(text_symbol) != "T" \
|
||||
|| ![info exists vars(data_symbol)] \
|
||||
|| $vars(data_symbol) != "D" \
|
||||
|| ![info exists vars(common_symbol)] \
|
||||
|| $vars(common_symbol) != "C" \
|
||||
|| ![info exists vars(external_symbol)] \
|
||||
|| $vars(external_symbol) != "U" \
|
||||
|| ![info exists vars(static_text_symbol)] \
|
||||
|| $vars(static_text_symbol) != "t" \
|
||||
|| ![info exists vars(static_data_symbol)] \
|
||||
|| $vars(static_data_symbol) != "d"} {
|
||||
fail "nm (no arguments)"
|
||||
} else {
|
||||
pass "nm (no arguments)"
|
||||
}
|
||||
|
||||
# Test nm -g
|
||||
|
||||
set got [binutils_run $NM "$NMFLAGS -g $tempfile"]
|
||||
|
||||
if [info exists vars] then { unset vars }
|
||||
while {[regexp "(\[a-z_\]*_symbol)(.*)" $got all symbol rest]} {
|
||||
set vars($symbol) 1
|
||||
set got $rest
|
||||
}
|
||||
|
||||
if {![info exists vars(text_symbol)] \
|
||||
|| ![info exists vars(data_symbol)] \
|
||||
|| ![info exists vars(common_symbol)] \
|
||||
|| ![info exists vars(external_symbol)] \
|
||||
|| [info exists vars(static_text_symbol)] \
|
||||
|| [info exists vars(static_data_symbol)]} {
|
||||
fail "nm -g"
|
||||
} else {
|
||||
pass "nm -g"
|
||||
}
|
||||
|
||||
# Test nm -P
|
||||
|
||||
# This test does not work correctly on ECOFF targets, because ECOFF
|
||||
# stores most symbols twice, which messes up the nm output.
|
||||
setup_xfail "alpha*-*-osf*" "alpha*-*-netware*"
|
||||
setup_xfail "mips*-*-ultrix*" "mips*-*-ecoff*" "mips*-*-irix4*"
|
||||
setup_xfail "mips*-*-riscos*" "mips*-*-sysv3*" "mips*-sony-bsd*"
|
||||
|
||||
# This test does not work correctly on XCOFF targets, because XCOFF
|
||||
# does not enter static symbols in the symbol table.
|
||||
setup_xfail "*-*-aix*"
|
||||
|
||||
set got [binutils_run $NM "$NMFLAGS -P $tempfile"]
|
||||
|
||||
set want "common_symbol C \[0\]*4.*data_symbol D \[0-9a-fA-F\]*.*external_symbol U.*static_data_symbol d \[0-9a-fA-F\]*.*static_text_symbol t \[0-9a-fA-F\]*.*text_symbol T \[0-9a-fA-F\]*"
|
||||
|
||||
if [regexp $want $got] then {
|
||||
pass "nm -P"
|
||||
} else {
|
||||
fail "nm -P"
|
||||
}
|
||||
|
||||
# There are certainly other tests that could be run.
|
||||
@@ -1,603 +0,0 @@
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
|
||||
# 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
|
||||
# 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.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-dejagnu@prep.ai.mit.edu
|
||||
|
||||
# Written by Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
if ![is_remote host] {
|
||||
if {[which $OBJCOPY] == 0} then {
|
||||
perror "$OBJCOPY does not exist"
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
send_user "Version [binutil_version $OBJCOPY]"
|
||||
|
||||
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
|
||||
perror "unresolved 1"
|
||||
unresolved "objcopy (simple copy)"
|
||||
return
|
||||
}
|
||||
|
||||
if ![is_remote host] {
|
||||
set tempfile tmpdir/bintest.o;
|
||||
set copyfile tmpdir/copy;
|
||||
} else {
|
||||
set tempfile [remote_download host tmpdir/bintest.o]
|
||||
set copyfile copy
|
||||
}
|
||||
|
||||
# Test that objcopy does not modify a file when copying it.
|
||||
|
||||
set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS $tempfile ${copyfile}.o"]
|
||||
|
||||
if ![string match "" $got] then {
|
||||
fail "objcopy (simple copy)"
|
||||
} else {
|
||||
send_log "cmp $tempfile ${copyfile}.o\n"
|
||||
verbose "cmp $tempfile ${copyfile}.o"
|
||||
if [is_remote host] {
|
||||
set src1 tmpdir/bintest.o
|
||||
set src2 tmpdir/copy.o
|
||||
remote_upload host $tempfile $src1;
|
||||
remote_upload host ${copyfile}.o $src2;
|
||||
} else {
|
||||
set src1 ${tempfile}
|
||||
set src2 ${copyfile}.o
|
||||
}
|
||||
set status [remote_exec build cmp "${src1} ${src2}"];
|
||||
set exec_output [lindex $status 1];
|
||||
set exec_output [prune_warnings $exec_output]
|
||||
|
||||
# On some systems the result of objcopy will not be identical.
|
||||
# Usually this is just because gas isn't using bfd to write the files
|
||||
# in the first place, and may order things a little differently.
|
||||
# Those systems should use setup_xfail here.
|
||||
|
||||
setup_xfail "sh-*-coff" "sh-*-hms"
|
||||
setup_xfail "m68*-*-hpux*" "m68*-*-sunos*" "m68*-*-coff" "m68*-*-vxworks*"
|
||||
setup_xfail "m68*-ericsson-ose" "m68k*-motorola-sysv*"
|
||||
setup_xfail "i*86-*-aout*"
|
||||
setup_xfail "i*86-*-sysv3" "i*86-*-isc*" "i*86-*-sco*" "i*86-*-coff"
|
||||
setup_xfail "i*86-*-aix*" "i*86-*-go32*" "i*86-*-msdos*"
|
||||
setup_xfail "a29k-*-udi" "a29k-*-coff" "a29k-*-vxworks*"
|
||||
setup_xfail "i960-*-coff"
|
||||
setup_xfail "h8300-*-hms" "h8300-*-coff"
|
||||
setup_xfail "h8500-*-hms" "h8500-*-coff"
|
||||
setup_xfail "hppa*-*-*"
|
||||
clear_xfail "hppa*-*-*elf*" "hppa*-*-linux*"
|
||||
setup_xfail "m88*-*-coff" "m88*-motorola-sysv*"
|
||||
setup_xfail "z8*-*-coff"
|
||||
|
||||
if [string match "" $exec_output] then {
|
||||
pass "objcopy (simple copy)"
|
||||
} else {
|
||||
send_log "$exec_output\n"
|
||||
verbose "$exec_output" 1
|
||||
|
||||
# On OSF/1, this succeeds with gas and fails with /bin/as.
|
||||
setup_xfail "alpha*-*-osf*"
|
||||
|
||||
# This fails for COFF i960-vxworks targets.
|
||||
setup_xfail "i960-*-vxworks*"
|
||||
|
||||
fail "objcopy (simple copy)"
|
||||
}
|
||||
}
|
||||
|
||||
# Test generating S records.
|
||||
|
||||
# We make the srec filename 8.3 compatible. Note that the header string
|
||||
# matched against depends on the name of the file. Ugh.
|
||||
|
||||
if [is_remote host] {
|
||||
set srecfile copy.sre
|
||||
set header_string S00B0000636F70792E737265C1
|
||||
} else {
|
||||
set srecfile ${copyfile}.srec
|
||||
set header_string S0130000746D706469722F636F70792E7372656397
|
||||
}
|
||||
|
||||
set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS -O srec $tempfile ${srecfile}"]
|
||||
|
||||
if ![string match "" $got] then {
|
||||
fail "objcopy -O srec"
|
||||
} else {
|
||||
if [is_remote host] {
|
||||
remote_upload host ${srecfile} tmpdir/copy.srec;
|
||||
set srecfile tmpdir/copy.srec;
|
||||
}
|
||||
set file [open ${srecfile} r]
|
||||
|
||||
# The first S record is fixed by the file name we are using.
|
||||
gets $file line
|
||||
send_log "$line\n"
|
||||
verbose $line
|
||||
if ![regexp "$header_string.*" $line] {
|
||||
send_log "bad header\n"
|
||||
fail "objcopy -O srec"
|
||||
} else {
|
||||
while {[gets $file line] != -1 \
|
||||
&& [regexp "^S\[123\]\[0-9a-fA-F\]+\[\r\n\]*$" $line]} {
|
||||
send_log "$line\n"
|
||||
verbose $line
|
||||
set line "**EOF**"
|
||||
}
|
||||
send_log "$line\n"
|
||||
verbose $line
|
||||
if ![regexp "^S\[789\]\[0-9a-fA-F\]+\[\r\n\]*$" $line] then {
|
||||
send_log "bad trailer\n"
|
||||
fail "objcopy -O srec"
|
||||
} else {
|
||||
if {[gets $file line] != -1} then {
|
||||
send_log "garbage at end\n"
|
||||
send_log "$line\n"
|
||||
verbose $line
|
||||
fail "objcopy -O srec"
|
||||
} else {
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f ${copyfile}.srec"]
|
||||
if ![regexp "file format srec" $got] then {
|
||||
send_log "objdump failed\n"
|
||||
fail "objcopy -O srec"
|
||||
} else {
|
||||
pass "objcopy -O srec"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close $file
|
||||
}
|
||||
|
||||
# Test setting and adjusting the start address. We only test this
|
||||
# while generating S records, because we may not be able to set the
|
||||
# start address for other object file formats, and the S record case
|
||||
# is the only useful one anyhow.
|
||||
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f $tempfile"]
|
||||
if ![regexp "start address (\[0-9a-fA-FxX\]+)" $got all origstart] then {
|
||||
perror "objdump can not recognize bintest.o"
|
||||
set origstart ""
|
||||
} else {
|
||||
set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS -O srec $tempfile ${copyfile}.srec --set-start 0x7654"]
|
||||
if ![string match "" $got] then {
|
||||
fail "objcopy --set-start"
|
||||
} else {
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f ${copyfile}.srec"]
|
||||
if ![regexp "file format srec.*start address (\[0-9a-fA-FxX\]+)" $got all srecstart] then {
|
||||
fail "objcopy --set-start"
|
||||
} else {
|
||||
if {$srecstart != 0x7654} then {
|
||||
send_log "$srecstart != 0x7654\n"
|
||||
fail "objcopy --set-start"
|
||||
} else {
|
||||
pass "objcopy --set-start"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS -O srec $tempfile ${copyfile}.srec --adjust-start 0x123"]
|
||||
if ![string match "" $got] then {
|
||||
fail "objcopy --adjust-start"
|
||||
} else {
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f ${copyfile}.srec"]
|
||||
if ![regexp "file format srec.*start address (\[0-9a-fA-FxX\]+)" $got all srecstart] then {
|
||||
fail "objcopy --adjust-start"
|
||||
} else {
|
||||
if {$srecstart != $origstart + 0x123} then {
|
||||
send_log "$srecstart != $origstart + 0x123\n"
|
||||
fail "objcopy --adjust-start"
|
||||
} else {
|
||||
pass "objcopy --adjust-start"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Test adjusting the overall VMA, and adjusting the VMA of a
|
||||
# particular section. We again only test this when generating S
|
||||
# records.
|
||||
|
||||
set low ""
|
||||
set lowname ""
|
||||
|
||||
set headers [binutils_run $OBJDUMP "$OBJDUMPFLAGS -h $tempfile"]
|
||||
|
||||
set headers_regexp "\[ 0-9\]+(\[^ \]+)\[ \]*(\[0-9a-fA-F\]+)\[ \]+\[0-9a-fA-F\]+\[ \]+(\[0-9a-fA-F\]+)\[ \]+\[0-9a-fA-F\]+\[ \]+2\[*\]\[*\]\[0-9\]+(.*)"
|
||||
|
||||
set got $headers
|
||||
while {[regexp $headers_regexp $got all name size vma rest]} {
|
||||
set vma 0x$vma
|
||||
set size 0x$size
|
||||
if {$size != 0} {
|
||||
if {$low == "" || $vma < $low} {
|
||||
set low $vma
|
||||
set lowname $name
|
||||
}
|
||||
}
|
||||
set got $rest
|
||||
}
|
||||
|
||||
if {$low == "" || $origstart == ""} then {
|
||||
perror "objdump can not recognize bintest.o"
|
||||
} else {
|
||||
set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS -O srec $tempfile ${copyfile}.srec --adjust-vma 0x123"]
|
||||
if ![string match "" $got] then {
|
||||
fail "objcopy --adjust-vma"
|
||||
} else {
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -fh ${copyfile}.srec"]
|
||||
set want "file format srec.*start address\[ \]*(\[0-9a-fA-FxX\]+).*sec1\[ \]+\[0-9a-fA-F\]+\[ \]+(\[0-9a-fA-F\]+)"
|
||||
if ![regexp $want $got all start vma] then {
|
||||
fail "objcopy --adjust-vma"
|
||||
} else {
|
||||
set vma 0x$vma
|
||||
if {$vma != $low + 0x123} then {
|
||||
send_log "$vma != $low + 0x123\n"
|
||||
fail "objcopy --adjust-vma"
|
||||
} else {
|
||||
if {$start != $origstart + 0x123} then {
|
||||
send_log "$start != $origstart + 0x123\n"
|
||||
fail "objcopy --adjust-vma"
|
||||
} else {
|
||||
pass "objcopy --adjust-vma"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
set arg ""
|
||||
set got $headers
|
||||
while {[regexp $headers_regexp $got all name size vma rest]} {
|
||||
set vma 0x$vma
|
||||
if {$vma == $low} then {
|
||||
set arg "$arg --adjust-section-vma $name+4"
|
||||
}
|
||||
set got $rest
|
||||
}
|
||||
|
||||
set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS -O srec $tempfile ${copyfile}.srec $arg"]
|
||||
if ![string match "" $got] then {
|
||||
fail "objcopy --adjust-section-vma +"
|
||||
} else {
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -h ${copyfile}.srec"]
|
||||
set want "file format srec.*sec1\[ \]+\[0-9a-fA-F\]+\[ \]+(\[0-9a-fA-F\]+)"
|
||||
if ![regexp $want $got all vma] then {
|
||||
fail "objcopy --adjust-section-vma +"
|
||||
} else {
|
||||
set vma 0x$vma
|
||||
if {$vma != $low + 4} then {
|
||||
send_log "$vma != $low + 4\n"
|
||||
fail "objcopy --adjust-section-vma +"
|
||||
} else {
|
||||
pass "objcopy --adjust-section-vma +"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
regsub -all "\\+4" $arg "=[expr $low + 4]" argeq
|
||||
set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS -O srec $tempfile ${copyfile}.srec $argeq"]
|
||||
if ![string match "" $got] then {
|
||||
fail "objcopy --adjust-section-vma ="
|
||||
} else {
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -h ${copyfile}.srec"]
|
||||
set want "file format srec.*sec1\[ \]+\[0-9a-fA-F\]+\[ \]+(\[0-9a-fA-F\]+)"
|
||||
if ![regexp $want $got all vma] then {
|
||||
fail "objcopy --adjust-section-vma ="
|
||||
} else {
|
||||
set vma 0x$vma
|
||||
if {$vma != $low + 4} then {
|
||||
send_log "$vma != $low + 4\n"
|
||||
fail "objcopy --adjust-section-vma ="
|
||||
} else {
|
||||
pass "objcopy --adjust-section-vma ="
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Test stripping an object.
|
||||
|
||||
proc strip_test { } {
|
||||
global CC
|
||||
global STRIP
|
||||
global STRIPFLAGS
|
||||
global NM
|
||||
global NMFLAGS
|
||||
global srcdir
|
||||
global subdir
|
||||
|
||||
set test "strip"
|
||||
|
||||
if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog.o object debug] != "" } {
|
||||
untested $test
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
set objfile [remote_download host tmpdir/testprog.o];
|
||||
} else {
|
||||
set objfile tmpdir/testprog.o
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $STRIP "$STRIPFLAGS $objfile"]
|
||||
if ![string match "" $exec_output] {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $NM "-a $NMFLAGS $objfile"]
|
||||
if ![string match "*: no symbols*" $exec_output] {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
pass $test
|
||||
}
|
||||
|
||||
strip_test
|
||||
|
||||
# Test stripping an object file with saving a symbol
|
||||
|
||||
proc strip_test_with_saving_a_symbol { } {
|
||||
global CC
|
||||
global STRIP
|
||||
global STRIPFLAGS
|
||||
global NM
|
||||
global NMFLAGS
|
||||
global srcdir
|
||||
global subdir
|
||||
|
||||
set test "strip with saving a symbol"
|
||||
|
||||
if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog.o object debug] != "" } {
|
||||
untested $test
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
set objfile [remote_download host tmpdir/testprog.o];
|
||||
} else {
|
||||
set objfile tmpdir/testprog.o
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $STRIP "$STRIPFLAGS -K main -K _main $objfile"]
|
||||
if ![string match "" $exec_output] {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $NM "$NMFLAGS $objfile"]
|
||||
if {![regexp {^([0-9a-fA-F]+)?[ ]+T main} $exec_output] \
|
||||
&& ![regexp {^([0-9a-fA-F]+)?[ ]+T _main} $exec_output]} {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
pass $test
|
||||
}
|
||||
|
||||
strip_test_with_saving_a_symbol
|
||||
|
||||
# Build a final executable.
|
||||
|
||||
proc copy_setup { } {
|
||||
global srcdir
|
||||
global subdir
|
||||
global gcc_gas_flag
|
||||
|
||||
set res [build_wrapper testglue.o];
|
||||
set flags { debug };
|
||||
|
||||
if { $res != "" } {
|
||||
lappend flags "additional_flags=[lindex $res 1]";
|
||||
set add_libs "testglue.o";
|
||||
} else {
|
||||
set add_libs "";
|
||||
}
|
||||
|
||||
if { [istarget *-*-linux*] } {
|
||||
foreach i $gcc_gas_flag {
|
||||
set flags "additional_flags=$i $flags"
|
||||
}
|
||||
}
|
||||
if { [target_compile "$srcdir/$subdir/testprog.c $add_libs" tmpdir/testprog executable $flags] != "" } {
|
||||
return 2
|
||||
}
|
||||
|
||||
set result [remote_load target tmpdir/testprog];
|
||||
set status [lindex $result 0];
|
||||
|
||||
if { $status != "pass" } {
|
||||
perror "unresolved setup, status = $status"
|
||||
return 3
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# Test copying an executable.
|
||||
|
||||
proc copy_executable { prog flags test1 test2 } {
|
||||
|
||||
if [is_remote host] {
|
||||
set testfile [remote_download host tmpdir/testprog];
|
||||
set testcopy copyprog
|
||||
} else {
|
||||
set testfile tmpdir/testprog
|
||||
set testcopy tmpdir/copyprog
|
||||
}
|
||||
remote_file host delete $testcopy;
|
||||
|
||||
set exec_output [binutils_run $prog "$flags $testfile $testcopy"]
|
||||
|
||||
if ![string match "" $exec_output] {
|
||||
fail $test1
|
||||
fail $test2
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
remote_upload host $testcopy tmpdir/copyprog
|
||||
}
|
||||
|
||||
set status [remote_exec build "cmp" "tmpdir/testprog tmpdir/copyprog"]
|
||||
set exec_output [lindex $status 1];
|
||||
|
||||
if [string match "" $exec_output] then {
|
||||
pass $test1
|
||||
} else {
|
||||
send_log "$exec_output\n"
|
||||
verbose "$exec_output"
|
||||
|
||||
# This will fail for many reasons. For example, it will most
|
||||
# likely fail if a non-GNU linker is used. Therefore, we do
|
||||
# not insist that it pass. If you are using an assembler and
|
||||
# linker based on the same BFD as objcopy, it is worth
|
||||
# investigating to see why this failure occurs. If we are
|
||||
# cross compiling, we assume that a GNU linker is being used,
|
||||
# and expect it to succeed.
|
||||
if {[isnative]} then {
|
||||
setup_xfail "*-*-*"
|
||||
}
|
||||
|
||||
# This also fails for mips*-*-elf targets. See elf32-mips.c
|
||||
# mips_elf_sym_is_global.
|
||||
setup_xfail "mips*-*-elf"
|
||||
|
||||
setup_xfail "*arm*-*-coff"
|
||||
setup_xfail "arm*-*-pe"
|
||||
setup_xfail "thumb*-*-coff"
|
||||
setup_xfail "thumb*-*-pe"
|
||||
|
||||
fail $test1
|
||||
}
|
||||
|
||||
set output [remote_load target tmpdir/copyprog]
|
||||
set status [lindex $output 0];
|
||||
if { $status != "pass" } {
|
||||
fail $test2
|
||||
} else {
|
||||
pass $test2
|
||||
}
|
||||
}
|
||||
|
||||
# Test stripping an executable
|
||||
|
||||
proc strip_executable { prog flags test } {
|
||||
global NM
|
||||
global NMFLAGS
|
||||
|
||||
remote_download build tmpdir/copyprog tmpdir/striprog
|
||||
if [is_remote host] {
|
||||
set copyfile [remote_download host tmpdir/striprog];
|
||||
} else {
|
||||
set copyfile tmpdir/striprog
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $prog "$flags ${copyfile}"]
|
||||
if ![string match "" $exec_output] {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
remote_upload host ${copyfile} tmpdir/striprog;
|
||||
}
|
||||
|
||||
set result [remote_load target tmpdir/striprog]
|
||||
set status [lindex $result 0];
|
||||
if { $status != "pass" } {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $NM "$NMFLAGS ${copyfile}"]
|
||||
if ![string match "*: no symbols*" $exec_output] {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
pass $test
|
||||
}
|
||||
|
||||
# Test stripping an executable with saving a symbol
|
||||
|
||||
proc strip_executable_with_saving_a_symbol { prog flags test } {
|
||||
global NM
|
||||
global NMFLAGS
|
||||
|
||||
remote_download build tmpdir/copyprog tmpdir/striprog
|
||||
if [is_remote host] {
|
||||
set copyfile [remote_download host tmpdir/striprog];
|
||||
} else {
|
||||
set copyfile tmpdir/striprog
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $prog "$flags ${copyfile}"]
|
||||
if ![string match "" $exec_output] {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
remote_upload host ${copyfile} tmpdir/striprog;
|
||||
}
|
||||
|
||||
set result [remote_load target tmpdir/striprog]
|
||||
set status [lindex $result 0];
|
||||
if { $status != "pass" } {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
|
||||
set exec_output [binutils_run $NM "$NMFLAGS ${copyfile}"]
|
||||
if {![regexp {^[0-9a-fA-F]+ T main} $exec_output] \
|
||||
&& ![regexp {^[0-9a-fA-F]+ T _main} $exec_output]} {
|
||||
fail $test
|
||||
return
|
||||
}
|
||||
pass $test
|
||||
}
|
||||
|
||||
set test1 "simple objcopy of executable"
|
||||
set test2 "run objcopy of executable"
|
||||
set test3 "run stripped executable"
|
||||
set test4 "run stripped executable with saving a symbol"
|
||||
|
||||
switch [copy_setup] {
|
||||
"1" {
|
||||
# do nothing
|
||||
}
|
||||
"2" {
|
||||
untested $test1
|
||||
untested $test2
|
||||
untested $test3
|
||||
untested $test4
|
||||
}
|
||||
"3" {
|
||||
unresolved $test1
|
||||
unresolved $test2
|
||||
unresolved $test3
|
||||
unresolved $test4
|
||||
}
|
||||
"0" {
|
||||
copy_executable "$OBJCOPY" "$OBJCOPYFLAGS" "$test1" "$test2"
|
||||
strip_executable "$STRIP" "$STRIPFLAGS" "$test3"
|
||||
strip_executable_with_saving_a_symbol "$STRIP" "-K main -K _main $STRIPFLAGS" "$test4"
|
||||
}
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
# Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||
# 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
|
||||
# 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.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-dejagnu@prep.ai.mit.edu
|
||||
|
||||
# This file was written by Rob Savoye <rob@cygnus.com>
|
||||
# and rewritten by Ian Lance Taylor <ian@cygnus.com>
|
||||
|
||||
if ![is_remote host] {
|
||||
if {[which $OBJDUMP] == 0} then {
|
||||
perror "$OBJDUMP does not exist"
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
send_user "Version [binutil_version $OBJDUMP]"
|
||||
|
||||
# Simple test of objdump -i
|
||||
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -i"]
|
||||
|
||||
set cpus_expected [list]
|
||||
lappend cpus_expected a29k alliant alpha arc arm convex
|
||||
lappend cpus_expected d10v d30v fr30 h8 hppa i386 i860 i960
|
||||
lappend cpus_expected m32r m68hc11 m68hc12 m68k m88k MCore
|
||||
lappend cpus_expected mips mn10200 mn10300 ns32k pj powerpc pyramid
|
||||
lappend cpus_expected romp rs6000 s390 sh sparc tahoe tic54x tms320c54x v850
|
||||
lappend cpus_expected vax we32k z8k z8001 z8002
|
||||
|
||||
# Make sure the target CPU shows up in the list.
|
||||
lappend cpus_expected ${target_cpu}
|
||||
|
||||
# Create regexp
|
||||
set cpus_regex "([join $cpus_expected | ])"
|
||||
|
||||
verbose -log "CPU regex: $cpus_regex"
|
||||
|
||||
set want "BFD header file version.*srec\[^\n\]*\n\[^\n\]*header \[^\n\]*endian\[^\n\]*, data \[^\n\]*endian.*$cpus_regex"
|
||||
|
||||
if [regexp $want $got] then {
|
||||
pass "objdump -i"
|
||||
} else {
|
||||
fail "objdump -i"
|
||||
}
|
||||
|
||||
# The remaining tests require a test file.
|
||||
|
||||
|
||||
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
|
||||
return
|
||||
}
|
||||
if [is_remote host] {
|
||||
set testfile [remote_download host tmpdir/bintest.o]
|
||||
} else {
|
||||
set testfile tmpdir/bintest.o
|
||||
}
|
||||
|
||||
# Test objdump -f
|
||||
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f $testfile"]
|
||||
|
||||
set want "$testfile:\[ \]*file format.*architecture:\[ \]*${cpus_regex}.*HAS_RELOC.*HAS_SYMS"
|
||||
|
||||
if ![regexp $want $got] then {
|
||||
fail "objdump -f"
|
||||
} else {
|
||||
pass "objdump -f"
|
||||
}
|
||||
|
||||
# Test objdump -h
|
||||
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -h $testfile"]
|
||||
|
||||
set want "$testfile:\[ \]*file format.*Sections.*\[0-9\]+\[ \]+\[^ \]*(text|TEXT|\\\$CODE\\\$)\[^ \]*\[ \]*(\[0-9a-fA-F\]+).*\[0-9\]+\[ \]+\[^ \]*(\\.data|DATA)\[^ \]*\[ \]*(\[0-9a-fA-F\]+)"
|
||||
|
||||
if ![regexp $want $got all text_name text_size data_name data_size] then {
|
||||
fail "objdump -h"
|
||||
} else {
|
||||
verbose "text name is $text_name size is $text_size"
|
||||
verbose "data name is $data_name size is $data_size"
|
||||
set ets 8
|
||||
set eds 4
|
||||
# c54x section sizes are in bytes, not octets; adjust accordingly
|
||||
if [istarget *c54x*-*-*] then {
|
||||
set ets 4
|
||||
set eds 2
|
||||
}
|
||||
if {[expr "0x$text_size"] < $ets || [expr "0x$data_size"] < $eds} then {
|
||||
send_log "sizes too small\n"
|
||||
fail "objdump -h"
|
||||
} else {
|
||||
pass "objdump -h"
|
||||
}
|
||||
}
|
||||
|
||||
# Test objdump -t
|
||||
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -t $testfile"]
|
||||
|
||||
if [info exists vars] then { unset vars }
|
||||
while {[regexp "(\[a-z\]*_symbol)(.*)" $got all symbol rest]} {
|
||||
set vars($symbol) 1
|
||||
set got $rest
|
||||
}
|
||||
|
||||
if {![info exists vars(text_symbol)] \
|
||||
|| ![info exists vars(data_symbol)] \
|
||||
|| ![info exists vars(common_symbol)] \
|
||||
|| ![info exists vars(external_symbol)]} then {
|
||||
fail "objdump -t"
|
||||
} else {
|
||||
pass "objdump -t"
|
||||
}
|
||||
|
||||
# Test objdump -r
|
||||
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -r $testfile"]
|
||||
|
||||
set want "$testfile:\[ \]*file format.*RELOCATION RECORDS FOR \\\[\[^\]\]*(text|TEXT|\\\$CODE\\\$)\[^\]\]*\\\].*external_symbol"
|
||||
|
||||
if [regexp $want $got] then {
|
||||
pass "objdump -r"
|
||||
} else {
|
||||
fail "objdump -r"
|
||||
}
|
||||
|
||||
# Test objdump -s
|
||||
|
||||
set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -s $testfile"]
|
||||
|
||||
set want "$testfile:\[ \]*file format.*Contents.*(text|TEXT|\\\$CODE\\\$)\[^0-9\]*\[ \]*\[0-9a-fA-F\]*\[ \]*(00000001|01000000|00000100).*Contents.*(data|DATA)\[^0-9\]*\[ \]*\[0-9a-fA-F\]*\[ \]*(00000002|02000000|00000200)"
|
||||
|
||||
if [regexp $want $got] then {
|
||||
pass "objdump -s"
|
||||
} else {
|
||||
fail "objdump -s"
|
||||
}
|
||||
|
||||
# Options which are not tested: -a -d -D -R -T -x -l --stabs
|
||||
# I don't see any generic way to test any of these other than -a.
|
||||
# Tests could be written for specific targets, and that should be done
|
||||
# if specific problems are found.
|
||||
@@ -1,290 +0,0 @@
|
||||
# Copyright 1999, 2000 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
|
||||
# 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.
|
||||
#
|
||||
# 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.
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-dejagnu@prep.ai.mit.edu
|
||||
|
||||
# Written by Nick Clifton <nickc@cygnus.com>
|
||||
# Based on scripts written by Ian Lance Taylor <ian@cygnus.com>
|
||||
# and Ken Raeburn <raeburn@cygnus.com>.
|
||||
|
||||
# First some helpful procedures, then the tests themselves
|
||||
|
||||
# Return the contents of the filename given
|
||||
proc file_contents { filename } {
|
||||
set file [open $filename r]
|
||||
set contents [read $file]
|
||||
close $file
|
||||
return $contents
|
||||
}
|
||||
|
||||
# regexp_diff, based on simple_diff taken from ld test suite
|
||||
# compares two files line-by-line
|
||||
# file1 contains strings, file2 contains regexps and #-comments
|
||||
# blank lines are ignored in either file
|
||||
# returns non-zero if differences exist
|
||||
#
|
||||
proc regexp_diff { file_1 file_2 } {
|
||||
|
||||
set eof -1
|
||||
set end_1 0
|
||||
set end_2 0
|
||||
set differences 0
|
||||
set diff_pass 0
|
||||
|
||||
if [file exists $file_1] then {
|
||||
set file_a [open $file_1 r]
|
||||
} else {
|
||||
warning "$file_1 doesn't exist"
|
||||
return 1
|
||||
}
|
||||
|
||||
if [file exists $file_2] then {
|
||||
set file_b [open $file_2 r]
|
||||
} else {
|
||||
fail "$file_2 doesn't exist"
|
||||
close $file_a
|
||||
return 1
|
||||
}
|
||||
|
||||
verbose " Regexp-diff'ing: $file_1 $file_2" 2
|
||||
|
||||
while { 1 } {
|
||||
set line_a ""
|
||||
set line_b ""
|
||||
while { [string length $line_a] == 0 } {
|
||||
if { [gets $file_a line_a] == $eof } {
|
||||
set end_1 1
|
||||
break
|
||||
}
|
||||
}
|
||||
while { [string length $line_b] == 0 || [string match "#*" $line_b] } {
|
||||
if [ string match "#pass" $line_b ] {
|
||||
set end_2 1
|
||||
set diff_pass 1
|
||||
break
|
||||
} elseif [ string match "#..." $line_b ] {
|
||||
if { [gets $file_b line_b] == $eof } {
|
||||
set end_2 1
|
||||
break
|
||||
}
|
||||
verbose "looking for \"^$line_b$\"" 3
|
||||
while { ![regexp "^$line_b$" "$line_a"] } {
|
||||
verbose "skipping \"$line_a\"" 3
|
||||
if { [gets $file_a line_a] == $eof } {
|
||||
set end_1 1
|
||||
break
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
if { [gets $file_b line_b] == $eof } {
|
||||
set end_2 1
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if { $diff_pass } {
|
||||
break
|
||||
} elseif { $end_1 && $end_2 } {
|
||||
break
|
||||
} elseif { $end_1 } {
|
||||
send_log "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1\n"
|
||||
verbose "extra regexps in $file_2 starting with \"^$line_b$\"\nEOF from $file_1" 3
|
||||
set differences 1
|
||||
break
|
||||
} elseif { $end_2 } {
|
||||
send_log "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n"
|
||||
verbose "extra lines in $file_1 starting with \"^$line_a$\"\nEOF from $file_2\n" 3
|
||||
set differences 1
|
||||
break
|
||||
} else {
|
||||
verbose "regexp \"^$line_b$\"\nline \"$line_a\"" 3
|
||||
if ![regexp "^$line_b$" "$line_a"] {
|
||||
send_log "regexp_diff match failure\n"
|
||||
send_log "regexp \"^$line_b$\"\nline \"$line_a\"\n"
|
||||
set differences 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if { $differences == 0 && !$diff_pass && [eof $file_a] != [eof $file_b] } {
|
||||
send_log "$file_1 and $file_2 are different lengths\n"
|
||||
verbose "$file_1 and $file_2 are different lengths" 3
|
||||
set differences 1
|
||||
}
|
||||
|
||||
close $file_a
|
||||
close $file_b
|
||||
|
||||
return $differences
|
||||
}
|
||||
|
||||
# Find out the size by reading the output of the EI_CLASS field.
|
||||
# Similar to the test for readelf -h, but we're just looking for the
|
||||
# EI_CLASS line here.
|
||||
proc readelf_find_size { binary_file } {
|
||||
global READELF
|
||||
global READELFFLAGS
|
||||
global readelf_size
|
||||
|
||||
set readelf_size ""
|
||||
set testname "finding out ELF size with readelf -h"
|
||||
catch "exec $READELF $READELFFLAGS -h $binary_file > readelf.out" got
|
||||
|
||||
if ![string match "" $got] then {
|
||||
send_log $got
|
||||
fail $testname
|
||||
return
|
||||
}
|
||||
|
||||
if { ! [regexp "\n\[ \]*Class:\[ \]*ELF(\[0-9\]+)\n" \
|
||||
[file_contents readelf.out] nil readelf_size] } {
|
||||
verbose -log "EI_CLASS field not found in output"
|
||||
verbose -log "output is \n[file_contents readelf.out]"
|
||||
fail $testname
|
||||
return
|
||||
} else {
|
||||
verbose -log "ELF size is $readelf_size"
|
||||
}
|
||||
|
||||
pass $testname
|
||||
}
|
||||
|
||||
# Run an individual readelf test.
|
||||
# Basically readelf is run on the binary_file with the given options.
|
||||
# Readelf's output is captured and then compared against the contents
|
||||
# of the regexp_file-readelf_size if it exists, else regexp_file.
|
||||
|
||||
proc readelf_test { options binary_file regexp_file xfails } {
|
||||
|
||||
global READELF
|
||||
global READELFFLAGS
|
||||
global readelf_size
|
||||
global srcdir
|
||||
global subdir
|
||||
|
||||
send_log "exec $READELF $READELFFLAGS $options $binary_file > readelf.out\n"
|
||||
catch "exec $READELF $READELFFLAGS $options $binary_file > readelf.out" got
|
||||
|
||||
foreach xfail $xfails {
|
||||
setup_xfail $xfail
|
||||
}
|
||||
|
||||
if ![string match "" $got] then {
|
||||
send_log $got
|
||||
fail "readelf $options"
|
||||
return
|
||||
}
|
||||
|
||||
set target_machine ""
|
||||
if [istarget "mips*-*-*"] then {
|
||||
if { [istarget mips*el-*-*] || [istarget "mips*-*-*linux*"] } then {
|
||||
set target_machine tmips
|
||||
} else {
|
||||
set target_machine mips
|
||||
}
|
||||
}
|
||||
|
||||
if { $target_machine != "" && [file exists $srcdir/$subdir/$regexp_file-$readelf_size-$target_machine] } then {
|
||||
set regexp_file $regexp_file-$readelf_size-$target_machine
|
||||
} elseif { $target_machine != "" && [file exists $srcdir/$subdir/$regexp_file-$target_machine] } then {
|
||||
set regexp_file $regexp_file-$target_machine
|
||||
} elseif { [file exists $srcdir/$subdir/$regexp_file-$readelf_size] } then {
|
||||
set regexp_file $regexp_file-$readelf_size
|
||||
}
|
||||
|
||||
if { [regexp_diff readelf.out $srcdir/$subdir/$regexp_file] } then {
|
||||
fail "readelf $options"
|
||||
verbose "output is \n[file_contents readelf.out]" 2
|
||||
return
|
||||
}
|
||||
|
||||
pass "readelf $options"
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Only ELF based toolchains need readelf.
|
||||
# For now be paranoid and assume that if ELF is not mentioned
|
||||
# in the target string, then the target is not an ELF based port.
|
||||
|
||||
if { ![istarget *-*-elf*] \
|
||||
&& ![istarget *-*-linux*] \
|
||||
&& ![istarget i?86-*-sysv4*] \
|
||||
&& ![istarget i?86-*-unixware] \
|
||||
&& ![istarget mips*-*-irix5*] \
|
||||
&& ![istarget mips*-*-irix6*] \
|
||||
&& ![istarget powerpc-*-sysv4*] \
|
||||
&& ![istarget sparc*-*-solaris2*] } {
|
||||
verbose "$READELF is only intended for ELF targets" 2
|
||||
return
|
||||
}
|
||||
|
||||
if { [istarget *-*-linux*oldld*] \
|
||||
|| [istarget *-*-linux*aout*] } {
|
||||
verbose "$READELF is only intended for ELF targets" 2
|
||||
return
|
||||
}
|
||||
|
||||
if ![is_remote host] {
|
||||
if {[which $READELF] == 0} then {
|
||||
perror "$READELF does not exist"
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
send_user "Version [binutil_version $READELF]"
|
||||
|
||||
# Assemble the test file.
|
||||
if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
|
||||
perror "unresolved 1"
|
||||
unresolved "readelf - failed to assemble"
|
||||
return
|
||||
}
|
||||
|
||||
if ![is_remote host] {
|
||||
set tempfile tmpdir/bintest.o;
|
||||
} else {
|
||||
set tempfile [remote_download host tmpdir/bintest.o]
|
||||
}
|
||||
|
||||
# First, determine the size, so specific output matchers can be used.
|
||||
readelf_find_size $tempfile
|
||||
|
||||
# Run the tests.
|
||||
readelf_test -h $tempfile readelf.h {}
|
||||
readelf_test -S $tempfile readelf.s {}
|
||||
readelf_test -s $tempfile readelf.ss {}
|
||||
readelf_test -r $tempfile readelf.r {}
|
||||
|
||||
|
||||
# Compile the second test file.
|
||||
if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog.o object debug] != "" } {
|
||||
untested "readelf -w"
|
||||
return
|
||||
}
|
||||
|
||||
if [is_remote host] {
|
||||
set tempfile [remote_download host tmpdir/testprog.o];
|
||||
} else {
|
||||
set tempfile tmpdir/testprog.o
|
||||
}
|
||||
|
||||
# The xfail targets here do not default to DWARF2 format debug information
|
||||
# The symptom is that the output of 'readelf -wi' is empty.
|
||||
|
||||
readelf_test -wi $tempfile readelf.wi {v850*-*-* cris-*-* *-*-linux*}
|
||||
@@ -1,20 +0,0 @@
|
||||
ELF Header:
|
||||
Magic: 7f 45 4c 46 0[12] 0[12] 01 .. 00 00 00 00 00 00 00 00
|
||||
Class: ELF[36][24]
|
||||
Data: 2's complement,.* endian
|
||||
Version: 1 \(current\)
|
||||
OS/ABI: .*
|
||||
ABI Version: .*
|
||||
Type: REL \(Relocatable file\)
|
||||
Machine: .*
|
||||
Version: 0x1
|
||||
Entry point address: 0x0
|
||||
Start of program headers: 0 \(bytes into file\)
|
||||
Start of section headers: .* \(bytes into file\)
|
||||
Flags: .*
|
||||
Size of this header: .* \(bytes\)
|
||||
Size of program headers: 0 \(bytes\)
|
||||
Number of program headers: 0
|
||||
Size of section headers: .* \(bytes\)
|
||||
Number of section headers: .*
|
||||
Section header string table index: .*
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
Relocation section '.rel.*text' at offset 0x.* contains 1 entries:
|
||||
Offset Info Type Symbol's Value Symbol's Name.*
|
||||
00000004 [0-9A-Fa-f]+ *R_.*00000000 external_symbol.*
|
||||
@@ -1,24 +0,0 @@
|
||||
There are .* section headers, starting at offset .*:
|
||||
|
||||
Section Headers:
|
||||
\[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al
|
||||
\[ 0\] NULL 00000000 000000 000000 00 +0 +0 +0
|
||||
# On the normal MIPS systems, sections must be aligned to 16 byte
|
||||
# boundaries.
|
||||
\[ 1\] .text PROGBITS 00000000 0000(34|40) 0000(08|10) 00 +AX +0 +0 +(.|..)
|
||||
\[ 2\] .rel.+text +REL. +0+ 0+.* 00000. 0. +. +1 +4
|
||||
# MIPS targets put .rela.text here.
|
||||
#...
|
||||
\[ .\] .data PROGBITS 00000000 0000(3c|50) 0000(04|10) 00 WA +0 +0 +(.|..)
|
||||
\[ .\] .bss NOBITS 00000000 0000(4|6)0 000000 00 WA +0 +0 +(.|..)
|
||||
# MIPS targets put .reginfo and .mdebug here.
|
||||
# v850 targets put .call_table_data and .call_table_text here.
|
||||
#...
|
||||
\[ .\] .shstrtab STRTAB 00000000 0+.* 0+.* 00 +0 +0 +.
|
||||
\[ .\] .symtab SYMTAB 00000000 0+.* 0+.* 10 +.. +. +4
|
||||
\[..\] .strtab STRTAB 00000000 0+.* 0+.* 00 +0 +0 +1
|
||||
Key to Flags:
|
||||
W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\)
|
||||
I \(info\), L \(link order\), G \(group\), x \(unknown\)
|
||||
O \(extra OS processing required\) o \(OS specific\), p \(processor specific\)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user